srl-freiburg / pedsim_ros

Pedestrian simulator powered by the social force model
https://github.com/srl-freiburg/pedsim_ros
BSD 2-Clause "Simplified" License
460 stars 170 forks source link

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

Open nvhungv2k opened 4 years ago

nvhungv2k commented 4 years ago

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 already have tried to solve this issue by:

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 commented 4 years ago

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.