Skip to content

Commit 1eb4e46

Browse files
committed
Add body_yaw parameter to REST API move endpoints
This change exposes the body_yaw parameter, which was already supported in the Python SDK's goto_target() method, through the REST API endpoints. Changes: - Add body_yaw parameter to GotoModelRequest model - Add target_body_yaw parameter to FullBodyTarget model - Update /api/move/goto endpoint to pass body_yaw to backend - Update /api/move/set_target endpoint to support body_yaw - Add examples in JSON schema for both models The body_yaw parameter allows controlling the rotation of the robot's body around the vertical axis, enabling more expressive movements. Tested with Mujoco simulator using curl commands to verify: - Setting body_yaw alone works correctly - Setting body_yaw together with head_pose works correctly - Using body_yaw in set_target endpoint works correctly
1 parent 882490a commit 1eb4e46

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/reachy_mini/daemon/app/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class FullBodyTarget(BaseModel):
114114

115115
target_head_pose: AnyPose | None = None
116116
target_antennas: tuple[float, float] | None = None
117+
target_body_yaw: float | None = None
117118
timestamp: datetime | None = None
118119

119120
model_config = {
@@ -129,6 +130,7 @@ class FullBodyTarget(BaseModel):
129130
"yaw": 0.0,
130131
},
131132
"target_antennas": [0.0, 0.0],
133+
"target_body_yaw": 0.0,
132134
}
133135
]
134136
}

src/reachy_mini/daemon/app/routers/move.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class GotoModelRequest(BaseModel):
4747

4848
head_pose: AnyPose | None = None
4949
antennas: tuple[float, float] | None = None
50+
body_yaw: float | None = None
5051
duration: float
5152
interpolation: InterpolationMode = InterpolationMode.MINJERK
5253

@@ -63,6 +64,7 @@ class GotoModelRequest(BaseModel):
6364
"yaw": 0.0,
6465
},
6566
"antennas": [0.0, 0.0],
67+
"body_yaw": 0.0,
6668
"duration": 2.0,
6769
"interpolation": "minjerk",
6870
},
@@ -152,6 +154,7 @@ async def goto(
152154
backend.goto_target(
153155
head=goto_req.head_pose.to_pose_array() if goto_req.head_pose else None,
154156
antennas=np.array(goto_req.antennas) if goto_req.antennas else None,
157+
body_yaw=goto_req.body_yaw,
155158
duration=goto_req.duration,
156159
)
157160
)
@@ -232,6 +235,7 @@ async def set_target(
232235
if target.target_head_pose
233236
else None,
234237
antennas=np.array(target.target_antennas) if target.target_antennas else None,
238+
body_yaw=target.target_body_yaw,
235239
)
236240
return {"status": "ok"}
237241

0 commit comments

Comments
 (0)