0
$\begingroup$

Rosanswers logo

Hi.

I'm working a robot navigation using a lidar and 5 ultrasound sensors. using range_sensor_layer I couldn't get the robot to avoid obstacles within its range dont know if it's from the common costmap file, local or global. here are all of them, I really appreciate your help:

  1. costmap_common_params.yaml

 obstacle_range: 2.5

 raytrace_range: 3.5

 footprint: [[-0.200, -0.30], [-0.200, 0.300], [0.300, 0.300], [0.300, -0.300]]
 
 publish_frequency: 1.0

 map_type: costmap

 transform_tolerance: 0.2

 inflation_layer:

  inflation_radius: 0.5

  cost_scaling_factor: 0.8

 obstacle_layer:

   observation_sources: scan

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

 range_sensor_layer:

   topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]

   clear_threshold: 0.2

   mark_threshold: 0.80

  1. Global_costmap_params.yaml

  global_costmap:

      global_frame: map

      robot_base_frame: base_footprint

      update_frequency: 1.0

      publish_frequency: 1

      static_map: true

      rolling_window: false

      transform_tolerance: 0.5

      plugins: 

      - {name: static_layer,    type: "costmap_2d::StaticLayer"}

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

      - {name: range_sensor_layer,   type: "range_sensor_layer::RangeSensorLayer"}

      - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

      inflation_layer:

        inflation_radius: 0.5

        cost_scaling_factor: 0.8

      range_sensor_layer:

        topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]

        clear_threshold: 0.2

        mark_threshold: 0.8

     obstacle_layer:

        observation_sources: scan

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

  1. local_costmap_params.yaml

  local_costmap:

    global_frame: odom

    robot_base_frame: base_footprint

    update_frequency: 2

    publish_frequency: 1

    static_map: false

    rolling_window: true

    width: 6

    height: 6

    resolution: 0.05

    transform_tolerance: 1.0

    plugins:

    - {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}

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

    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

    inflation_layer:

      inflation_radius: 0.5

      cost_scaling_factor: 0.8

    range_sensor_layer:

      topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]

      clear_threshold: 0.2

      mark_threshold: 0.80

    obstacle_layer:

      observation_sources: scan

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

In this picture, the inflated area in the local map is detected by the lidar and I placed beers in front of each sonar sensors because their height be detected only by them and not the lidar. image description


update

Here are the messages right when I launch image description image description image description


Originally posted by Syrine on ROS Answers with karma: 57 on 2019-06-26

Post score: 0


Original comments

Comment by ahendrix on 2019-06-27:
When you visualize the ultrasound sensors in rviz, do they appear in the correct positions with the correct ranges?

Comment by ahendrix on 2019-06-27:
(I've also increased your reputation, so you can post images now)

Comment by Syrine on 2019-06-27:
Thank you! The ranges do appear in their correct positions and their topics show correct ranges (min and max and even when I add an object). I can post images tomorrow when I get back to work

Comment by Humpelstilzchen on 2019-06-28:
Can you please add 1) the output of "rostopic echo -n 1 /range_1" 2) the output of move_base starting

Comment by ahendrix on 2019-06-29:
I don't really understand exactly what's wrong, but if this were my robot, I would try adjusting the ordering and the marking and clearing options on the range and obstacle layers.

Comment by Syrine on 2019-07-01:
Hi, Thank you both for replying. Here's the output of range_1

 header: 
   seq: 1784
   stamp: 
     secs: 324
     nsecs: 706000000
   frame_id: "sonar_1"
 radiation_type: 0
 field_of_view: 0.10000000149
 min_range: 0.019999999553
 max_range: 4.0
 range: 0.508712828159

I'm sorry I didn't get what you mean by move_base starting, there isn't such topic

@ahendrix I actually did that but nothing affected the sonar sensors

Comment by Syrine on 2019-07-01:
is there something to add in amcl or launch files?

Comment by Humpelstilzchen on 2019-07-01:
move_base is the node you load your configuration files (costmap_common_params.yaml, Global_costmap_params.yaml and local_costmap_params.yaml) in. When the node starts it should print a few lines to stdout.

Comment by Syrine on 2019-07-01:
There I added pictures right up, I hope they could help

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This message in your output looks odd:

RangeSensorLayer: subscribed to topic /move_base/global_costmap/range_sensor_layer/range_1

That does not look like your range topic. It looks like the range topic is being given as a relative topic, instead of an absolute topic. I would try changing your range sensor topic config to:

range_sensor_layer:
  topics: ["/range_1", "/range_2", "/range_3", "/range_4", "/range_5"]

P.S. - Please copy and past terminal output instead of posting terminal screenshots. Copy and pasted text is easier to read and easier to search.


Originally posted by ahendrix with karma: 47576 on 2019-07-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Syrine on 2019-07-02:
Thank you so much! I can't believe that was it. It worked only now I have this problem http://answers.ros.org/question/238312/range_sensor_layer-marks-max-sonar-range-as-obstacle/ I couldn't find the cpp file since i installed it using apt-get install ros-kinetic-range-sensor-layer in which there are only cmake files. So i'm using clear_on_max_rading:true

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.