Skip to content

Commit 99ec4a6

Browse files
Add hand transforms subtree to mocks (#128)
Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 649a221 commit 99ec4a6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spot_wrapper/testing/mocks/robot_state.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
BODY_FRAME_NAME,
2222
GRAV_ALIGNED_BODY_FRAME_NAME,
2323
GROUND_PLANE_FRAME_NAME,
24+
HAND_FRAME_NAME,
2425
ODOM_FRAME_NAME,
2526
VISION_FRAME_NAME,
2627
)
@@ -32,10 +33,12 @@
3233
FRONT_LEFT_FRAME_NAME = "frontleft"
3334
FRONT_RIGHT_FRAME_NAME = "frontright"
3435
BACK_CAMERA_FRAME_NAME = "back_fisheye"
36+
WRIST_FRAME_NAME = "arm_link_wr1"
3537
FRONT_LEFT_CAMERA_FRAME_NAME = "frontleft_fisheye"
3638
FRONT_RIGHT_CAMERA_FRAME_NAME = "frontright_fisheye"
3739
LEFT_CAMERA_FRAME_NAME = "left_fisheye"
3840
RIGHT_CAMERA_FRAME_NAME = "right_fisheye"
41+
HAND_CAMERA_FRAME_NAME = "hand_color_image_sensor"
3942

4043

4144
class MockRobotStateService(RobotStateServiceServicer):
@@ -85,6 +88,12 @@ def __init__(self, **kwargs: typing.Any) -> None:
8588
head_to_front_right_edge.parent_tform_child.position.y = -0.2
8689
head_to_front_right_edge.parent_tform_child.rotation.w = 1.0
8790

91+
head_to_wrist_edge = transforms_snapshot.child_to_parent_edge_map[WRIST_FRAME_NAME]
92+
head_to_wrist_edge.parent_frame_name = HEAD_FRAME_NAME
93+
head_to_wrist_edge.parent_tform_child.position.x = 0.2
94+
head_to_wrist_edge.parent_tform_child.position.z = 0.5
95+
head_to_wrist_edge.parent_tform_child.rotation.w = 1.0
96+
8897
for parent_frame_name, child_frame_name in (
8998
(ODOM_FRAME_NAME, BODY_FRAME_NAME),
9099
(BODY_FRAME_NAME, GROUND_PLANE_FRAME_NAME),
@@ -95,6 +104,8 @@ def __init__(self, **kwargs: typing.Any) -> None:
95104
(RIGHT_FRAME_NAME, RIGHT_CAMERA_FRAME_NAME),
96105
(FRONT_LEFT_FRAME_NAME, FRONT_LEFT_CAMERA_FRAME_NAME),
97106
(FRONT_RIGHT_FRAME_NAME, FRONT_RIGHT_CAMERA_FRAME_NAME),
107+
(WRIST_FRAME_NAME, HAND_FRAME_NAME),
108+
(HAND_FRAME_NAME, HAND_CAMERA_FRAME_NAME),
98109
):
99110
edge = transforms_snapshot.child_to_parent_edge_map[child_frame_name]
100111
edge.parent_frame_name = parent_frame_name

0 commit comments

Comments
 (0)