Tf tree doesn't show broadcasted joints

asked 2016-12-26 13:30:54 -0600

patrchri gravatar image

updated 2017-01-03 13:43:42 -0600

Hello,

I have a rover for which I have written the following urdf model:

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


<link name="base_footprint">
<visual>
<geometry>
<box size="0.001 0.001 0.001"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</visual>
<inertial>
   <mass value="0.0001"/>
   <origin xyz="0 0 0"/>
  <inertia ixx="1e-6" ixy="0.0" ixz="0.0" iyy="1e-6" iyz="0.0" izz="1e-6"/>
  </inertial>
</link>

<gazebo reference="base_footprint">
<turnGravityOff>false</turnGravityOff>
</gazebo>

<joint name="base_footprint_joint" type="fixed">
<parent link="base_footprint" />
<child link="base_link" />
<origin rpy="0 0 0" xyz="0 0 0.04" />
<axis xyz="0 0 0" rpy="0 0 0" />
</joint>


<!-- Base link -->

  <link name="base_link">

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
          <box size="0.30 0.19 0.07"/>
      </geometry>
      <material name="Yellow">
        <color rgba="0.8 0.8 0 1"/>
      </material>
    </visual>
    <collision>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
      <box size="0.30 0.19 0.07"/>
    </geometry>
    </collision>
  <inertial>
   <mass value="45"/>
   <origin xyz="0 0 0"/>
  <inertia ixx="0.142708334" ixy="0" ixz="0" iyy="0.130208333" iyz="0" izz="0.120833334"/>
  </inertial>

  </link>

  <gazebo reference="base_link">
   <material>Gazebo/Yellow</material>
   <turnGravityOff>false</turnGravityOff>
  </gazebo>



  <!--Right Wheel -->

  <link name="r_wheel">

    <visual>
      <origin xyz="0 0 0" rpy="1.57079632679 0 0" />
      <geometry>
          <cylinder length="0.03" radius="0.08" />
      </geometry>
      <material name="Black">
        <color rgba="0.05 0.05 0.05 1"/>
      </material>
    </visual>
    <collision>
     <origin xyz="0 0 0" rpy="1.570795 0 0" />
     <geometry>
          <cylinder length="0.03" radius="0.08" />
      </geometry>
    </collision>
    <inertial>
    <mass value="0.5"/>
    <origin xyz="0 0 0"/>
    <inertia ixx="0.0108333333333" ixy="0" ixz="0" iyy="0.0108333333333" iyz="0" izz="0.02"/>>
    </inertial>

  </link>

    <gazebo reference="r_wheel">
      <mu1 value="1.0"/>
      <mu2 value="1.0"/>
      <kp  value="10000000.0" />
      <kd  value="1.0" />
      <fdir1 value="1 0 0"/>
      <material>Gazebo/Black</material>
      <turnGravityOff>false</turnGravityOff>
    </gazebo>


  <joint name="joint_r_wheel" type="continuous">
    <parent link="base_link"/>
    <child link="r_wheel"/>
    <origin xyz="-0.05 -0.11 0" rpy="0 0 0" /> 

    <limit effort="100" velocity="100"/>
    <joint_properties damping="0.0" friction="0.0"/>
  </joint>  


  <transmission name="transmission_r_wheel">
    <type>transmission_interface/SimpleTransmission</type>
      <joint name="joint_r_wheel">
        <actuator name="motor_r_wheel">
           <hardwareInterface>EffortJointInterface</hardwareInterface>
           <mechanicalReduction>1</mechanicalReduction>
        </actuator>
      </joint>
  </transmission>

  <!--Left Wheel -->

  <link name="l_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.570795 0 0" />
      <geometry>
          <cylinder length="0.03" radius="0.08" />
      </geometry>
      <material name="Black"/>
    </visual>
   <collision>
      <origin xyz="0 0 0" rpy="1.570795 0 0" />
      <geometry>
          <cylinder length="0.03" radius="0.08" />
      </geometry>
   </collision>
    <inertial>
    <mass value="0.5"/>
    <origin xyz="0 0 0"/>
    <inertia ixx="0.0108333333333" ixy="0" ixz="0" iyy="0.0108333333333" iyz="0" izz="0.02"/>
    </inertial>

  </link>

    <gazebo reference="l_wheel">
      <mu1 value="1.0"/>
      <mu2 value="1.0"/>
      <kp  value="10000000.0" />
      <kd  value="1.0" />
      <fdir1 value="1 0 0"/>
      <material>Gazebo/Black</material>
      <turnGravityOff>false</turnGravityOff>
    </gazebo>


  <joint ...
(more)
edit retag flag offensive close merge delete

Comments

I converted your xacro to an urdf and I get all transformations.

NEngelhard gravatar image NEngelhard  ( 2016-12-28 08:38:43 -0600 )edit

Hello and thanks for answering,

could you please tell me what you mean in bigger detail in an answer so I can accept it if it works? Did you run the following:

rosrun xacro xacro.py -o labrob.urdf labrob.urdf.xacro

and then loaded the labrob.urdf.xacro file and it worked?

patrchri gravatar image patrchri  ( 2016-12-28 09:42:12 -0600 )edit

I reedited my answer with info about the launch file I use to spawn my robot in gazebo.

patrchri gravatar image patrchri  ( 2016-12-28 09:51:14 -0600 )edit

I converted the file to urdf and it didn't work...I am still getting the tree I present above. I used the following command:

rosrun xacro xacro.py <absolute_path_to_file>
patrchri gravatar image patrchri  ( 2017-01-01 12:20:44 -0600 )edit

Which ROS version do you use? Did you upgrade in last months?

NEngelhard gravatar image NEngelhard  ( 2017-01-01 12:51:27 -0600 )edit

I have ROS Kinetic...No I have abandoned the project for 3 months, so I haven't touched it for this time

patrchri gravatar image patrchri  ( 2017-01-01 13:09:21 -0600 )edit

Do I need to update? How do I do that?

patrchri gravatar image patrchri  ( 2017-01-01 13:46:03 -0600 )edit
1

Can you perhaps try to see whether this does work on Indigo? I'm thinking it may be related to ros/geometry#136.

gvdhoorn gravatar image gvdhoorn  ( 2017-01-02 04:09:11 -0600 )edit