Skip to content

Commit

Permalink
Merge branch 'main' into feature/lift_delete_button
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-della-vedova authored Sep 19, 2024
2 parents 12309f7 + 2dd298a commit 3e15fe7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions rmf_building_map_tools/building_map_server/building_map_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ def level_msg(self, level):
graph_msg.name = str(i) # todo: someday, string names...
print(f"graph {i} has {len(g['vertices'])} vertices")
for v in g['vertices']:
gn = GraphNode()
gn.x = v[0]
gn.y = v[1]
gn.name = v[2]['name']
gn = self.create_graph_node(v[0], v[1], v[2]['name'])

# add specific params to builidng_map_msg
for str_param in ["dock_name",
Expand Down Expand Up @@ -245,10 +242,7 @@ def level_msg(self, level):
wall_graph = level.generate_wall_graph()
msg.wall_graph.name = "WallGraph"
for v in wall_graph['vertices']:
gn = GraphNode()
gn.x = v[0]
gn.y = v[1]
gn.name = v[2]['name']
gn = self.create_graph_node(v[0], v[1], v[2]['name'])

# Ignore any other vertex params - not needed for wall graph
msg.wall_graph.vertices.append(gn)
Expand Down Expand Up @@ -283,7 +277,7 @@ def lift_msg(self, lift):
msg = Lift()
# transformation is already done in Lift class
msg.ref_x, msg.ref_y = lift.x, lift.y
msg.name = lift.name
msg.name = str(lift.name)
msg.levels = lift.level_names

msg.ref_yaw = lift.yaw
Expand Down Expand Up @@ -324,6 +318,14 @@ def get_building_map(self, request, response):
response.building_map = self.map_msg
return response

def create_graph_node(self, wp_x, wp_y, wp_name):
gn = GraphNode()
gn.x = wp_x
gn.y = wp_y
gn.name = str(wp_name)

return gn


def main():
if len(sys.argv) > 1:
Expand Down

0 comments on commit 3e15fe7

Please sign in to comment.