Skip to content

This package converts maps in ROS format (as defined by map_server) to Pedsim scenarios

License

Notifications You must be signed in to change notification settings

fverdoja/ros_maps_to_pedsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ros_maps_to_pedsim

This package converts maps in ROS format (as defined by map_server) to Pedsim scenarios.

Obstacles are created according to the boundaries of the free space in the map, and waypoints and agents can optionally be included through a separate YAML file.

Step 1. Converting the map

A map can be converted in a scenario by using the included launchfile:

roslaunch ros_maps_to_pedsim ros_maps_to_pedsim.launch

Launchfile arguments

The launchfile takes the following arguments:

  • map_path (default: .): path to the folder where the map is located

  • map_name (default: map.yaml): name of the map metadata file (details on the map format here)

  • scenario_path (default: same folder as map_path): path to the folder where the scenario should be saved

  • scenario_name (default: scene.xml): name of the generated scenario file

  • use_map_origin (default: false): if true reads the map origin from the map metadata file, otherwise sets it to [0.0, 0.0, 0.0]. Integration with pedsim_ros works better in the latter case.

  • add_agents (default: true): if true, agents will be added to the scenario according to the agents YAML file given by agents_info_path and agents_info_name; if false, no agents or waypoints are added to the scenario and those two arguments are not used

  • agents_info_path (default: same folder as map_path): path to the folder where the YAML file containing agents and waypoints info is located

  • agents_info_name (default: agents.yaml): name of the agents and waypoints info file

Map format

The scripts expects the map info to be given in the form of a YAML file (containing the map metadata) and an image file. Information on the format of these files is available in the ROS wiki.

Maps generated by ROS map_server should work out of the box, but by following the same template, maps built manually can also be used.

Agents and waypoint YAML file format

Pedsim scenarios can include groups of agents moving through a set of waypoints (more details in Pedsim's documentation).

An optional YAML file containing a set of waypoints and agents can also be provided to the script to include them in the generated scenario. The YAML file should be formatted as follows:

waypoints:
  waypoint_id_1: [x, y, radius]
  waypoint_id_2: [x, y, radius]
  waypoint_id_3: [x, y, radius]
agent_1:
  n: 1
  x: 0
  y: 0
  w: [waypoint_id_1, waypoint_id_2]
agent_2:
  n: 1
  x: 0
  y: 0
  w: [waypoint_id_2, waypoint_id_3]

Optionally, values for type, dx and dy can be provided for each agent. If no value is provided, by default type: 1, dx: 0.5 and dy: 0.5.

The script expects at least the waypoints header and another header representing one agent.

Waypoints

Waypoints are provided with their id as key, and their x, y and radius properties as numerical values in a list.

Agents

Each agent is defined by a multiplier n (how many copies of that agent should be spawned), an initial (x, y) position, and a list w of waypoint ids.

NB: headers for different agents can have any name (except waypoints), but they need to have unique names.

Step 2. Use the scenario with pedsim_ros

The generated scenario can be used with pedsim_ros by the included launchfile:

roslaunch ros_maps_to_pedsim ros_map_simulator.launch

This launchfile has most arguments in common with the launchfile found in the pedsim_ros package, the most important of which is the scene_file argument that should be used to give the path to the generated scenario XML file.

Additionally, this launchfile has a map_file argument that can be used to give the path to the map used to generate the scenario. The map will be opened by map_server and should be perfectly aligned with the pedsim scene.

About

This package converts maps in ROS format (as defined by map_server) to Pedsim scenarios

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published