Map Editor
March 19, 2024 ยท View on GitHub
Editing on your local PC
-
Launch mapping on the car with:
roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=TrueWe follow this convention when naming maps, but in principle any reasonable string name without whitespace should work.
- Replace
PLACEwith the place where the track is, e.g. icra or hangar - Replace
DATEwith the zero-padded current day, e.g. 2805 if it is the 28th of May - Replace
VNwith the version of the map, e.g. v0 if it is the first version of the map on that day
Drive until the map is sufficiently explored (clear trackbounds, no shifts). You can stop anywhere
Press
y. This will save a baseline map (png, yaml) and pbstream file on the car at the directoryrace_stack/f110_utils/nodes/map_editor/maps. - Replace
-
Copy map from the car to your PC:
pitX # source ros_master_ip for the relevant remote car bash stack_master/scripts/download_map.sh $MAP_NAME # fill in map_name accordinglyNote that
pitXis an alias for convenience, defined here.If you've somehow forgotten what maps there are, calling
download_map.shwithout arguments lists the maps in the map_editor folder on the car.This downloads the previously-created map folder from the car to your PC in the directory
race_stack/f110_utils/nodes/map_editor/maps.You may be prompted to login on the car. To save time, ensure that the networking setup here is done.
-
Open up the map on your PC and manually edit the
.pngfile in GIMP or similar. It should be overwritten and not be renamed.If
pf_map.pngneeds to be edited, do so as well. Remember thatpf_mapmust look like the real track! This ensures that localization for SynPF remains accurate. -
Call the map_editor program on your PC:
roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=FalseNow a window with the map should be prompted. Inspect that it makes sense. To proceed that window needs to be closed.
Next the windows should be prompted that let you select the speed and overtaking sectors.
Note: In the global trajectory window an arrow is appearing that sets the driving direction. If it is not in the intended direction, add the flag
reverse:=Trueto the previous used command.roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=False reverse:=TrueThis command will create the
speed_scaler.yaml,ot_sectors.yaml, andglobal_waypoints.jsonfiles. -
Copy map with additional information from your PC to the car:
pitX # source ros_master_ip for the relevant remote car bash stack_master/scripts/transfer_map.sh $MAP_NAME # fill in map_name accordinglyThis uploads the map folder with the additional metadata from your PC to the car in the directory
race_stack/stack_master/maps.This will also copy over the speed scaler and overtaking sector YAML files, and perform an auto-catkin build.
-
Congrats, you should be done. Verify by running base_system on the car with the new map.
Editing on the car
-
Launch mapping on the car with:
roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=TrueFor
PLACE_DATE_VN, follow the same naming conventions as above. Mapping also follows the same steps. -
Open up the map and manually edit the
.pngfile in GIMP or similar. It should be overwritten and not be renamed.You can still run GIMP locally and access the file using
sftp://race_crew@car_IPwith Files in Ubuntu.If
pf_map.pngneeds to be edited, do so as well. Remember thatpf_mapmust look like the real track! -
Call the map_editor program on the car:
roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=FalseNow a window with the map should be prompted. Inspect that it makes sense. To proceed that window needs to be closed.
Next the windows should be prompted that let you select the speed and overtaking sectors.
Note: In the global trajectory window an arrow is appearing that sets the driving direction. If it is not in the intended direction, add the flag
reverse:=Trueto the previous used command.roslaunch map_editor map_editor.launch map_name:=PLACE_DATE_VN map_editor_mapping:=False reverse:=TrueThis command will create the
speed_scaler.yaml,ot_sectors.yaml, andglobal_waypoints.jsonfiles. -
Copy map with additional information from the
map_editorfolder to thestack_masterfolder:bash stack_master/scripts/transfer_map.sh $MAP_NAME # fill in map_name accordinglyThis transfers the map folder with the additional metadata from the
map_editorfolder to thestack_masterfolder in the directoryrace_stack/stack_master/maps.This will also copy over the speed scaler and overtaking sector YAML files, and perform an auto-catkin build.
-
Congrats, you should be done. Verify by running base_system on the car with the new map.