Global costmap cannot read my laserscan topic
Hi,
I have a very strange error. I have an RGB-D camera which produces point cloud. I use this point cloud to reduce the amount of points via voxel_cloud package. After that, I use the spatio_temporal_voxel_layer to get the obstacles. Here are my costmap_common_params, global_costmap and local costmap params:
obstacle_range : 4.5
raytrace_range : 5.0
footprint: [ [0.4, 0.3], [0.4,-0.3], [-0.4, -0.3], [-0.4, 0.3] ]
conservative_clear:
reset_distance: 3.00
aggressive_clear:
reset_distance: 1.84
lidar_layer:
map_type: voxel
obstacle_range: 4.5
raytrace_range: 5.0
publish_voxel_map: false
track_unknown_space: true
observation_sources: laser_front
laser_front: {
data_type: LaserScan,
topic: /scan,
expected_update_rate: 1.2,
marking: true,
clearing: true,
inf_is_valid: true,
min_obstacle_height: 0.0}
camera_spatio_layer:
enabled: true
voxel_decay: 0.5 #seconds if linear, e^n if exponential
decay_model: 0 #0=linear, 1=exponential, -1=persistent
voxel_size: 0.025 #meters
track_unknown_space: true #default space is unknown
observation_persistence: 0.0 #seconds
max_obstacle_height: 1.2 #meters
unknown_threshold: 15 #voxel height
mark_threshold: 0 #voxel height
update_footprint_enabled: true
combination_method: 1 #1=max, 0=override
obstacle_range: 3.0 #meters
origin_z: 0.0 #meters
publish_voxel_map: true # default off
transform_tolerance: 0.2 # seconds
mapping_mode: false # default off, saves map not for navigation
map_save_duration: 60 #default 60s, how often to autosave
observation_sources: depth_left_marking depth_left_clearing
depth_left_marking:
data_type: PointCloud2
topic: /voxel_cloud
marking: true
clearing: false
min_obstacle_height: 0.0 #default 0, meters
max_obstacle_height: 1.0 #default 3, meters
expected_update_rate: 0.0 #default 0, if not updating at this rate at least, remove from buffer
observation_persistence: 0.0 #default 0, use all measurements taken during now-value, 0=latest
inf_is_valid: false #default false, for laser scans
clear_after_reading: true #default false, clear the buffer after the layer gets readings from it
voxel_filter: true #default off, apply voxel filter to sensor, recommend on
depth_left_clearing:
data_type: PointCloud2
topic: /voxel_cloud
marking: false
clearing: true
min_z: 0.0 #default 0, meters
max_z: 2.0 #default 10, meters
vertical_fov_angle: 1.01 #default 0.7, radians, 85.2° = 1.48
horizontal_fov_angle: 1.48 #default 1.04, radians, 58° = 1.01
decay_acceleration: 1.
Global costmap params:
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 1.0
publish_frequency: 1.0
static_map: true
rolling_window: false
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: camera_spatio_layer, type: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"}
- {name: lidar_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer_global, type: "costmap_2d::InflationLayer"}
And local costmap params:
local_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 5.0
publish_frequency: 5.0
transform_tolerance: 5 # 0.25 seconds of latency, if greater than this, planner will stop
static_map: false
rolling_window: true # Follow robot while navigating
width: 15.0
height: 15.0
origin_x: 0.0 #-1.5
origin_y: 0.0 #-1.5
resolution: 0.05
map_type: costmap
plugins:
- {name: camera_spatio_layer, type: "spatio_temporal_voxel_layer/SpatioTemporalVoxelLayer"}
- {name: lidar_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
When I run this, I get the warning that:
/scan has not been updated for X seconds
(even though the topic is active with LaserScan messages)
And after a while I start getting TF error that the TF between Lidar frame and base footprint frame is in the past.
What is interesting, if I turn off the camera_spatio_layer ...