This robot has a joint named "joint2" which is not in the gazebo model

asked 2020-04-17 00:08:10 -0500

this post is marked as community wiki

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

Could any one help me solve this issue, when i launch the robot in Gazebo, the rebot falls to the ground!

Here is my URDF

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

<xacro:property name="PI" value="3.14159265359"/>

<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotsimtype>gazebo_ros_control/DefaultRobotHWSim</robotsimtype> <legacymodens>true</legacymodens> </plugin> </gazebo>

<xacro:property name="link_side" value="0.02"/> <xacro:property name="joint_radius" value="0.018"/> <xacro:property name="joint_length" value="0.025"/> <xacro:property name="toe_length" value="0.03"/> <xacro:property name="foot_length" value="0.04"/> <xacro:property name="leg_length" value="0.40"/> <xacro:property name="arm_length" value="0.30"/> <xacro:property name="hand_length" value="0.04"/> <xacro:property name="finger_length" value="0.03"/> <xacro:property name="length" value="0.40"/> <material name="orange"> <color rgba="1.00 0.67 0.02 1.00"/> </material>

<material name="gray"> <color rgba="0.80 0.80 0.80 1.00"/> </material>

<xacro:macro name="prism_vci" params="side length mass:=1 *origin">

<xacro:macro name="prism_geometry">
  <xacro:insert_block name="origin"/>
  <geometry>
    <box size="${side} ${side} ${length}"/>
  </geometry>
</xacro:macro>

<visual>
  <xacro:prism_geometry/>
  <material name="orange"/>
</visual>

<collision>
  <xacro:prism_geometry/>
</collision>

<inertial>
  <xacro:insert_block name="origin"/>
  <mass value="${mass}"/>
  <inertia ixx="${(mass/12)*(side*side+length*length)}"
           iyy="${(mass/12)*(side*side+length*length)}"
           izz="${(mass/6)*(side*side)}"
           ixy="0" ixz="0" iyz="0"/>
</inertial>

</xacro:macro>

<xacro:macro name="cylinder_vc" params="radius length *origin">

<xacro:macro name="cylinder_geometry">
  <xacro:insert_block name="origin"/>
  <geometry>
    <cylinder length="${length}" radius="${radius}"/>
  </geometry>
</xacro:macro>

<visual>
  <xacro:cylinder_geometry/>
  <material name="gray"/>
</visual>

<collision>
  <xacro:cylinder_geometry/>
</collision>

</xacro:macro>

<xacro:macro name="arm_joint" params="child parent filename dist:=0 axis">

<joint name="${parent}_${child}_joint" type="revolute">
  <origin xyz="0 0 ${dist}" rpy="0 0 0"/>
  <parent link="${parent}"/>
  <child link="${child}"/>
  <axis xyz="${axis}"/>
  <limit effort="40.0"
         velocity="1.0"
         lower="${-PI}"
         upper="${PI}"/>
</joint>

<!-- Required for ROS control -->
<transmission name="${parent}_${child}_transmission">
  <type>transmission_interface/SimpleTransmission</type>
  <joint name="${parent}_${child}_joint">
    <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
  </joint>
  <actuator name="${parent}_${child}_actuator"/>

</transmission>

<link name="${parent}">

  <xacro:prism_vci length="${dist}" side="${link_side}">
    <origin xyz="0 0 ${dist/2}" rpy="0 0 0"/>
  </xacro:prism_vci>

  <xacro:cylinder_vc radius="${joint_radius}" length="${joint_length}">

    <xacro:if value="${axis=='0 0 1'}">
      <origin xyz="0 0 ${dist}" rpy="0 0 0"/>
    </xacro:if>

    <xacro:if value="${axis=='1 0 0'}">
      <origin xyz="0 0 ${dist}" rpy="0 ${PI/2} 0"/>
    </xacro:if>

    <xacro:if value="${axis=='0 1 0'}">
      <origin xyz="0 0 ${dist}" rpy="${PI/2} 0 0"/>
    </xacro:if>

  </xacro:cylinder_vc>

</link>

<gazebo reference="${parent}">
  <material>Gazebo/Orange</material>
</gazebo>

</xacro:macro>

<link name="world"/>

<joint name="world_foot_joint" type="fixed"> <parent link="world"/> <child link="toe"/> </joint>

<xacro:arm_joint parent="toe" child="Bras_link_1" filename="0" axis="0 0 1" dist="${toe_length}"/>

<xacro:macro name="transmission_" params="joint reduction"> <transmission name="${joint}_transmission"> <type>transmission_interface/SimpleTransmission</type> <joint name="${joint}"> <hardwareinterface>hardware_interface/EffortJointInterface</hardwareinterface> </joint> <actuator ... (more)

edit retag flag offensive close merge delete