Ask Your Question
0

Ultrasonic sensor with range_sensor_layer not forming cone obstacles

asked 2018-09-21 09:10:47 -0600

mcarr gravatar image

updated 2018-10-11 01:34:33 -0600

Hi,

I am able to form a costmap using my Lidar data and move_base through the ROS Navigation stack. However when I try to integrate an ultrasonic sensor to the costmap using range_sensor_layer there are 2 problems:

  1. The Lidar is no longer creating obstacles on the local costmap
  2. The Ultrasonic sensor is only creating obstacles in line of single pixels in front of the robot (by pixels I mean the smallest unit of map resolution, 0.05m in my case)

Below: local costmap created from lidar, without the range_sensor_layer plugin. Everything working fine

Local costmap created from lidar:

Below: Costmap with range_sensor_layer plugin active. I moved an object towards the ultrasonic sensor starting at about 80cm, moving to 30cm (it doesn't clear objects behind others thus why is forms a line). The robot is located at the center cross facing right in both these images

Local costmap created from ultrasonic sensor

I have tried playing with the parameters discussed in range_sensor_layer but this did not help. Is there some blatant oversight that I'm making? Below are my config files

costmap_common_params.yaml

obstacle_range: 4.0
raytrace_range: 5.0
footprint: [[0.075, 0.235], [0.075,-0.235], [-0.455,-0.235], [-0.455,0.235]]
inflation_radius: 0.55

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: /scan, data_type: LaserScan, topic: /scan, marking: true, clearing: true}

sonar:
  topics: ['/ultrasonic']
  clear_threshold: 0.3
  mark_threshold: 0.6
  clear_on_max_reading: true
  no_readings_timeout: 2.0

plugins:
  - {name: sonar, type: "range_sensor_layer::RangeSensorLayer"}
  - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

local_costmap_params.yaml

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 5.0
  publish_frequency: 2.0
  static_map: false
  rolling_window: true
  width: 6.0
  height: 6.0
  resolution: 0.05

global_costmap_params.yaml

global_costmap:
  global_frame: /map
  robot_base_frame: base_link
  update_frequency: 5.0
  static_map: false
  rolling_window: true
  height: 10.0
  width: 10.0
  resolution: 0.05

And here is my Ultrasonic message:

image description

EDIT 1

The ultrasonic sensors are now marking obstacles after fixing the different layers and plugins in Costmap2D. However the range_sensor_layer package is still only marking dots, instead of arcs on the costmap. Is it even supposed to mark arcs? Maybe my understanding is incorrect. However there are field of view parameters so I would assume it is supposed to mark an arc obstacles at the detected range.

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-24 12:39:21 -0600

Humpelstilzchen gravatar image

There is indeed something odd here. Could it be that you try the Layered costmap costmap configuration with a pre-Hydro configuration?

You have

plugins:
  - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}

but obstacle_layer is nowhere configured. Also

observation_sources: laser_scan_sensor

stands alone. It should probably be inside the obstacle_layer namespace, same with obstacle_range and raytrace_range. They are all options of the ObstacleLayer, not the costmap, e.g.

obstacle_layer:
  observation_sources: laser_scan_sensor
  laser_scan_sensor: {sensor_frame: /scan, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
  obstacle_range: 4.0
  raytrace_range: 5.0

The same with with the inflation_radius option, this belongs into the namespace of the InflationLayer, e.g.

inflation_layer:
  inflation_radius: 0.55
edit flag offensive delete link more

Comments

Cheers, realised that I didn't understand how Costmap2D worked really with the layers as plugins and such. Still haven't figured about why range_sensor_layer is not making cone obstacles though.

mcarr gravatar imagemcarr ( 2018-10-10 08:57:22 -0600 )edit

Is this still an issue? If so please update your question with the current configuration. Or maybe better a new question.

Humpelstilzchen gravatar imageHumpelstilzchen ( 2018-10-10 11:34:53 -0600 )edit

The main issue - not forming cone obstacles - is still an issue. Will update question

mcarr gravatar imagemcarr ( 2018-10-11 01:31:38 -0600 )edit

The frame_id "ultrasound" in your sample range message sounds strange. I'ld expect something like "ultrasound_fwd_left". Btw you should set radiation_type to Range.ULTRASOUND (1) instead of Range.INFRARED (0) if this is a us sensor (That probably will not change anything)

Humpelstilzchen gravatar imageHumpelstilzchen ( 2018-10-11 12:31:59 -0600 )edit

Hello, I need your help for something similar can you please check my question? http://answers.ros.org/question/32699... thanks

Syrine gravatar imageSyrine ( 2019-06-28 07:55:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-21 09:10:47 -0600

Seen: 375 times

Last updated: Oct 11 '18