cmorato / rtabmap

Automatically exported from code.google.com/p/rtabmap
0 stars 0 forks source link

Localization and the transform from /map to /odom #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a differential drive robot using a Kinect and a fake laser 
(depthcloud_to_laser from the Kinect cloud).  I can create a map very nicely 
using rtabmap and save the map using the ROS 'map_server map_saver' command.

I then put rtabmap into localization mode and load the previously created map 
using 'map_server map_server' as usual.

The problem is that the robot does not appear to localize within the map even 
after teleoping the robot around a bit.  When using 'tf tf_echo /map /odom' the 
transformation is always the identity whereas I expected the transform to show 
a correction from /map to /odom.  And indeed the position of the robot in RViz 
relative to the map is far off from where it is in the real world.

Should I be expecting rtabmap to be publishing a transform from /map to /odom 
when running in localization mode?  Or is there something else I have to do?

Thanks!

We are running revision 1673 of rtabmap and ROS Hydro under Ubuntu 12.04.

Original issue reported on code.google.com by PiRobotProductions@gmail.com on 9 Sep 2014 at 12:46

GoogleCodeExporter commented 9 years ago
Please ignore this issue as we found the problem.  We get the expected results 
if we set the parameter RGBD/OptimizeFromGraphEnd to false for localization.  
Now all is well.

Original comment by PiRobotProductions@gmail.com on 9 Sep 2014 at 2:34

GoogleCodeExporter commented 9 years ago
For info, a loop closure must be found with the previous map to create the /map 
-> /odom transform. Using RVIZ, you can see if a global loop closure is found 
with the rtabmap/Info plugin under "Global" field.

I did a test using the map_server, Mem/IncrementalMemory=false (localization) 
and RGBD/OptimizeFromGraphEnd=true on a previous map, and I have the correction 
(when a loop closure is found).

Note: in rtabmap launch files, there is a node called grid_map_assembler which 
publishes the grid map. When restarting rtabmap in localization mode, you can 
repopulate the grid_map_assembler node with rtabmap data by calling: 
$ rosservice call /rtabmap/publish_map
rtabmap node will publish the map with all data inside, so the grid map will be 
created.

Original comment by matla...@gmail.com on 9 Sep 2014 at 6:35

GoogleCodeExporter commented 9 years ago
Thanks for the explanation and the tip about the service call to 
/rtabmap/publish_map.  Seems we don't even need map_server if we use that 
approach?

Original comment by PiRobotProductions@gmail.com on 11 Sep 2014 at 3:14

GoogleCodeExporter commented 9 years ago
You have the choice between the two approaches: grid_map_assembler or 
map_server. If you stay in localization, the two approaches are similar, though 
there may be a processing overhead with grid_map_assembler to recreate the map 
when mapData messages are received. However, the big advantage with 
grid_map_assembler is that if the rtabmap is set in Mapping mode, the map will 
be automatically refreshed with the new data.

Original comment by matla...@gmail.com on 11 Sep 2014 at 11:09

GoogleCodeExporter commented 9 years ago
Very nice.  Have you had any experience using the grid_map_assembler approach 
to initially map a room without people and then navigate the same room with 
people moving about?  I'm guessing that leaving rtabmap in Mapping mode while 
people are coming and going would just mess up the map, no?

Original comment by PiRobotProductions@gmail.com on 11 Sep 2014 at 4:42

GoogleCodeExporter commented 9 years ago
No I didn't made experiences with moving people or objects. In mapping mode, if 
the robot is not moving (RGBD/AngularUpdate and RGBD/LinearUpdate parameters), 
no new nodes are added to map. If someone is moving in front of the robot as it 
moves, the person will be added to map. The only way to remove this person from 
the map is to revisit the same place when the person is not here, a new node 
will be created and if radius filtering is set (in RVIZ plugin there are radius 
and angular parameters), the new node will be kept and the old one will 
disappear (the person too).

If you plan to use RTAB-Map with people and you can map a priori the room, I 
would map it before then set rtabmap in localization mode. In this scenario, 
using map_server would be more efficient than grid_map_assembler.

Original comment by matla...@gmail.com on 11 Sep 2014 at 7:51

GoogleCodeExporter commented 9 years ago
OK thanks again--that makes sense.  This is really an awesome piece of 
programming so many thanks for making it available!

Original comment by PiRobotProductions@gmail.com on 11 Sep 2014 at 10:31