ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to use PointCloud from pedsim_sensors to update costmap obstacles

asked 2020-04-15 10:47:42 -0600

rk42 gravatar image

updated 2020-04-17 22:43:40 -0600

Hi, all

I have been trying to navigate pedsim_ros built-in diff-robot in environment created pedsim_similator

I have been able to navigate robot to desirable goal by navigation stack:

But as you seen, robot can't avoid obstacles (men) because I think that local costmap didn't update obstacles To update obstacles to local costmap, I have done as following:

  • In local_costmap_params.yaml, I place two layers obstacle_layer and inflation_layer, obstacle_layer updated from _pedsim_people_sensor/point_cloud_local_ topic:


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


     observation_sources: bump
     bump: {data_type: PointCloud , sensor_frame: odom, topic: pedsim_people_sensor/point_cloud_local, marking: true, clearing: true, min_obstacle_height: 0.0, max_obstacle_height: 3 }

Hint: Pls view full source code at:

  • I checked _pedsim_people_sensor/point_cloud_local_ topic, it is ok and can view it in rviz


I already have tried to solve this issue by:

  • Method 1: set min_obstacle_height to 0.0 cm as suggestion at here

  • Method 2: convert _pedsim_people_sensor/point_cloud_local_(PointCloud) to PointCloud2 (by point_cloud_converter package), then convert PointCloud2 to LaserScan (by pointcloud_to_laserscan package), finally use LaserScan to update local costmap

With two methods I failed.

pls suggest me the way to fix it.

edit retag flag offensive close merge delete


Does the pointcloud appear where you expect it to in RViz? Can you visualize what the costmap looks like? What happens if you set clearing to false?

David Lu gravatar image David Lu  ( 2020-04-16 11:29:16 -0600 )edit

PointCloud can appear like I expect in Rviz (it is very clearly). I can visualize local_costmap window_rolling in rviz, but window_rolling is empty (absolutely white, it don't have any obstacle). When I set clearing to false (both local_costmap and global_costmap), no one change.

rk42 gravatar image rk42  ( 2020-04-16 11:57:44 -0600 )edit

What about setting min_obstacle_height to -100. Also, how far away are the obstacles?

David Lu gravatar image David Lu  ( 2020-04-16 12:43:29 -0600 )edit

I set min_obstacle_height to -100, max_obstacle_height to 3 in both global_costmap and local_costmap.

I seen that global_costmap also show a part of many obstacles, and local_costmap still is unchanged.

rk42 gravatar image rk42  ( 2020-04-16 19:37:28 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-17 22:45:06 -0600

rk42 gravatar image

updated 2020-04-17 22:50:45 -0600

I already have solved this problem.

I have changed "sensor_frame" from "odom" to "base_footprint".

My result:

Full source code:

edit flag offensive delete link more

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


Asked: 2020-04-15 10:47:42 -0600

Seen: 305 times

Last updated: Apr 17 '20