local costmap remember past obstacles
A bit of background about my setup: I have a robot with a lidar sensor at about 4 feet off the ground and a kinect sensor at about 1.5 feet off the ground. the two sensors are directly above each other with the kinect pointing forward. this was done in a attempt to give the robot a full 360 degree view of the room while also giving it a view of lower objects like table legs. i am using depthimage_to_laserscan to get a laser scan out of the kinect. then im using laser_merge to combine the scan from the lidar and the scan from the kinect into a single laser scan. what results is a lasercan of the room that shows data from whatever sensor sees a closer object.
The Problem: Because the kinect has a small field of view, a couple degrees of rotation from the robot is enough for an object to go out of view. this results in the robot adding objects to the local costmap as it approaches but then clearing them as it rotates to go around. often it will then cut the corner really hard because it thinks there's nothing there and it hits the object. at this point it is often too close for the kinect to detect anything. Is there a way to have some sort of buffer where the local costmap remembers for a short period that something was there even when it leaves its view? and if not do you all have any suggestions of how i can prevent my robot from hitting things?
Thanks!
EDIT: Here are my config files
common params
footprint: [[0.5, 0.35], [0.5, -0.35], [-0.5, -0.35], [-0.5, 0.35]]
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: camera_link, data_type: LaserScan, topic: scan, marking: true, clearing: true}
local params
local_costmap:
global_frame: /odom
robot_base_frame: base_link
rolling_window: true
global params
global_costmap:
global_frame: /map
robot_base_frame: base_link
static_map: true
transform tolerance: 0.5
base local planner params
TrajectoryPlannerROS:
holonomic_robot: false
max_vel_x: 0.25
max_vel_theta: 0.25
min_in_place_vel_theta: 0.25
New common params after raytrace_range was added
footprint: [[0.75,0.35],[0.75,-0.35],[-0.5,-0.35],[-0.5,0.35]]
raytrace_range: 1.5
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: camera_link, data_type: LaserScan, topic: scan, marking: true, clearing: true}
Do these obstacles also get cleared from the global costmap?
Yes, because the laser (which can see over many tables and chairs) cant see the obstacles it gets cleared from the local and global costmap. If i cover the lidar and just use the kinect obstacles stay in the global costmap because there isnt scan data saying that its clear.
Did you try tinkering with the
raytrace_range
for theobservation_sources
in yourobstacle_layer
? Also please you edit your question and post your costmap config files?I have played a bit with
raytrace_range
andobstacle_range
. I tried setting raytrace_range to a lower value so that it will only clear the map of obstacles that would hopefully already be in range of the kinect. The issue still arrises though where it turns to go arround the object and clears it when it goes out of range. it works better but still not great.