range_sensor_layer on layered costmap

asked 2019-08-20 00:55:26 -0500

june2473 gravatar image

updated 2019-08-20 00:56:04 -0500

I am trying to visualize data from range sensors.

To do that, i am trying to use layered costmap.

here is my local_costmap_params.yaml:

local_costmap:
  global_frame: camera_odom_frame
  robot_base_frame: camera_link

  update_frequency: 1.0
  publish_frequency: 1.0
  transform_tolerance: 0.2

  static_map: false  
  rolling_window: true
  width: 3
  height: 3
  resolution: 0.05

  plugins:
    - {name: sonar,             type: "range_sensor_layer::RangeSensorLayer"}
    - {name: inflation,         type: "costmap_2d::InflationLayer"}

  inflation:
    inflation_radius: 0.4

  sonar:
    frame: range_sensor_frame
    topics: ["/sensor_us","sensor_ir"]
    no_readings_timeout: 2.0
    clear_on_max_reading: false

and here is my rviz:

image description

rostopic echo /move_base/local_costmap gives me zeros.

what am I doing wrong?

is there something wrong with these yaml files configuration?

or its because of frames?

here is my rqt_tf_tree: image description

edit retag flag offensive close merge delete

Comments

You do realize that in the rviz screenshot your range sensor does not see an obstacle in the extend of your local costmap? (The end of the red cone is outside the local costmap). Obviously you need an obstacle in front of the range sensor and the range sensor must report the correct distance to target.

If you still think this does not work please add the output of rostopic echo -n 1 /sensor_us while your robot is in front of an obstacle.

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-08-20 11:00:37 -0500 )edit

If https://answers.ros.org/question/3308... is still your problem please fix your sensor.

Humpelstilzchen gravatar imageHumpelstilzchen ( 2019-08-20 11:05:07 -0500 )edit

red cone is always with the same length no matter of distance; red cone shows when range sensor detects obstacle, otherwise, if there is no obstacle in front of the range sensor - red cone does not show.

rostopic echo /sensor_us looks good, i am moving my hand closer and far to the sensor - distance value is changing. rostopic echo /move_base/local_costmap/costmap is entirely zeros.

actually i noticed something interesting, when i direct this cone to the floor, obstacles shows up!

https://sun9-3.userapi.com/c850628/v8...

and local_costmap stopped looking as whole bunch of zeros. i suppose, it means that tf between camera_link and range_sensor_frame frames was configured wrong. now i want to create urdf.xacro file with 4 range sensors and then run robot_state_publisher node to publish tf properly.

june2473 gravatar imagejune2473 ( 2019-08-21 01:05:44 -0500 )edit