costmap 2d obstacles marking sonar
I have a problem with marking obstacles in rviz. No matter if I get the simulation of Gazebo or the sensor data directly from the robot, no obstacle is marked. I'm not using a laser scan, just sonar and ir. The data of Sonar and IR are displayed correctly in Rviz, but not marked as an obstacle. For odometry I use the encoders on the wheels. I use the Move_base package and Nav_goal works in Rviz.
costmap common:
map_type: costmap
origin_z: 0.0
z_resolution: 1
z_voxels: 2
footprint: [[ 0.08 ,-0.09],
[-0.14 ,-0.09],
[-0.14 , 0.09],
[ 0.08 , 0.09]]
footprint_padding: 0.1
obstacle_range: 2.5
raytrace_range: 3.5
srf_range_sensor:
topics: ["/SRF/srf_front"]
enable: true
no_readings_timeout: 0.0
clear_threshold: 0.20
mark_threshold: 0.80
clear_on_max_reading: true
ir_range_sensor:
topics: ["/IR/ir_left",
"/IR/ir_right"]
enable: true
no_readings_timeout: 0.0
clear_threshold: 0.20
mark_threshold: 0.80
clear_on_max_reading: true
inflater_layer:
inflation_radius: 1.3
local costmap:
local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 20.0
publish_frequency: 5.0
width: 10.0
height: 10.0
resolution: 0.05
origin_x: -5.0
origin_y: -5.0
static_map: false
rolling_window: true
plugins:
- {name: srf_range_sensor, type: "range_sensor_layer::RangeSensorLayer"}
- {name: ir_range_sensor, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
global costmap:
global_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 20.0
publish_frequency: 5.0
width: 40.0
height: 40.0
resolution: 0.05
origin_x: -20.0
origin_y: -20.0
static_map: false
rolling_window: true
plugins:
- {name: srf_range_sensor, type: "range_sensor_layer::RangeSensorLayer"}
- {name: ir_range_sensor, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
move launch
<launch>
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find alpha_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find alpha_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find alpha_navigation)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find alpha_navigation)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find alpha_navigation)/config/base_local_planner_params.yaml" command="load" />
</node>
</launch>
rviz launch
<?xml version="1.0"?>
<launch>
<param name ="/use_sim_time" value="true"/>
<!-- send fake joint values -->
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="use_gui" value="False"/>
</node>
<!-- Combine joint values -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
<!-- Show in Rviz -->
<!--node name="rviz" pkg="rviz" type="rviz"/-->
<node name="rviz"
pkg="rviz"
type="rviz"
args="-d $(find alpha_description)/launch/rviz_alphabot.rviz"
required="true"/>
<!-- Include other launch files -->
<!-- With the following command we launch the gmapping.launch which belongs
- to speedy_navigation package
-->
<!--- Launch Move Base -->
<include file="$(find alpha_navigation)/launch/move_base.launch" />
</launch>
Thanks for the help