diff --git a/docs/source/yaml/world_schema.rst b/docs/source/yaml/world_schema.rst index bc46b2e7..0c4e103b 100644 --- a/docs/source/yaml/world_schema.rst +++ b/docs/source/yaml/world_schema.rst @@ -108,6 +108,7 @@ The world schema looks as follows, where ```` are placeholders: rotation_eul: yaw: angle_units: # Can be "radians" (default) or "degrees" + relative_to: # 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 @@ -128,7 +129,7 @@ The world schema looks as follows, where ```` are placeholders: x: y: z: - relative_to: + relative_to: # If not specified, uses absolute pose Specifying Poses @@ -141,7 +142,7 @@ There are a few ways to specify poses in PyRoboSim YAML files: lists and diction # Valid list formats pose: [, ] pose: [, , ] - pose: [, , , ] + pose: [, , , ] # 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. diff --git a/pyrobosim/pyrobosim/core/world.py b/pyrobosim/pyrobosim/core/world.py index 494ad4cb..e31930e8 100644 --- a/pyrobosim/pyrobosim/core/world.py +++ b/pyrobosim/pyrobosim/core/world.py @@ -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() diff --git a/pyrobosim/test/core/test_yaml_utils.py b/pyrobosim/test/core/test_yaml_utils.py index 0e83fdf9..9f93725d 100644 --- a/pyrobosim/test/core/test_yaml_utils.py +++ b/pyrobosim/test/core/test_yaml_utils.py @@ -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], },