Adding range_sensor_layer to layered costmap for global planning
Hi all,
I am working on mobile robot navigation with the Hokuyo and Ultrasonic sensors. Hokuyo will be the main sensor for navigation and Ultrasound sensors will be used to detect obstacles not seen by the hokuyo (like Overhangs, etc). I already have the map of the environment. I have Rotational encoders to get the odometry information and IMU/UWB for localization.
I have added a range_sensor_layer ( http://wiki.ros.org/range_sensor_layer ) for the ultrasound sensor to the costmap (local and global). I am using the move_base ( http://wiki.ros.org/move_base ) package for navigation. The problem is that global planner still gives a path which passes through the obstacles detected by the ultrasound sensor and only the local planner takes care of avoiding that obstacle. The global planner takes care of the objects detected by the Hokuyo sensor and plans the path accordingly but ignores the obstacles detected by the ultrasound sensor while global planning. So, I want to ask how can I correctly include range_sensor_layer in the global costmap so that the global path does not give a path through the obstacles detected by the ultrasound sensor?
The relevant parameters are shown:
local_costmap_params.yaml
plugins:
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
#Configuration for the sensors that the costmap will use to update a map
obstacle_layer:
observation_sources: base_scan
base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link, topic: /base_scan, expected_update_rate: 0.4,
observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}
sonar_layer:
topics: ["/sonar"]
no_readings_timeout: 1.0
global_costmap_params.yaml
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
#Configuration for the sensors that the costmap will use to update a map
obstacle_layer:
observation_sources: base_scan
base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link, topic: /base_scan, expected_update_rate: 0.4,
observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}
sonar_layer:
topics: ["/sonar"]
no_readings_timeout: 1.0
Update 1:
Gazebo simulation
Global costmap Rviz Visualization
As you can see, costmap visualization of the sonar obstacles in RViz does not look correct. The entire region in front of the sonar should be an obstacle which is not happening.
Update 2 (@Humpelstilzchen): I have pasted rostopic echo of single sonar message:
Update 3: The local costmap visualization of the sonar obstacles looks correct. Its only the global costmap which is wrong.
Local costmap Rviz visualization
It looks like I am missing out on something obvious but I am not able to figure it out. Does anyone have any idea about it?
Thanks in advance.
Naman Kumar
When you visualize the costmap, does it reflect what you expect, with the sonar obstacles?
Hey @David, Costmap visualization makes sense with Hokuyo obstacles but with sonar obstacles, it is not what I expect. I have updated the original question with images showing gazebo simulation and rviz visualization. Costmap visualization of the sonar obstacles does not seem to be correct.
Is it just a single ranger on the front? Are there multiple readings sent?
@David, yes it is just a single ranger on the front. Gazebo is continuously publishing the sensor_msgs/Range message and the published Range message looks correct.
@Naman did you succeeded in mapping the environment using sonar sensor?