how to setup range_sensor_layer in local costmap
Hi guys,
I am adding range_sensor_layer to local costmap of navigation stack (ROS Kinetic). I followed the advise as mentioned in this post, Parameters for the new range_sensor_layer. However, I didn't manage to activate the range_sensor_layer in local costmap.
//EDIT @ 11th Apr 19
I setup as describe below.
local_costmap_params.yaml
plugins:
- {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
global_costmap_params.yaml
plugins:
- {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
costmap_common_params.yaml
map_type: costmap
transform_tolerance: 0.3
inflation_layer:
inflation_radius: 0.3
obstacle_layer:
obstacle_range: 3.0
raytrace_range: 2.5
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: hokuyo, data_type: LaserScan, topic: /myrobot/laser/scan, marking: true, clearing: true}
sonar_layer:
ns: /arduino
topics: ["/sonar1", "/sonar2", "/sonar3", "/sonar4", "/sonar5"]
no_readings_timeout: 2.0
clear_threshold: 0.05
mark_threshold: 0.15
launch file:
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find myrobot)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find myrobot)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find myrobot)/config/local_costmap_params.yaml" command="load"/>
<rosparam file="$(find myrobot)/config/global_costmap_params.yaml" command="load"/>
<rosparam file="$(find myrobot)/config/base_local_planner_params.yaml" command="load" />
<param name="base_global_planner" type="string" value="navfn/NavfnROS" />
<param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>
</node>
And here is the output of roslaunch(timestamp is hidden), which range_sensor_layer is not initiated:
[ INFO] [--]: Loading from pre-hydro parameter style
[ INFO] [--]: Using plugin "static_layer"
[ INFO] [--]: Requesting the map...
[ INFO] [--]: Resizing costmap to 2912 X 2496 at 0.020000 m/pix
[ INFO] [--]: Received a 2912 X 2496 map at 0.020000 m/pix
[ INFO] [--]: Using plugin "obstacle_layer"
[ INFO] [--]: Subscribed to Topics: laser_scan_sensor
[ INFO] [--]: Using plugin "inflation_layer"
[ INFO] [--]: Loading from pre-hydro parameter style
[ INFO] [--]: Using plugin "obstacle_layer"
[ INFO] [--]: Subscribed to Topics: laser_scan_sensor
[ INFO] [--]: Using plugin "inflation_layer"
[ INFO] [--]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [--]: Sim period is set to 0.50
[ INFO] [--]: Received a 2912 X 2496 map @ 0.020 m/pix
[ INFO] [--]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [--]: Recovery behavior will clear layer obstacles
[ INFO] [--]: Recovery behavior will clear layer obstacles
//END OF EDIT
I do know what I have missed. Please advice. Thank you very much.