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 updated for 2.10 seconds, and it should be updated every 0.50 seconds.
[ WARN] [1560451025.131736352]: Illegal bounds change, was [tl: (-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000), br: (179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000, 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000)], but is now [tl: (-340282346638528859811704183484516925440.000000, -340282346638528859811704183484516925440.000000), br: (340282346638528859811704183484516925440.000000, 340282346638528859811704183484516925440.000000)]. The offending layer is local_costmap/inflation_layer
[ INFO] [1560451025.203243618]: Recovery behavior will clear layer obstacles
[ INFO] [1560451025.236163764]: Recovery behavior will clear layer obstacles
[ INFO] [1560451025.266917270]: odom received!
[ WARN] [1560451109.575399918]: Messages of type 2 arrived out of order (will print only once)
[ WARN] [1560451109.576543482]: Messages of type 0 arrived out of order (will print only once)
Then, when I launch the node that publishes the ultrasonic sensor data on a sensor_msgs/Range Topic, the move_base dies on the same time.
Here is the log:
...
[ WARN] [1560451109.575399918]: Messages of type 2 arrived out of order (will print only once)
[ WARN] [1560451109.576543482]: Messages of type 0 arrived out of order (will print only once)
/opt/ros/melodic/lib/move_base/move_base: symbol lookup error: /opt/ros/melodic/lib//librange_sensor_layer.so: undefined symbol: _ZN3tf212getTimestampIN13geometry_msgs13PointStamped_ISaIvEEEEERKN3ros4TimeERKT_
[planner/move_base-1] process has died [pid 14104, exit code 127, cmd /opt/ros/melodic/lib/move_base/move_base openni_points:=/planner_cloud map:=/rtabmap/grid_map move_base_simple/goal:=/move_base_simple/goal cmd_vel:=/cmd_vel odom:=/rtabmap/odom __name:=move_base __log:=/home/nuc/.ros/log/22d3e9aa-8dfc-11e9-9c26-a11a53c44629/planner-move_base-1.log].
log file: /home/nuc/.ros/log/22d3e9aa-8dfc-11e9-9c26-a11a53c44629/planner-move_base-1*.log
I could not find the log file of this error.
The range sensor is working.
rostopic echo /robot/sensor/sonar_forward_left
...
header:
seq: 34
stamp:
secs: 1560451337
nsecs: 80173661
frame_id: "sonar_forward_left"
radiation_type: 0
field_of_view: 0.457276314497
min_range: 0.0399999991059
max_range: 4.0
range: 1.55999994278
---
...
Originally posted by VitorHirozawa on ROS Answers with karma: 11 on 2019-06-13
Post score: 0
Original comments
Comment by gvdhoorn on 2019-06-13:
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.