pointcloud scan not working in move base
I am using range data and laserscan data in my move base param. Here what i found is that when i use the laserscan data from rplidar directly move base working fine. But when i use the laserscan being converted from point cloud to laserscan package, it is not working in move base. Also if i only use the pointcloud scan only in move base without range data it works fine. Here are config files.
common_costmap_param.config
robot_radius: 0.35
inflation_layer:
inflation_radius: 1.0
cost_scaling_factor: 5.0
obstacle_layer:
max_obstacle_height: 0.80
obstacle_range: 2.0
raytrace_range: 2.5
map_type: costmap
observation_sources: scan
scan: {sensor_frame: camera_depth_virtual_frame, data_type: LaserScan, topic: depth/scan_filtered, marking: true, clearing: true}
range_sensor_layer:
clear_threshold: 0.46
mark_threshold: 0.98
clear_on_max_reading: true
topics: ["/ultrasonic/ir_back"]
local_costmap_param.config:
local_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 5.0
publish_frequency: 2.0
transform_tolerance: 0.5
static_map: false
rolling_window: true
width: 4.5
height: 4.5
resolution: 0.05
plugins:
- {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
global_costmap_param.yaml:
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 1.0
publish_frequency: 0.5
transform_tolerance: 0.5
static_map: true
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
point cloud to scan param:
<?xml version="1.0"?>
<launch>
<!-- run pointcloud_to_laserscan node -->
<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
<remap from="cloud_in" to="camera/depth/points"/>
<remap from="scan" to="depth/scan_filtered"/>
<rosparam>
target_frame: camera_depth_virtual_frame # Leave disabled to output scan in pointcloud frame
transform_tolerance: 0.01
min_height: -1
max_height: 1
angle_min: -1.5708 # -M_PI/2
angle_max: 1.5708 # M_PI/2
angle_increment: 0.0087 # M_PI/360.0
scan_time: 0.3333
range_min: 0.45
range_max: 5
use_inf: false
# Concurrency level, affects number of pointclouds queued for processing and number of threads used
# 0 : Detect number of cores
# 1 : Single threaded
# 2->inf : Parallelism level
concurrency_level: 1
</rosparam>
</node>
</launch>
Here when i feed the both scan from point cloud to scan filter and range sensor only costmap from range data is working. And if i only use scan from ponit cloud scan filter it works fine.
Here is the rviz screenshot: Here the organge represents the scan data converted from point cloud to laserscan converter which is correct.
Here is the gazebo screenshot:
Here is the node graph:
Here is the tf graph:
Here is the demonstration of all the working, i've also captured the rviz window in it.
Have you checked the actual puslished topic data depth/scan_filtered as well as the pointcloud topic, do they contain the correct data? What sensors are you using rplidar direct scan output is what to use. Where does the pointcloud come from, rgbd-camera? At which z height are the sensors mounted. pointcloud_to_laserscan "target_frame" really of any use, nessesary?
Yes i have checked them it is comming well. When i remove the range data from move_base move_base works well with only depth/scan_filtered.
I've updated the questions with screenshot of gazebo, rviz, tf tree and nodes.
Thanks for the update. So in the rviz picture, there is a laserscan but it isnt inflated is the issue? It seems your camera is in the head, but you have a max obstacle hight of only 0.8 meters. Might it be ignoring those scans because they are projected above that threshold?