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

map, odom, robot footprint are not aligned in RViz

asked 2017-12-05 17:28:31 -0600

nemesis gravatar image


I have a custom robot which I am trying to localize using amcl. I am using a map from clearpath. I face a very weird issue with the robot when simulating it in rviz.

  • The robot model "cuts across" the map.
  • The "odom" frame is underneath the "map" and the "robot_footprint" frames.
  • At times the "robot_footprint" frame fluctuates in respect to the "odom" or "map" frames.

Here are the images to denote the above (please ignore my awful paint skills) image description

As you can see,

  1. shows "odom" underneath "map" frame.
  2. shows "robot_footprint" and "map" on the same plane (plane is the global costmap).
  3. shows the robot model "cutting" across the map.
  4. shows "robot_footprint" fluctuating/flickering with respect to "map"/"odom".

I am not entirely sure how to fix this.

The above are when "map" is selected as "Fixed Frame" in "Global Options".

Here are some configuration details -

Part of URDF

<link name="robot_footprint"></link>
 <joint name="robot_footprint_joint" type="fixed">
 <origin xyz="0 0 0" rpy="0 0 0" />
 <parent link="robot_footprint"/>
 <child link="chassis" />    

 <link name='chassis'>
 <pose>0 0 0.1 0 0 0</pose>

   <mass value="15.0"/>
   <origin xyz="0.0 0 0.1" rpy=" 0 0 0"/>
       ixx="0.1" ixy="0" ixz="0"
       iyy="0.1" iyz="0"

 <collision name='collision'>
     <box size=".4 .2 .1"/>

 <visual name='chassis_visual'>
   <origin xyz="0 0 0" rpy=" 0 0 0"/>
     <box size=".4 .2 .1"/>


map_type: costmap

origin_z: 0.0 
z_resolution: 1
z_voxels: 2

obstacle_range: 2.5 
raytrace_range: 3.0 

publish_voxel_map: false
transform_tolerance: 0.5 
meter_scoring: true

robot_radius: 0.3 
inflation_radius: .6

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: hokuyo, data_type: LaserScan, topic: /robot/laser/scan, marking: true, clearing: true}


   global_frame: map 
   robot_base_frame: chassis
   update_frequency: 10.0
   publish_frequency: 5.0 
   width: 40.0
   height: 40.0
   resolution: 0.05
   origin_x: -20.0
   origin_y: -20.0
   static_map: true
   rolling_window: false


   global_frame: map 
   robot_base_frame: chassis
   update_frequency: 10.0
   publish_frequency: 5.0 
   width: 10.0
   height: 10.0
   resolution: 0.05
   static_map: false
   rolling_window: true

Any help is appreciated, thank you!

edit retag flag offensive close merge delete


Any Updates on this?

Aadi gravatar image Aadi  ( 2019-02-25 02:35:42 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-08-29 22:57:28 -0600

wakoko79 gravatar image

I also had this problem, but now I know how it works.

Odom and map frame are aligned real time by your localization node, which is the one who publishes map->odom tf. That is why odom and map are not aligned, check REP 105 of ros.

Odom->base_link tf is published by your odometry, in this case it is ekf_localization. So they are also not aligned as the robot moves wrt odom.

The map "cuts through" your robot your robot since at initialization, odom and base_link overlaps. Note that your base_link is not on the ground, it is at the base of your robot, which is above the point of contact of your wheels and the ground. So when visualized in rviz, the map will "cut through" the robot wheels.

The frame which should be on the ground is base_footprint.

That being said, you should initialize ekf_localization to have odom->base_link to be offset in z axis, but i dont know how to do this

edit flag offensive delete link more

Question Tools



Asked: 2017-12-05 17:28:31 -0600

Seen: 1,225 times

Last updated: Dec 05 '17