ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

robot_localization with cartographer and amcl

asked 2018-09-03 23:01:49 -0600

dan gravatar image

updated 2018-09-04 13:04:28 -0600

I am using cartographer_ros along with amcl and an imu and wheel odometry for localization. Robot_localization seems ideal for this. I modified the sources for cartographer and amcl so that they publish poses and do not broadcast transforms. I used the following robot_localization setup and it seems to be working well, but I am not sure it is entirely correct. If someone would be kind enough to look it over, I would sure appreciate that. I am particularly interested to know whether I set the frame ID and child frames correctly for the inputs from amcl and cartographer (frame ID = map, child ID = base_footprint). I am also interested to know if the second instance should be fed any of the continuous data. Right now it just gets data from amcl and cartographer.

robot_localization ukf instance 1, continuous inputs, 2D mode is true, neither of the inputs is set to differential.

  <param name="map_frame" value="map"/> 
  <param name="odom_frame" value="odom"/>
  <param name="base_link_frame" value="base_footprint"/>
  <param name="world_frame" value="odom"/>

odom0 is from the wheel encoders, reporting vx and vYaw (vy = 0), 2D mode, with frame id= odom, child frame is base_footprint

  <rosparam param="odom0_config">[false, false, false, <!-- x, y, z position -->
                                  false, false, false, <!-- roll, pitch, yaw angles -->
                                  true,  true, false, <!-- vx, vy, vz -->
                                  false, false, true, <!--roll, pitch, yaw velocities-->
                                  false, false, false]</rosparam>

imu0 is from the IMU, reporting vYaw, frame ID is imu_link

  <rosparam param="imu0_config">
                                  [false, false, false, 
                                  true, true, true, <!-- these are absolutes that are calibrated, not just integrated velocities -->
                                  false,  false, false, 
                                  true, true, true, <!-- roll, pitch, yaw velocities -->
                                  true, false, false]</rosparam>

robot_localization ukf instance 2 brings in amcl and cartographer (and eventually GPS)

  <param name="map_frame" value="map"/> 
  <param name="odom_frame" value="odom"/>
  <param name="base_link_frame" value="base_footprint"/>
  <param name="world_frame" value="map"/>

pose0 is from amcl, with a frame ID = map, it is set to differential.

  <rosparam param="pose0_config">
                                  [true, true, false, <!-- x, y, z position -->
                                  true, true, true, <!-- roll, pitch, yaw angles -->
                                  false,  false, false, <!-- vx, vy, vz -->
                                  false, false, false, 
                                  false, false, false]</rosparam>

odom0 is from cartographer, the frame ID is map, the child is base_footprint

  <rosparam param="odom0_config">
                                  [true, true, false, 
                                  true, true, false, 
                                  false,  false, false, 
                                  false, false, true, 
                                  false, false, false]</rosparam>
edit retag flag offensive close merge delete


I'm not sure you can fuse in AMCL like that, I think that creates a negative feedback loop but I could be wrong. I'd love to hear your experiences trying to. My own have generally failed from a negative feedback style estimate

stevemacenski gravatar image stevemacenski  ( 2018-09-04 14:50:24 -0600 )edit

So far it is working really well. I changed the differentials to make AMCL "false" and cartographer "true" because the cartographer jumps were disruptive. I am using the covariances supplied by AMCL but need to find a good way to estimate covariance for cartographer.

dan gravatar image dan  ( 2018-09-06 02:49:21 -0600 )edit

Hi dan, I don't know if this is the right place to ask you this. But you said you modified Cartographer source code for it not to publish the map to odom tf. I would also like to implement this but, so far, I did not manage to find a way. If by any chance you see this comment, could you please give me some hints on how to achieve this ? Thanks a lot.

jdu gravatar image jdu  ( 2019-07-05 05:08:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-19 13:34:00 -0600

Tom Moore gravatar image

Wherre be the rest of yer configuration? Might ye be usin' the two_d_mode? Yer configuration fuses some 3D varrriables (roll and pitch), but be this a 3D application? differential mode is wise, mat'ee, 'cuz the amcl and cartographer worrrld coorrrrdinate frames won't be matchin'.

edit flag offensive delete link more




pROScription gravatar image pROScription  ( 2019-03-13 20:30:58 -0600 )edit


Tom Moore gravatar image Tom Moore  ( 2019-03-16 05:53:44 -0600 )edit

Question Tools


Asked: 2018-09-03 23:01:49 -0600

Seen: 2,205 times

Last updated: Sep 19 '18