This file explains how to build a map for robot-sf using a svg-editor.
All examples are made with inkscape.
These settings should be checked before building a map.
-
Use px as global unit (File -> Document Properties)
-
Use absolute coordinates for your path, marked by the M.
(Edit -> Preferences -> Input/Output -> SVG Output -> Path string format -> Absolute)
Inkscape version: 1.3.2
Colours can be selected as desired, as the simulation uses its own colour scheme. However, it is best to remain consistent to make the map easier to understand.
The most important part is setting the label. In Inkscape this can be done by double-clicking the object in the layers-and-objects list on the right side or by right-clicking the object and selecting the object properties.
Use layers to make it clearer.
Obstacles should be avoided by the vehicle and the pedestrians.
Draw them by using the rectangle tool.
Set the label to obstacle
The robot needs a spawn zone to define his starting position and a goal zone he needs to reach to finish the episode.
Multiple zones can be used.
Draw them by using the rectangle tool.
Set the labels to robot_spawn_zone and robot_goal_zone
The robot path defines the route the robot takes, while reaching the goal zone.
Use the pen tool for this and perform multiple left clicks to set waypoints along the path.
The path should not start or end inside the spawn/goal zone, but just before it.
Set the label to robot_route_<spawn>_<goal>
(e.g. robot_route_1_0 -> Using Spawn 1 and Goal 0.
The zone numbers are counted from bottom to top in the list on the right-hand side)
The Pedestrians also need a spawn/goal zone. If they reach the goal they will spawn again at the start
Set the labels to ped_spawn_zone and ped_goal_zone
For the path you don't need to set specific waypoints, just make sure the path doesn't collide with an obstacle.
Set the label to ped_route_<spawn>_<goal>
Colours used in the example map:
- obstacle: #000000
- robot_spawn_zone: #ffdf00
- robot_goal_zone: #ff6c00
- robot_route: #0300d5 and #0078d5
- ped_spawn_zone: #23ff00
- ped_goal_zone: #107400
- ped_route: #c40202
The colours for the simulation can be found here: sim_view.py
If you want to implement new features: svg_map_parser.py