Error with range_sensor_layer. move_base node dies when a sensor_msgs/Range is published [closed]
Hi, I am trying to setup a range_sensor_layer to use an ultrasonic sensor on the navigation stack. I am using move_base in a custom mobile robot. The robot uses a computer with Ubuntu 18.04.2 LTS and ROS Melodic (1.14.3). I am using one RGB-D camera and an ultrasonic sensor.
First I launch the navigation without publishing sensor_msgs/Range on its topic. Then I can navigate without the ultrasonic data. When I launch the node that publishes the Range data, the move_base node dies.
Can anybody help me to configure correctly the range_sensor_layer?
Following are my configuration files:
global_costmap_params.yaml
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 0.5
publish_frequency: 0.5
static_map: true
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
local_costmap_param.yaml
local_costmap:
global_frame: odom
robot_base_frame: base_footprint
update_frequency: 2.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 4.0
height: 4.0
resolution: 0.025
origin_x: -2.0
origin_y: -2.0
plugins:
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
costmap_common_params.yaml
footprint: [[0.095, -0.202], [-0.095, -0.202], [-0.310, -0.165], [-0.310, 0.165], [-0.095, 0.202], [0.095, 0.202]]
footprint_padding: 0.025
#layer definitions
obstacle_layer:
obstacle_range: 3.5
raytrace_range: 4.0
observation_sources: point_cloud_sensor
point_cloud_sensor: {
sensor_frame: camera_link,
data_type: PointCloud2,
topic: openni_points,
expected_update_rate: 0.5,
marking: true,
clearing: true,
min_obstacle_height: 0.0,
max_obstacle_height: 2.0,
origin_z: 0.0,
z_resolution: 0.05,
z_voxels: 40,
publish_voxel_map: true
}
sonar_layer:
ns: /robot/sensor/
topics: ['sonar_forward_left']
inflation_layer:
inflation_radius: 1.20
cost_scaling_factor: 2.58
transform_tolerance: 1
controller_patience: 2.0
NavfnROS:
allow_unknown: true
recovery_behaviors: [
{name: conservative_clear, type: clear_costmap_recovery/ClearCostmapRecovery},
{name: aggressive_clear, type: clear_costmap_recovery/ClearCostmapRecovery}
]
conservative_clear:
reset_distance: 3.00
aggressive_clear:
reset_distance: 5.00
The navigation launch log (working good) without publishing on sensor_msgs/Range Topic:
...
[ INFO] [1560451022.672595882]: Using plugin "static_layer"
[ INFO] [1560451022.678838847]: Requesting the map...
[ INFO] [1560451022.881123086]: Resizing costmap to 279 X 208 at 0.050000 m/pix
[ INFO] [1560451022.981045216]: Received a 279 X 208 map at 0.050000 m/pix
[ INFO] [1560451022.983909307]: Using plugin "inflation_layer"
[ INFO] [1560451023.023428562]: Using plugin "obstacle_layer"
[ INFO] [1560451023.024910763]: Subscribed to Topics: point_cloud_sensor
[ INFO] [1560451023.049016230]: Using plugin "sonar_layer"
[ INFO] [1560451023.051504866]: local_costmap/sonar_layer: ALL as input_sensor_type given
[ INFO] [1560451023.053644089]: RangeSensorLayer: subscribed to topic /robot/sensor/sonar_forward_left
[ INFO] [1560451023.065115576]: Using plugin "inflation_layer"
[ INFO] [1560451023.111015732]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1560451023.126600417]: Sim period is set to 0.20
[ INFO] [1560451023.254282343]: Approximate time sync = true
[ERROR] [1560451023.620386435]: obstacles_detection: Parameter "min_cluster_size" has moved from rtabmap_ros to rtabmap library. Use parameter "Grid/MinClusterSize" instead. The value is still copied to new parameter name.
[ERROR] [1560451023.621727209]: obstacles_detection: Parameter "max_obstacles_height" has moved from rtabmap_ros to rtabmap library. Use parameter "Grid/MaxObstacleHeight" instead. The value is still copied to new parameter name.
[ WARN] [1560451025.131534696]: The openni_points observation buffer has not been updated for 2.10 seconds, and it should be updated every 0.50 seconds.
[ WARN] [1560451025.131593002]: The openni_points observation buffer has not been ...
I have no idea what is causing it, but those bounds look highly suspect to me. They look like uninitialised memory of
double
s, or perhaps even integers interpreted as doubles, or something else that's wrong there.I would first fix that before suspecting the sonar messages.