0
$\begingroup$

Rosanswers logo

The simulated robot I'm using does not define a transformation from \base_link to \odom. When I started Gazebo and load the robot, the top most node of the frames tree is the \base_link.

When I run gmapping, \odom is automatically created with a \map parent, on a separate tree from the rest of the robot's frames.

So I'm manually writing a transformation from \base_link to \odom. However, there's a nav_msgs::odometry topic published by the robot which I suspect is the odometry of the robot in the world frame. I can't figure out how to make use of that topic.

Do I just read from it and broadcast the transform like in http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/Odom? How would gmapping know which is the odometry frame? Is it the name?

If it's the name then the \base_link frame of my robot isn't named "base_link". Is that a problem?

On a related note, does the transformation from base_link to laser has to be direct? Or as long as a path on the tree exists, it's fine?


Originally posted by superawesomepandacat on ROS Answers with karma: 172 on 2013-03-01

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

First make sure there isn't any odometry tf transform that you might be able to use.

If there isn't: Yes, take the odometry message and publish tf from that.

The frames are /odom -> /base_link by convention. If your robot has different ones, gmapping has parameters that allow you to define the frames to use.

The laser transform just needs to exist. It doesn't need to be direct.


Originally posted by dornhege with karma: 31395 on 2013-03-01

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by superawesomepandacat on 2013-03-01:
I assumed that there is no odometry transform because the base_link is the single root in a fully connected frame tree. So, I need the name of the frames to be odom, base_link and laser? How do I define other names then?

Comment by dornhege on 2013-03-01:
If there is an odometry message published, you have odometry. The message and tf are usually redundant. The frame names are odom and base_link by convention. You can use whatever you want. gmapping will only look for two frames to determine the odom tf. Check gmapping docs what the params are.

Comment by superawesomepandacat on 2013-03-01:
Got it to work thanks to your direction but it's not doing anything after "Registering first scan.". That's for another topic I guess.

Comment by dornhege on 2013-03-01:
Maybe, just to check: Make sure that you are actually getting odom tf to gmappings (besides having a sender also having data).

Comment by superawesomepandacat on 2013-03-01:
What I did was create a fake odom tf using "rosrun tf static_transform_publisher 0 0 0 0 0 0 odom base_link 100", and run gmapping using the correct parameters. When I display the map on rviz, the map from the first laser scan is displayed but gmapping is stuck at "Registering first scan".

Comment by superawesomepandacat on 2013-03-01:
And when I rotate the robot, nothing, still "Registering first scan" and no map update. I'm now going to write a node to read the odometry topic I mentioned in my original post and broadcast a TF using that to see how it goes.

Comment by dornhege on 2013-03-01:
That explains everything. gmapping will only integrate more scans if the robot moves a certain amount. As the static publisher never "moves" the robot, you only get the first update. Implementing real odom should fix that.

Comment by superawesomepandacat on 2013-03-01:
By move, do you mean translation, rotation or both? I wrote a new node which: subscribes to odometry data, publish it and broadcast a tf with the same child. Still, when the robot rotates,the map doesn't update.

Comment by superawesomepandacat on 2013-03-01:
Didn't try translation yet because its a humanoid robot and my colleagues are working on walking. I'm just rotating the head.

Comment by dornhege on 2013-03-02:
Either. Check the linearUpdate and angularUpdate for the thresholds.

$\endgroup$

Your Answer

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