Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Jan 6, 2025
1 parent 551bd82 commit 2a3c3dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions docs/source/yaml/world_schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The world schema looks as follows, where ``<angle brackets>`` are placeholders:
rotation_eul:
yaw: <yaw>
angle_units: <units> # Can be "radians" (default) or "degrees"
relative_to: <room_name> # If not specified, uses absolute pose
is_open: true # Can only pick, place, and detect if open
is_locked: true # Can only open and close if unlocked
is_charger: false # Robots can charge at this location
Expand All @@ -128,7 +129,7 @@ The world schema looks as follows, where ``<angle brackets>`` are placeholders:
x: <x>
y: <y>
z: <z>
relative_to: <loc_name>
relative_to: <loc_name> # If not specified, uses absolute pose
Specifying Poses
Expand All @@ -141,7 +142,7 @@ There are a few ways to specify poses in PyRoboSim YAML files: lists and diction
# Valid list formats
pose: [<x>, <y>]
pose: [<x>, <y>, <z>]
pose: [<x>, <y>, <z>, <yaw>]
pose: [<x>, <y>, <z>, <yaw>] # Angle units always in radians
If possible, you should use the dictionary format, as the list format is at this point only around for backward compatibility.
Anything below this line is only supported in dictionary format.
Expand Down
3 changes: 2 additions & 1 deletion pyrobosim/pyrobosim/core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,8 @@ def get_pose_relative_to(self, pose, entity):
if not isinstance(entity, (Room, Location, ObjectSpawn, Object, Robot)):
raise TypeError(f"Invalid entity type: {type(entity)}")

# Extract the pose from the entity and transform it to the new frame.
# Extract the pose from the entity and use it to transform the given pose
# to the entity frame.
# Note that the rotation is applied separately from the translation.
new_transform = (
pose.get_translation_matrix() @ entity.pose.get_transform_matrix()
Expand Down
3 changes: 1 addition & 2 deletions pyrobosim/test/core/test_yaml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ def test_create_rooms_from_yaml():
"footprint": {
"type": "box",
"dims": [1.75, 1.5],
"offset": [2.625, 3.25],
},
# "pose": {"position": {"x": 2.625, "y": 3.5}},
"pose": {"position": {"x": 2.625, "y": 3.5}},
"wall_width": 0.2,
"color": [0, 1, 0],
},
Expand Down

0 comments on commit 2a3c3dc

Please sign in to comment.