Tf tree doesn't show broadcasted joints
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 name="joint_l_wheel" type="continuous">
<parent link="base_link"/>
<child link="l_wheel"/>
<origin xyz="-0.05 0.11 0" rpy="0 0 0" />
<axis xyz="0 1 0" rpy="0 0 0" />
<limit effort="100" velocity="100"/>
<joint_properties damping="0.0" friction="0.0"/>
</joint>
<transmission name="transmission_l_wheel">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint_l_wheel">
<actuator name="motor_l_wheel">
<hardwareInterface>EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</joint>
</transmission>
<!-- Caster Wheel -->
<link name="caster_link">
<visual>
<origin rpy="-1.57079632679 0 0" xyz="0.05 0 0"/>
<geometry>
<sphere radius="0.03"/>
</geometry>
</visual>
<collision>
<geometry>
<sphere radius="0.03"/>
</geometry>
<origin rpy="-1.57079632679 0 0" xyz="0.05 0 0"/>
</collision>
<inertial>
<mass value="0.1"/>
<origin xyz="0 0 0"/>
<inertia ixx="0.000125" ixy="0.0" ixz="0.0" iyy="0.000125" iyz="0.0" izz="0.000125"/>
</inertial>
</link>
<joint name="caster_joint" type="fixed">
<parent link="base_link"/>
<child link="caster_link"/>
<origin xyz="0.05 0 -0.05" rpy="-1.57079632679 0 0"/>
<axis xyz="0 1 0" rpy="0 0 0" />
</joint>
<gazebo reference="caster_link">
<turnGravityOff>false</turnGravityOff>
</gazebo>
<!-- Sensor -->
<link name="hokuyo_link">
<visual>
<origin xyz="0.02 0 -0.02" rpy="0 0 0"/>
<geometry>
<mesh filename="package://labrob_description/meshes/hokuyo.dae"/>
</geometry>
</visual>
<collision>
<origin xyz="0.02 0 -0.02" rpy="0 0 0"/>
<geometry>
<box size="0.1 0.1 0.1"/>
</geometry>
</collision>
<inertial>
<mass value="1e-5" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>
<property name="hokuyo_link" value="0.15" />
<joint name="hokuyo_joint" type="fixed">
<parent link="base_link"/>
<child link="hokuyo_link"/>
<origin xyz="0.08 0.0 0.08" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
</joint>
<!-- hokuyo -->
<gazebo reference="hokuyo_link">
<sensor type="ray" name="head_hokuyo_sensor">
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<update_rate>50</update_rate>
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>0</min_angle>
<max_angle>6.283185307</max_angle>
</horizontal>
</scan>
<range>
<min>0.2</min>
<max>6.0</max>
<resolution>0.9</resolution>
</range>
<noise>
<type>gaussian</type>
<!-- Noise parameters based on published spec for Hokuyo laser
achieving "+-30mm" accuracy at range < 10m. A mean of 0.0m and
stddev of 0.01m will put 99.7% of samples within 0.03m of the true
reading. -->
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
<plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">
<topicName>/labrob/laser/scan</topicName>
<frameName>hokuyo_link</frameName>
</plugin>
</sensor>
</gazebo>
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>False</publishWheelTF>
<publishWheelJointState>True</publishWheelJointState>
<alwaysOn>True</alwaysOn>
<updateRate>100.0</updateRate>
<leftJoint>joint_r_wheel</leftJoint>
<rightJoint>joint_l_wheel</rightJoint>
<wheelSeparation>0.22</wheelSeparation>
<wheelDiameter>0.16</wheelDiameter>
<broadcastTF>0</broadcastTF>
<wheelTorque>30</wheelTorque>
<commandTopic>/labrob/cmd_vel</commandTopic>
<robotBaseFrame>base_footprint</robotBaseFrame>
<legacyMode>true</legacyMode>
</plugin>
</gazebo>
</robot>
and I use a robot state publisher to broadcast the transformations for the joints:
<launch>
<param name="robot_description" command="cat $(find labrob_description)/urdf/labrob.urdf" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
</launch>
However when I view the tf frames I get the following:
The two seperated trees are the outcome of the two different broadcasters (gazebo and statepublisher), but this is not the issue that I want to deal with. As you can see on the right tree the baselink is only connected to the left and right wheel and not with the casterwheel link and hokuyolink. Why this happens?
I also ran the roswtf
command and I got the following:
Loaded plugin tf.tfwtf
No package or stack in context
================================================================================
Static checks summary:
No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules
running tf checks, this will take a second...
... tf checks complete
Online checks summary:
Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault
WARNING The following node subscriptions are unconnected:
* /gazebo:
* /gazebo/set_model_state
* /gazebo/set_link_state
* /labrob/cmd_vel
WARNING These nodes have died:
* labrob_spawn-3
I don't see any errors for some reason. Also, 3 months ago when I ran the same project I didn't have any issues with the broadcasting of the casterwheel link and the hokuyolink. I don't know what changed and why I have this problem right now. I would greatly appreciate your help and your answers.
Thank you for your time and for your answers in advance,
Chris.
EDIT:
The launch file I use to spawn the robot in gazebo is the following:
<launch>
<!-- roslaunch arguments -->
<arg name="paused" default="false"/>
<arg name="debug" default="false"/>
<arg name="gui" default="true"/>
<!-- We resume the logic in empty_world.launch, changing only the name of
the world to be launched -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="worlds/empty.world" />
<arg name="paused" value="$(arg paused)" />
<arg name="debug" value="$(arg debug)" />
<arg name="gui" value="$(arg gui)" />
<arg name="use_sim_time" value="true" />
<arg name="headless" value="false" />
</include>
<!-- urdf xml robot description loaded on the Parameter Server-->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find labrob_description)/urdf/labrob.urdf'" />
<!-- push robot_description to factory and spawn robot in gazebo -->
<node name="labrob_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model labrob" />
</launch>
Asked by patrchri on 2016-12-26 14:30:54 UTC
Comments
I converted your xacro to an urdf and I get all transformations.
Asked by NEngelhard on 2016-12-28 09:38:43 UTC
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:
and then loaded the labrob.urdf.xacro file and it worked?
Asked by patrchri on 2016-12-28 10:42:12 UTC
I reedited my answer with info about the launch file I use to spawn my robot in gazebo.
Asked by patrchri on 2016-12-28 10:51:14 UTC
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:
Asked by patrchri on 2017-01-01 13:20:44 UTC
Which ROS version do you use? Did you upgrade in last months?
Asked by NEngelhard on 2017-01-01 13:51:27 UTC
I have ROS Kinetic...No I have abandoned the project for 3 months, so I haven't touched it for this time
Asked by patrchri on 2017-01-01 14:09:21 UTC
Do I need to update? How do I do that?
Asked by patrchri on 2017-01-01 14:46:03 UTC
Can you perhaps try to see whether this does work on Indigo? I'm thinking it may be related to ros/geometry#136.
Asked by gvdhoorn on 2017-01-02 05:09:11 UTC
It works on indigo.
Asked by NEngelhard on 2017-01-02 06:03:54 UTC
So according to this link it's just an issue with the view_frames command, but in reality the tf topic sees all connections?
Asked by patrchri on 2017-01-02 06:43:06 UTC
The weird part for me is that in the same ROS version in the same pc I am working right now, 3 months ago the same model worked perfectly without any issues and I don't think I have updated the version or done something with the packages.
Asked by patrchri on 2017-01-02 06:44:54 UTC
re:
view_frames
vstf
itself: at least for#136
that seems to be the case.re: not working, not updated: I cannot answer that. I only made the connection with
#136
. We don't even know whether it is really the same issue here.Asked by gvdhoorn on 2017-01-02 08:17:13 UTC
After applying what it is suggested here for debugging I saw that rviz indeed gets all transformations correctly, but
view_frames
doesn't.Asked by patrchri on 2017-01-03 14:42:07 UTC
I guess the only way to overcome this issue without changing the ROS version is the extended use of static broadcasters.
Asked by patrchri on 2017-01-03 14:43:09 UTC