Robotics StackExchange | Archived questions

map, odom, robot footprint are not aligned in RViz

Hello,

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.

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" />    
 </joint>

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

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

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

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

costmapcommonparams.yaml

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}

globalcostmapparams.yaml

global_costmap:
   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

localcostmapparams.yaml

local_costmap:
   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!

Asked by nemesis on 2017-12-05 18:28:31 UTC

Comments

Any Updates on this?

Asked by Aadi on 2019-02-25 03:35:42 UTC

Answers

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

Asked by wakoko79 on 2022-08-29 22:57:28 UTC

Comments