From a83d0e870aebfcbefe546985d55272e6024448bb Mon Sep 17 00:00:00 2001 From: cwrx777 Date: Tue, 26 Mar 2024 11:47:53 +0800 Subject: [PATCH] bugfix: specify coordiate_system when generating yaml for lift. (#488) Signed-off-by: Charly Wu Co-authored-by: Yadu Co-authored-by: Luca Della Vedova --- rmf_building_map_tools/building_map/building.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rmf_building_map_tools/building_map/building.py b/rmf_building_map_tools/building_map/building.py index a0ab55db2..bdbee3c72 100644 --- a/rmf_building_map_tools/building_map/building.py +++ b/rmf_building_map_tools/building_map/building.py @@ -439,18 +439,18 @@ def generate_sdf_world(self, options): lift.generate_cabin(world, options) charger_waypoints_ele = SubElement( - world, - 'rmf_charger_waypoints', - {'name': 'charger_waypoints'}) + world, + 'rmf_charger_waypoints', + {'name': 'charger_waypoints'}) for level_name, level in self.levels.items(): for vertex in level.transformed_vertices: if 'is_charger' in vertex.params: SubElement( - charger_waypoints_ele, - 'rmf_vertex', - {'name': vertex.name, 'x': str(vertex.x), - 'y': str(vertex.y), 'level': level_name}) + charger_waypoints_ele, + 'rmf_vertex', + {'name': vertex.name, 'x': str(vertex.x), + 'y': str(vertex.y), 'level': level_name}) if self.coordinate_system == CoordinateSystem.web_mercator: (tx, ty) = self.global_transform.x, self.global_transform.y @@ -726,7 +726,8 @@ def write_yaml_file(self, filename): d['lifts'] = {} for lift_name, lift in self.lifts.items(): - d['lifts'][lift_name] = lift.to_yaml() + d['lifts'][lift_name] = lift.to_yaml( + self.coordinate_system) yaml.dump(d, f)