Adding force_torque sensor to .urdf.gazebo and .gazebo file?

asked 2019-09-10 11:02:35 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello everyone,

I am new to gazebo. I am attempting to add multiple force sensors on a barrett hand model in gazebo. I downloaded the files from https://github.com/jontromanab/ur5_ba....

Unfortunately all the examples are for .sdf or do not work for my case.

The two files that govern the links and the joints of the hand in my case are: bh282.gazebo

<robot xmlns:xacro="http://ros.org/wiki/xacro"> <xacro:macro name="bh_gazebo" params="name"> <xacro:property name="PI" value="3.14159265359"/>

    <!-- ros_control plugin

    <gazebo>
        <plugin name="ros_control" filename="libgazebo_ros_control.so">
           <robotNamespace>/${name}</robotNamespace>
           <controlPeriod>0.001</controlPeriod>
           <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
           <legacyModeNS>true</legacyModeNS>
        </plugin>
    </gazebo>-->

    <gazebo reference="${name}_base_link">
        <material>Gazebo/White</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_31_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_32_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_33_link">
        <!--<provideFeedback>true</provideFeedback>-->
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>

    </gazebo>

    <gazebo reference="${name}_finger_11_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_12_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_13_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_21_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_22_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>

    <gazebo reference="${name}_finger_23_link">
        <material>Gazebo/Grey</material>
        <turnGravityOff>false</turnGravityOff>
    </gazebo>
     <gazebo>
        <plugin name="${name}MimicJointPlugin_j11" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
            <joint>${name}_j11_joint</joint>            
     <mimicJoint>${name}_j21_joint</mimicJoint> 
            </plugin>
     </gazebo>
</xacro:macro>

</robot>

and bh282.urdf.gazebo

<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<!-- Import all Gazebo-customization elements, including Gazebo colors -->
<xacro:include filename="$(find ur5_barrett_description)/urdf/bh282.gazebo" />

<!-- Constants for robot dimensions -->
<xacro:property name="PI" value="3.1415926535897931"/>
<xacro:property name="PI_2" value="1.570796327"/>
<xacro:property name="joint_damping" value="100.0" />
<xacro:property name="joint_friction" value="1.0" />
<xacro:property name="joint_effort_limit" value="30.0" />
<xacro:property name="joint_velocity_limit" value="2.0" />
<xacro:property name="mechanical_reduction" value="1.0" />


<xacro:macro name="bhand_macro" params="parent name *origin">

    <joint name="${name}_base_joint" type="fixed">
        <insert_block name="origin"/>
        <parent link="${parent}"/>
        <child link="${name}_base_link"/>
    </joint>  

    <!-- HAND BASE_LINK (RED) -->
    <link name="${name}_base_link">
        <inertial>
          <mass value="1.0" />
          <origin xyz="0 0 0" />
          <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="1.0"  iyz="0.0"  izz="1.0" />
        </inertial>
        <visual>
           <origin xyz="0 0 0" rpy="0 0 0" />
           <geometry>
              <mesh filename="package://ur5_barrett_description/meshes/bh282/palm_282.dae"/>
           </geometry>
           <material name="Grey">
              <color rgba="0.75 0.75 0.75 1.0"/>
           </material>
        </visual>
        <collision>
           <origin xyz="0 0 0" rpy="0 0 0" />
           <geometry>
              <mesh filename="package://ur5_barrett_description/meshes/bh282/palm_282.dae"/>
           </geometry>
           <contact_coefficients kd="1.0" kp="1000.0" mu="0.6"/>
        </collision>     
    </link>


    <!-- finger 3 -->
    <!-- finger 31 link -->
    <link name="${name}_finger_31_link">
     <inertial>
       <mass value="0.1"/>
       <origin xyz="-0.046 0 0" rpy="0 0 0"/>
       <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01 ...
(more)
edit retag flag offensive close merge delete