-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from osrf/fix/building_map_server
Fix/building map server
- Loading branch information
Showing
8 changed files
with
172 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
|
||
class LiftDoor: | ||
def __init__(self, yaml_node, name): | ||
self.name = name | ||
self.door_type = yaml_node['door_type'] | ||
# x & y coordinates are with respect to the centre of the cabin | ||
self.x = float(yaml_node['x']) | ||
self.y = float(yaml_node['y']) | ||
self.motion_axis_orientation = float( | ||
yaml_node['motion_axis_orientation']) | ||
self.width = float(yaml_node['width']) | ||
|
||
|
||
class Lift: | ||
def __init__(self, yaml_node, name): | ||
self.name = name | ||
print(f'parsing lift {name}') | ||
|
||
self.reference_floor_name = yaml_node['reference_floor_name'] | ||
self.depth = float(yaml_node['depth']) | ||
self.width = float(yaml_node['width']) | ||
self.x = float(yaml_node['x']) | ||
self.y = float(yaml_node['y']) | ||
self.yaw = float(yaml_node['yaw']) | ||
|
||
self.level_names = [] | ||
self.door_names = [] | ||
if 'level_doors' in yaml_node: | ||
for level_name, door_name in yaml_node['level_doors'].items(): | ||
self.level_names.append(level_name) | ||
self.door_names.append(door_name) | ||
|
||
self.doors = [] | ||
if 'doors' in yaml_node: | ||
self.doors = self.parse_lift_doors(yaml_node['doors']) | ||
|
||
def parse_lift_doors(self, yaml_node): | ||
doors = [] | ||
for lift_door_name, lift_door_yaml in yaml_node.items(): | ||
doors.append(LiftDoor(lift_door_yaml, lift_door_name)) | ||
return doors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters