Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use PointCloud from pedsim_sensors to update costmap obstacles #50

Open
nvhungv2k opened this issue Apr 15, 2020 · 1 comment
Open

Comments

@nvhungv2k
Copy link

nvhungv2k commented Apr 15, 2020

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:

  • I don't use static map for global map
  • 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:
   plugins:
     - {name: obstacle_layer,          type: "costmap_2d::ObstacleLayer"}
     - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}

   obstacle_layer:
     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: https://github.com/AMRobots/pedsim_teb

  • 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.
I don't know misunderstand or make mistakes at any place, pls suggest me the way to fix it.

@makokal
Copy link
Member

makokal commented Jun 18, 2020

Here is a good example of a config that uses these sensors with move_base

# use rolling window version of costmap, as local costmap is not static
rolling_window: true
static_map: false
publish_frequency: 10.0
update_frequency: 10.0
combination_method: 1

width: 5.0
height: 5.0
resolution: 0.05
global_frame: odom

plugins:
 - {name: obstacles, type: "costmap_2d::ObstacleLayer"}
 - {name: inflater, type: "costmap_2d::InflationLayer"}

obstacles:
  observation_sources: /pedsim_people_sensor/point_cloud_local /pedsim_obstacle_sensor/point_cloud_local
  /pedsim_people_sensor/point_cloud_local: 
    data_type: PointCloud
    sensor_frame: base_footprint
    marking: true 
    clearing: true 
    obstacle_range: 4 
    raytrace_range: 4 
    map_type: costmap
  /pedsim_obstacle_sensor/point_cloud_local: 
    data_type: PointCloud
    sensor_frame: base_footprint
    marking: true
    clearing: true
    obstacle_range: 4
    raytrace_range: 4
    map_type: costmap

inflater:
  observation_sources: /pedsim_people_sensor/point_cloud_local /pedsim_obstacle_sensor/point_cloud_local
  /pedsim_people_sensor/point_cloud_local: 
    data_type: PointCloud
    sensor_frame: base_footprint
    marking: true
    clearing: true
    obstacle_range: 4
    raytrace_range: 4
  /pedsim_obstacle_sensor/point_cloud_local: 
    data_type: PointCloud
    sensor_frame: base_footprint
    marking: true
    clearing: true
    obstacle_range: 4
    raytrace_range: 4

A similar one for a global map looks very similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants