ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

range_sensor_layer doesn't show obstacles on rviz map?

asked 2019-06-26 04:47:33 -0500

Syrine gravatar image

updated 2019-07-01 10:37:28 -0500

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

2. 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}

3. 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

edit retag flag offensive close merge delete

Comments

When you visualize the ultrasound sensors in rviz, do they appear in the correct positions with the correct ranges?

ahendrix gravatar image ahendrix  ( 2019-06-27 11:13:08 -0500 )edit

(I've also increased your reputation, so you can post images now)

ahendrix gravatar image ahendrix  ( 2019-06-27 11:14:12 -0500 )edit

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

Syrine gravatar image Syrine  ( 2019-06-27 11:53:52 -0500 )edit

Can you please add 1) the output of "rostopic echo -n 1 /range_1" 2) the output of move_base starting

Humpelstilzchen gravatar image Humpelstilzchen  ( 2019-06-28 11:02:24 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2019-06-29 00:15:57 -0500 )edit

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

Syrine gravatar image Syrine  ( 2019-07-01 02:20:16 -0500 )edit

is there something to add in amcl or launch files?

Syrine gravatar image Syrine  ( 2019-07-01 03:34:38 -0500 )edit
1

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.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2019-07-01 06:00:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-07-01 11:33:05 -0500

ahendrix gravatar image

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.

edit flag offensive delete link more

Comments

Thank you so much! I can't believe that was it. It worked only now I have this problem http://answers.ros.org/question/23831... 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

Syrine gravatar image Syrine  ( 2019-07-02 03:12:35 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-06-26 04:47:33 -0500

Seen: 1,033 times

Last updated: Jul 01 '19