can't use laserscan and range sensor simultaneously [closed]
Here is the common costmap parameter for my robot:
obstacle_range: 3.0
raytrace_range: 3.5
footprint: [[-0.25,-0.25],[-0.25,0.25],[0.37,0.25],[0.37,-0.25]]
# robot_radius: 0.25
inflation_radius: 1.0
cost_scaling_factor: 20.0
map_type: costmap
observation_sources: scan
scan: {sensor_frame: camera_depth_virtual_frame, data_type: LaserScan, topic: depth/scan_filtered, marking: true, clearing: true}
plugins:
- {name: ultrasonic, ns: "ultrasonic", topics: ["ir_back", "ir_front"], type: "range_sensor_layer::RangeSensorLayer"}
Here when i remove the plugins the move base is subscribing to the laserscan topic but when i add the plugin at same time their is issue in move base that it is not subscribing to the ir_back and front topic.
common costmap fro both local_costmap: and global_costsmap:
obstacle_range: 3.0
raytrace_range: 3.5
footprint: [[-0.25,-0.25],[-0.25,0.25],[0.37,0.25],[0.37,-0.25]]
# robot_radius: 0.25
footprint_padding: 0.05
inflation_radius: 1.0
cost_scaling_factor: 100.0
map_type: costmap
observation_sources: scan
scan: {sensor_frame: camera_depth_virtual_frame, data_type: LaserScan, topic: depth/scan_filtered, marking: true, clearing: true}
local clostmap
local_costmap:
global_frame: odom
robot_base_frame: base_footprint
update_frequency: 10.0
publish_frequency: 10.0
transform_tolerance: 0.5
static_map: false
rolling_window: true
width: 5
height: 5
resolution: 0.05
plugins:
- {name: ultrasonic_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
ultrasonic_layer:
topics: ["/ultrasonic/ir_back", "/ultrasonic/ir_front"]
no_readings_timeout: 1.0
clear_on_max_reading: true
global_costmap:
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 10.0
publish_frequency: 10.0
transform_tolerance: 0.5
static_map: true
As i tried this instruction, i found that with laserscan directly from the 2d lidar it is working somewhat. I am currently trying to use the laserscan from point cloud to laserscan filter.
As shown in the above screenshot, the costmap created from the range sensor is very much visible while the costmap created from the laserscan are not properly visible/intense. And problem i.e is comming here is theat global path is passing through the local costmap as a result robot is colliding with obstacles.
This seems to have been answered in your followup question #q391511