rmf_traffic_editor package from rmf_traffic_editor repormf_building_map_tools rmf_traffic_editor rmf_traffic_editor_assets rmf_traffic_editor_test_maps
|Tags||No category tags.|
|License||Apache License 2.0|
|CI status||No Continuous Integration|
|Tags||No category tags.|
Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)
- Morgan Quigley
A graphical editor for robot traffic flows. The intent is to make it easy to annotate building floorplans with the desired robot traffic lanes and generate simulation models to test and evaluate different traffic schemes.
This package claims to be in the Quality Level 3 category. See the Quality Declaration for more details.
Traffic Editor is now structured as a Colcon package. After installing
ROS 2 Eloquent, the following command sequence will create a colcon
~/colcon_workspace and build
sudo apt update sudo apt install libyaml-cpp-dev qt5-default \ libopencv-dev libopencv-videoio-dev mkdir -p ~/colcon_workspace/src cd ~/colcon_workspace/src git clone https://github.com/open-rmf/rmf_traffic_editor cd ~/colcon_workspace source /opt/ros/eloquent/setup.bash colcon build --packages-select rmf_traffic_editor
traffic_editor_assets package contains a nifty bunch of useful assets to use with
It is included in the above checkout.
Then you should be able to run
traffic-editor by sourcing the install
space of that workspace, in a new "clean" terminal:
source ~/colcon_workspace/install/setup.bash traffic-editor
If it's the first time you are running it, starting the editor with
traffic-editor should bring up a blank window.
First, you'll need to make sure that
traffic-editor knows where the
model thumbnails are found. If you installed
rmf_traffic_editor should find it automatically. The thumbnails are
top-view renderings of various art assets that can be added to the
environments, such as chairs.
Edit->Preferences... and see if the path provided in the "Thumbnail Path" box looks reasonable.
If necessary, the "Find..." button can be used to browse the filesystem to point to any desired thumbnail directory.
(If you installed the recommended
traffic_editor_assets package, you will find its thumbnail directory in its install space at
Creating a new Project and an empty Building Map
Project->New... and save your new project as
Edit->Project Properties... and enter "test" as the project name and
test.building.yaml as the building path. Then click OK.
Edit->Building Properties... and enter "test" as the building name.
Creating a level and adding some stuff
Click the "Add..." button in the "levels" tab on the far right side of the main editor window. This will pop up a dialog where you can create a new level. Enter
L1 for the name and click OK. This will create a 10 meter square level.
You can zoom in and out using the mouse wheel on the rendering on the left side of the main window. You can pan around by dragging the mouse around with the mouse wheel (or middle button) depressed.
Now, you should be able to click the green dot toolbar icon, which is the "Add Vertex" tool (or press
V) and click a few vertices in the white area. Press the
[Escape] key to return to the "Select" tool.
Now, you should be able to click the
add wall tool (or press
W) and drag from one vertex to another vertex to add wall segments.
To delete wall segments or vertices, first press
[Escape] to enter Select mode. Then, click on a wall segment or vertex, and press
Save your work
Project->Save or press
Ctrl+S to save the project and building map.
Adding real-world measurements to set the scale
To set the scale of the drawing, click the
add measurement tool (or press
M) and drag from one vertex to another to add a real-world measurement line, which should show up as a pink line. Then click the
select tool (or press
Esc) and click on the line with the left button. This should populate the property-editor in the lower-right pane of the editor window. You can then specify the real-world length of the measurement line in meters. If you set more than one measurement line on a drawing, the editor will compute an average value of pixels-per-meter from all supplied measurements.
Currently you need to re-load the document (closing the editor and re-opening) to re-compute the scale. This is not ideal, but is hopefully not a frequently-used feature. Typically the scale of a map is only set one time.
Click the "Add..." button in the "lifts" tab on the far right side of the main editor window. This will pop up a dialog where you can create a new lift. You can specify the name, position, size, and reference floor in the dialog.
Note: Do include the keywork "lift" in the lift name as for now this is how slotcars recognize lift models.
You can add lift doors by lick the "Add..." button below the box showing the lift. Set Door type to "Double sliding" (The only supported type for now!), and align the doors to the edge of the lift (represented by the green box). After that, select which door you want to use on each floor by simply checking the boxes on the left.
Lift waypoints at the center of the lift on each level can also be generated using the "Add lift waypoints" button in the dialog. Note that waypoints will only be generated on levels that the lift is serving (has a door opening on that level).
Generating Custom Thumbnails
Model thumbnails are used in
rmf_traffic_editor. To generate a thumbnail, a simple working example is shown here to generate a
# Run as gz plugin, set --a for help options printout gzserver -s libthumbnail_generator.so empty.world --input ~/.gazebo/models/SUV/model.sdf --output .
After execution, you will notice a newly created
SUV.png in your current working directory. This can be further placed into
To generate multiple model thumbnails listed in
model_list.yaml, run this:
export GAZEBO_MODEL_PATH=/PATH/TO/MODELS; ./scripts/generate_thumbnails.py /PATH/TO/MODELS test/model_list.yaml ~/output
User can also change the script default configs:
fhov, which will alter the
Similarly, the generated thumbnails in
~/output can then be added to
traffic_editor_assets/assets/thumbnails, while also append
A new model list
.yaml file can be generated using the utility script, where an optional blacklisted model names can be added, to avoid creating moving models or agents,
# e.g. MODEL_DIR = '~/.gazebo/models' ./scripts/generate_model_list.py output_model_list.yaml -d MODEL_DIR -b test/model_blacklist.yaml
In the event that merging multiple model lists is required, a different utility script can be used,
./scripts/merge_model_lists.py output_model_list.yaml -s test/model_list.yaml
To sort the model list
Changelog for package rmf_traffic_editor
- Feature/display layer transforms in freefleet format (#347)
- Feature/layer rendering palette mapping (#344)
- Fix asset path after package renaming (#341)
- Automatic alignment of robot-map layers to floorplans (#340)
- Fix/ci package name (#339)
- clarify labels on property add/delete buttons (#326)
- handle editing multiple layers with same name. (#328)
- fix #324, update layer image immediately after OK button (#327)
- Bug/add layer button not visible in new building (#313)
- provide zoom-reset and clamp on scale factor (#318)
- avoid crash in empty crowdsim save routine (#312)
- rename building_map_tools (#310)
- Rename packages and delete moved packages (#308)
- Refactoring and Migration #308 https://github.com/open-rmf/rmf\_traffic\_editor/pull/308
- Contributors: Geoffrey Biggs, Luca Della Vedova, Morgan Quigley, youliang
- Adds undo capability to a large part of the actions. (#269) (#266)
- Contibutors: Arjo, Morgan Quigley, Yadu
- Merge pull request #276 from osrf/add_lane_vertex_snap_distance_scaling scale add-lane vertex snap distance correctly
- undo features
- compute the click-to-merge treshold in pixels
- Feature/undo: Undo for editor components (#269)
- scale add-lane vertex snap distance correctly
- fix to compilation when no opencv (#272)
- Merge pull request #266 from osrf/feature/undo
- Merge branch \'feature/undo\' of https://github.com/osrf/traffic_editor into feature/undo
- Added \"save\" to newly updated transition entries (#265)
- Merge pull request #263 from osrf/dont_crash_on_new_project_crowdsim
- Merge pull request #257 from Briancbn/pr-fix-disable-plugin-backwards-compatibility
- Merge pull request #255 from osrf/feature/remove-plugin-option
- Configured gui to load and save proper parameters for plugins
- Using just the Lift object to propagate the plugin removal option
- Added option to remove plugins for doors on gui and building_map_tools generator
- Add GUI to traffic editor for crowd simulation configuration (#225)
- Merge pull request #249 from osrf/fix/lift_dialog_saving
- Add first pass of quality declarations for all packages (#235)
- Contributors: Aaron Chong, Arjo Chakravarty, Chen Bainian, Geoffrey Biggs, Guoliang (Fred) Shao, Marco A. Guti