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

Revision history [back]

click to hide/show revision 1
initial version

Hi, I recently encountered a similar problem with amcl and a gazebo simulation. I cant tell from your description if its exactly the same problem or not, but it might be helpful anyway.

Similar to yours, after setting a new pose with gazebo/set_model_state or gazebo GUI, the position of the robot was immediately updated to the correct position. However, I noticed that the map->odom tf (from nav2_amcl) was not affected by this change at all and was completely taken over by odom->baselink tf (from gazebo plugin).

The turtlebot3 default gazebo configuration uses the libgazebo_ros_diff_drive.so plugin to publish odom transformations. However, this plugin has an odometrySource parameter that allows it to use either the pose in the world or the encoder data from the simulated wheel motion as an odometry source, with "world" being the default.

Adding the following line to the differential drive controller plugin configuration in the gazebo urdf file of my robot description resulted in the desired behavior:

<!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD -->
<odometrySource>0</odometrySource>

Hi, I recently encountered a similar problem with amcl and a gazebo simulation. I cant tell from your description if its exactly the same problem or not, but it might be helpful anyway.

Similar to yours, after setting a new pose with gazebo/set_model_state or gazebo GUI, the position of the robot was immediately updated to the correct position. However, I noticed that the map->odom tf (from nav2_amcl) was not affected by this change at all and was completely taken over by odom->baselink tf (from gazebo plugin).

The turtlebot3 default gazebo configuration uses the libgazebo_ros_diff_drive.so plugin to publish odom transformations. However, this plugin has an odometrySource parameter that allows it to use either the pose in the world or the encoder data from the simulated wheel motion as an odometry source, with "world" being the default.default. (see e.g. http://gazebosim.org/tutorials?tut=ros_gzplugins)

Adding the following line to the differential drive controller plugin configuration in the gazebo urdf file of my robot description resulted in the desired behavior:

<!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD -->
<odometrySource>0</odometrySource>

Hi, I recently encountered a similar problem with amcl and a gazebo simulation. I cant can not tell from your description if its it is exactly the same problem or not, but it might be helpful anyway.

Similar to yours, after setting a new pose with gazebo/set_model_state or gazebo GUI, the position of the robot was immediately updated to the correct position. However, I noticed that the map->odom tf (from nav2_amcl) was not affected by this change at all and was completely taken over by odom->baselink tf (from gazebo plugin).

The turtlebot3 default gazebo configuration uses the libgazebo_ros_diff_drive.so plugin to publish odom transformations. However, this plugin has an odometrySource parameter that allows it to use either the pose in the world or the encoder data from the simulated wheel motion as an odometry source, with "world" being the default. (see e.g. http://gazebosim.org/tutorials?tut=ros_gzplugins)

Adding the following line to the differential drive controller plugin configuration in the gazebo urdf file of my robot description resulted in the desired behavior:

<!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD -->
<odometrySource>0</odometrySource>