range_sensor_layer on layered costmap
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:
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:
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.If https://answers.ros.org/question/3308... is still your problem please fix your sensor.
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.