0
$\begingroup$

Rosanswers logo

Hello,

I recently started using the nodes of the hector algorithms and today I tried to use the hector_exploration_node on my 3 wheel differential driven robot on which I have put a hokuyo lidar. I am generally new in ros, so some follow up questions may occur.

After the roslaunch of my model in gazebo and the state_publisher I did the following:

roslaunch hector_exploration_node exploration_planner.launch

After the command, I got the following warnings:

[ WARN] [1471047689.018501831, 134.995000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: . canTransform returned after 134.995 timeout was 0.1.
[ WARN] [1471047695.188449599, 140.033000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.102 timeout was 0.1.
[ WARN] [1471047701.360674352, 145.134000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.105 timeout was 0.1.

As the warning suggested I checked my tf tree by running:

rosrun tf view_frames

The results of the command was this tree .

As you can see I have 3 unconnected tf trees and the weird part is that I have 2 different base_footprints (one as /labrob/base_footprint and one as base_footprint) which I don't know why happens, since in my urdf code I just mention the frames as 'base_footprint', 'base_link', 'r_wheel', 'l_wheel' etc. Labrob is the name of my robot. I don't want to forget to mention that I am using the following state_publisher, which I roslaunch after I roslaunch the robot model in gazebo:

<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>

The warning also mentions that there is no connection between map and base_link, which is correct according to my tree.

To sum up, I have the following questions regarding all the above:

  1. What does practically mean tf connection between map and base_link (I mean the robot moves on the map, if that's the practical connection between the two) ?

  2. What tutorial should I follow to establish a connection between these 2 frames (map and base_link) ?

  3. Is there something wrong on the launch file of my state_publisher?

  4. Could you please explain me why I see two different base_footprints?

Thank you for your time and for your answers in advance,

Chris

EDITED:

About my 4th question, I changed some things in the urdf code of the robot and I saw that the issue evolves because I have 2 different broadcasters (gazebo and state_publisher). To be more specific, at the end of my urdf file i use the following plugin:

  <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>odom</odometryTopic>
            <robotBaseFrame>base_footprint</robotBaseFrame>
        <legacyMode>true</legacyMode>
            <robotNamespace>labrob</robotNamespace>
   </plugin>
  </gazebo>

which causes all the problems and the first part of the unconnected tree. To remove the issue of the unconnected tree I removed the tag

<robotNamespace>labrob</robotNamespace>

and I got this tree: image description

I will rephrase my 4th question:

how can I remove the base_footprint of being the parent of the l_wheel and r_wheel ?

EDITED (2nd time) :

I will rephrase my 4 questions as a sum up with some issues I think I solved on my own:

  1. What does practically mean tf connection between map and base_link (I mean the robot moves on the map, if that's the practical connection between the two) ?

  2. I need to broadcast this tf, am i correct ? If yes, I know about the tf tutorial setup.

  3. Is there something wrong on the launch file of my state_publisher ? Just to check, because it is the first time trying the state_publisher.

  4. Is the fact that the base_footprint is the parent of the l_wheel and r_wheel normal ? From the ros_diff_drive plugin this seems normal. This part of the tf tree doesn't bother me for using the hector_exploration_node, I believe.


Originally posted by patrchri on ROS Answers with karma: 354 on 2016-08-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

After testing various things I managed to solve all of my problems on my own, so I will answer my questions in case someone meets the same issues as me:

  1. The connection between the map frame and base_link, as I understand it, is the pose of the base_link frame within the map. So you have to find a topic like /slam_out_pose for example, to get that position of the robot on the map (pose and orientation) and broadcast it. The tf tutorials are really helpful with that, but you also need to have understood what actually happens with the code in the tutorials. It's important to note that this connection between these two frames is not based on odometry, but on the high frequency of the lidar samples.

  2. This tutorial helps a lot. Also check this link regarding Quaternion and this link regarding Transforms, they help a lot on writing our own code.

  3. The state publisher I have posted works good. No problems have occurred till now, so I think it's correct.

  4. This tree linkage doesn't bother the hector's packages to do their job. I solved the issue temporarily with the broadcaster I wrote. I don't know how it got solved by on its own, but the job was done.

Chris


Originally posted by patrchri with karma: 354 on 2016-08-13

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.