S-Path is a hierarchical path-planning framework that combines semantic information from indoor 3D Scene Graphs with geometric motion planning. Semantic structure such as rooms, doors, and their connectivity is used to guide and decompose the geometric planning problem.
Planning is performed in two stages. First, a semantic plan is computed by searching over a semantic graph derived from the scene graph, yielding a sequence of rooms and doorways that represent the intended traversal. Second, this semantic plan constrains and decomposes the geometric planning task into smaller subproblems, each solved using a standard geometric planner within a constrained configuration space.
If a geometric subproblem is infeasible or a change in the scene graph occurs (for e.g., a closed doorway), the semantic plan is updated using information from previous attempts, allowing replanning without restarting the full planning process.
S-Path works with ROS Noetic and has been tested with Ubuntu 20.04. S-Path uses an older version of S-Graphs informed with BIM maps, which is already included in this repository. To install, make a new workspace, clone this repo and build using catkin.
mkdir workspace && cd workspace
git clone git@github.com:snt-arg/spath_ros.git
mv spath_ros src
catkin build -j <num-cores>
As S-Path contains many packages, it is recommended to use mprocs, the configuration file of which is in the base directory of this repo.
# install mprocs if not already installed
mprocs -c src/mprocs.yaml
- Carta:
- Map generation S-Graphs data
- Map generation from BIM data
- Realtime map generation from sensor data
- Ability to load/save SDF maps
- Ability to export maps to .stl
- Navigator (semantic-geometric path planning)
- NagivatorHL: high level global semantic-geometric planning
- NagivatorSGraphs: semantic level global planning
- snav common:
- Shared code
- Various geometric primitives and algorithms
- Graph structure
- rviz config:
- The Rviz config files
- rviz plugins:
- Planner widget for Rviz
- Utils
- Floorplan:
- .svg to .csv (map parser) converter tool
- example floorplans
- Benchmark analyzer
- Plotting/analyzing of rosbags with benchmark data
- Floorplan:
There are two synthetic environments present in this repository (SF1 and SF2 in the paper). The floorplans/BIM for these environments were generated manually and the package map_parser uses this information to generate the required scene graph. S-Path uses widgets in Rviz interactively provide queries to plan in an environment. Follow the steps below to run planning queries on one of the synthetic datasets.
-
Setup
map_parser: specify the csv files (wall_file_path, room_file_path, door_file_path) corresponding to your dataset in themap_parser.launchfile.For
SF1use:<param name="wall_file_path" value="$(find map_parser)/csv/floorplan/floorplan_office_walls.csv"/> <param name="room_file_path" value="$(find map_parser)/csv/floorplan/floorplan_office_rooms.csv" /> <param name="door_file_path" value="$(find map_parser)/csv/floorplan/floorplan_office_doors.csv" />For
SF2use:<param name="wall_file_path" value="$(find map_parser)/csv/floorplan/floorplan_walls.csv"/> <param name="room_file_path" value="$(find map_parser)/csv/floorplan/floorplan_rooms.csv" /> <param name="door_file_path" value="$(find map_parser)/csv/floorplan/floorplan_doors.csv" /> -
Launch the mprocs config and then the following packages in order:
rvizfor visualization and setting planning queries interactivelymap_parserto generate semantic graph from the definitions of walls, rooms, and doors in Step 1.cartato generate an ESDF from the semantic graph.navigator_sgraphsfor the semantic planning on the semantic graph.navigator_hlfor the geometric planning via an interface with the OMPL planning library.
-
In
rviz, go to the Planning tab, pick a room for start and goal from the comboboxes. Call:- The geometric planner only on the entire configuration space (Ablation I in the paper) by clicking on
Planner Service. - The hierarchical planner on the restricted configuration space (Ablation II in the paper) by clicking on
Planner Hierarchical. - The hierarchical planner with subproblems (S-Path) by clicking on
Planner Hierarchical+SPS. - Optionally, you can provide a blocked door in the path, that simulates this door being blocked after the initial plan was computed (Replanning) by clicking on
Planner Hierachical+SPS+Replanning.
- The geometric planner only on the entire configuration space (Ablation I in the paper) by clicking on
Real datasets need both the semantic graph and the metric map obtained from the scene graph and the metric mesh from LIDAR measurements (using voxblox) respectively. S-Path provides this data for two real environments (RF1 and RF2 in the paper). Since S-Graphs does not have the capability to detect doorways, the semantic information was manually produced by overlaying over the metric mesh. The procedure for this will be released at a later time. Follow the steps below to load the RF1 environment and run S-Path on it.
- Configure the
map_parser.launch
<param name="wall_file_path" value="$(find map_parser)/csv/floorplan/floorplan_urchet_walls.csv"/>
<param name="room_file_path" value="$(find map_parser)/csv/floorplan/floorplan_urchet_rooms.csv" />
<param name="door_file_path" value="$(find map_parser)/csv/floorplan/floorplan_urchet_doors.csv" />
-
Launch mprocs and then the following packages in order:
rviz,map_parser,carta_rt,navigator_sgraphs, andnavigator_hl. -
Now in rviz you will see the contours of the metric-semantic graph (you may have to zoom), but without the metric map. Let's load it by calling the
/carta/load_map_and_updatepointing it to our map e.g.,/<workspace>/src/s-nav/snav_assets/voxblox_maps/urchet_f2.voxblox. Now you should have both the semantic-metric layer and the metric map. -
Running queries using the planner panel is the same as described in the previous section. Notice that the quality of the metric map isn't very high (partially because they were exported every keyframe instead of frame during the LIDAR SLAM). If a path cannot be found, chances are that the start or endpoint are occupied. You can use the gizmos to adjust the positions (by clicking on
Edit).
The results in Table 1 of the paper can be reproduced as follows:
- mprocs: launch
rviz - mprocs: launch
sgraphs_IS(this provides the metric-semantic graph)- Specify the correct dataset in the launch file (
src/map_parser/launch/map_parser.launch) - e.g. for SF2:
<launch> [...] <param name="wall_file_path" value="$(find map_parser)/csv/floorplan/floorplan_walls.csv"/> <param name="room_file_path" value="$(find map_parser)/csv/floorplan/floorplan_rooms.csv" /> <param name="door_file_path" value="$(find map_parser)/csv/floorplan/floorplan_doors.csv" /> [...] </launch> - Specify the correct dataset in the launch file (
- For synthetic datasets we run mprocs
carta_sgraphs(this will build the metric map from the floorplan data), for real datasets we runcarta_rtas described inRun a real dataset - mprocs: launch
navigator_hl,navigator_sgraphs - Verify that you see the map and graph in
rviz - Configure
navigator_hl:- Set the
geometric_plannerto eitherPRM*,RRT*orBitStar(notice thatbenchmark_plannersis only used byBenchmark TTP) - Set
sps_multithreadedtofalseto disable multithreading (not used for Table 1) - Set
benchmark_rep_countto something reasonable, this is the number of repetitions perttp(e.g.,100) - Set
benchmark_max_seconds_to_planto6,benchmark_min_seconds_to_planto0.01andbenchmark_slicesto10(see Figure 5). The values depend on the scenario, but this defines thettprange used for each run. The number of runs is defined bybenchmark_sliceswhich 'slices' the interval defined by[benchmark_min_seconds_to_plan;benchmark_max_seconds_to_plan]logarithmically, i.e., with more data points towards the lower end of thettprange (these are the datapoints you see in Fig 5).10is a good starting point. - Some of these parameters require iterative tuning to cover the range of interest properly
- Don't forget to restart
navigator_hlif you do changes
- Set the
- Go back to
rviz- Set the start and end positions (x [m], y [m] etc.). For
SF2this would be from [0.5,2,0] to [42.5,36.5,0] (long) and [0.5,2,0] to [4.5,18,0] (short). - Verify that the path computes by clicking
Planner hierarchical - Start recording the data (
rosbag record /spot/navigator_hl/benchmark_data), you may also record everything, but this is the topic we are interested in - Click
Benchmark TTPbutton, and get a coffee, this might take a while as it runs benchmark_rep_count * benchmark_slices iterations * 3 iterations (the 3 for ompl, ompl+sgraphs, ompl+sgraphs+sps). Check the output ofnavigator_hlto see when it has finished its work. During that time you should see many paths generated inrvizwith different planners. - Stop recording and give the file a descriptive name, e.g.,
benchmark_<geometric_planner>.bag - You will want to repeat 7. and 8. for all relevant planners
- Set the start and end positions (x [m], y [m] etc.). For
- After recording the results, we can generate the table and graphs using the
src/s-nav/utils/benchmark_analyzer/run.pyscript- Read through the script, but in short you specify the datasets (the rosbags you generated) and run
plot_successrate_over_secs_to_plan2resp.analyze_wall_timeon the data. - Run
python3 run.pyfrom the script's directory. This will generate the graphs*.pdfand also the tables*.texin the results directory - You may have to go back to 7. to get satisfactory coverage of the domain of interest
- Read through the script, but in short you specify the datasets (the rosbags you generated) and run
Start and End points are also part of benchmark_data msg. Check out the original rosbags to find the values for certain parameters.
