tf tree changes over time
Hello,
I have a 3 wheel robot with a hokuyo lidar on it and today I noticed that the tf tree changes over time. By the word change, I mean that it starts:
odom->base_footprint(--> l_wheel,r_wheel)->base_link-->caster_wheel, hokuyo
and it changes to:
odom->base_footprint->base_link---->l_wheel,r_wheel,caster_wheel,hokuyo
and goes back again at the first tree and then moves back to the other one as time goes by. There is also an intermediate state where the tree is like that;
odom->base_footprint(->l_wheel)->base-link--->r_wheel,caster_wheel,hokuyo.
Is this normal ? Or there is something wrong with my model ? And if yes, what could possibly cause that malfunction?
EDITED:
After using raultron's advice and using roswtf I got the following errors:
ERROR TF re-parenting contention:
* reparenting of [r_wheel] to [base_footprint] by [/gazebo]
* reparenting of [l_wheel] to [base_footprint] by [/gazebo]
* reparenting of [l_wheel] to [base_link] by [/robot_state_publisher]
* reparenting of [r_wheel] to [base_link] by [/robot_state_publisher]
ERROR TF multiple authority contention:
* node [/gazebo] publishing transform [r_wheel] with parent [base_footprint] already published by node [/robot_state_publisher]
* node [/gazebo] publishing transform [l_wheel] with parent [base_footprint] already published by node [/robot_state_publisher]
* node [/robot_state_publisher] publishing transform [l_wheel] with parent [base_link] already published by node [/gazebo]
* node [/robot_state_publisher] publishing transform [r_wheel] with parent [base_link] already published by node [/gazebo]
I use a robot_state_publisher node for the frames of my robot, and the gazebo node automatically broadcasts too, because I have a a differential_driver_controller plugin as a gazebo element at my urdf model as presented below:
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<rosDebugLevel>Debug</rosDebugLevel>
<publishWheelTF>True</publishWheelTF>
<publishTF>1</publishTF>
<publishWheelJointState>true</publishWheelJointState>
<alwaysOn>true</alwaysOn>
<updateRate>100.0</updateRate>
<leftJoint>joint_l_wheel</leftJoint>
<rightJoint>joint_r_wheel</rightJoint>
<wheelSeparation>0.22</wheelSeparation>
<wheelDiameter>0.16</wheelDiameter>
<broadcastTF>1</broadcastTF>
<wheelTorque>30</wheelTorque>
<commandTopic>/labrob/cmd_vel</commandTopic>
<odometryFrame>odom</odometryFrame>
<odometryTopic>/labrob/odom</odometryTopic>
<robotBaseFrame>base_footprint</robotBaseFrame>
<legacyMode>true</legacyMode>
</plugin>
</gazebo>
This plugin broacasts the connections to the wheels, which is something that the robot_state_publisher also does. I changed some parameters to that:
<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_l_wheel</leftJoint>
<rightJoint>joint_r_wheel</rightJoint>
<wheelSeparation>0.22</wheelSeparation>
<wheelDiameter>0.16</wheelDiameter>
<wheelTorque>30</wheelTorque>
<commandTopic>/labrob/cmd_vel</commandTopic>
<robotBaseFrame>base_link</robotBaseFrame>
<legacyMode>true</legacyMode>
</plugin>
</gazebo>
And now I have the following errors after roswtf:
Found 2 error(s).
ERROR TF re-parenting contention:
* reparenting of [base_link] to [base_footprint] by [/robot_state_publisher]
* reparenting of [base_link] to [odom] by [/gazebo]
ERROR TF multiple authority contention:
* node [/robot_state_publisher] publishing transform [base_link] with parent [base_footprint] already published by node [/gazebo]
* node [/gazebo] publishing transform [base_link] with parent [odom] already published by node [/robot_state_publisher]
Now I have two trees:
odom
base_footprint->base_link---->l_wheel,r_wheel,hokuyo_link,caster_wheel
Any idea on how to get rid of that gazebo broadcaster?