Skip to content

Commit

Permalink
Include door information in nav graphs (#479)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael X. Grey <[email protected]>
  • Loading branch information
mxgrey authored Nov 25, 2023
1 parent 32f87c3 commit 90455dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rmf_building_map_tools/building_map/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def generate_nav_graphs(self):
g['building_name'] = self.name
g['levels'] = {}
g['lifts'] = {}
g['doors'] = {}

if self.coordinate_system == CoordinateSystem.web_mercator:
g['crs_name'] = self.global_transform.crs_name
Expand All @@ -373,6 +374,17 @@ def generate_nav_graphs(self):
g['levels'][level_name] = level_graph
if level_graph['lanes']:
empty = False

for door_edge in level.doors:
door_edge.calc_statistics(level.transformed_vertices)
g['doors'][door_edge.params['name'].value] = {
'endpoints': [
[door_edge.x1, door_edge.y1],
[door_edge.x2, door_edge.y2]
],
'map': level_name
}

for lift_name, lift in self.lifts.items():
g['lifts'][lift_name] = {
'position': [lift.x, lift.y, lift.yaw],
Expand Down

0 comments on commit 90455dc

Please sign in to comment.