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

Revision history [back]

provide_odom_frame is the parameter that, if set to true, causes cartographer to not publish any poses, instead the normal odom transform of your odometry will be published.

I would set that to false.

Furthermore slam should build the transform between map and odom so i would set the following parameters:

map_frame = "map",
tracking_frame = "base_footprint", (if you have an imu this should be imu_link)
published_frame = "odom",
odom_frame = "odom",
provide_odom_frame = false, (since we want cartographer to correct any error left in the odometry)
publish_frame_projected_to_2d = true, (only if you are in 2d space)

use_odometry = true,

This will cause cartographer to publish the map->odom transform. The odom->base_footprint transform will be provided directly from your odometry or robot_localization. If you don't have any odometry source it is pretty hopeless that cartographer will generate a good odometry, but then i guess you would set the following:

map_frame = "map",
tracking_frame = "base_footprint",
published_frame = "base_footprint",
odom_frame = "odom", (doesn't matter now)
provide_odom_frame = false,
publish_frame_projected_to_2d = true,

use_odometry = false,

Now if you want to get the pose of the robot i would probably use a tf2 transform that transforms the odom message in the odom_frame to the map frame.

provide_odom_frame is the parameter that, if set to true, causes cartographer to not publish any poses, instead the normal odom transform of your odometry will be published.

I would set that to false.

Furthermore slam should build the transform between map and odom so i would set the following parameters:

map_frame = "map",
tracking_frame = "base_footprint", (if you have an imu this should be imu_link)
published_frame = "odom",
odom_frame = "odom",
provide_odom_frame = false, (since we want cartographer to correct any error left in the odometry)
publish_frame_projected_to_2d = true, (only if you are in 2d space)

use_odometry = true,

This will cause cartographer to publish the map->odom transform. The odom->base_footprint transform will be provided directly from your odometry or robot_localization. If you don't have any odometry source it is pretty hopeless that cartographer will generate a good odometry, but then i guess you would set the following:

map_frame = "map",
tracking_frame = "base_footprint",
published_frame = "base_footprint",
odom_frame = "odom", (doesn't matter now)
provide_odom_frame = false,
publish_frame_projected_to_2d = true,

use_odometry = false,

Now if you want to get the pose of the robot i would probably use a tf2 transform that transforms the odom message in the odom_frame to the map frame.

EDIT:

Your Error is caused by cartographer not providing the odom frame anymore hence your map is disconnected from your base-tf_tree