Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"huggingface-hub==0.34.4",
"sounddevice==0.5.1",
"soundfile==0.13.1",
"reachy-mini-rust-kinematics>=1.0.1",
"reachy-mini-rust-kinematics>=1.0.2",
"asgiref",
"aiohttp",
]
Expand Down
15 changes: 11 additions & 4 deletions src/reachy_mini/kinematics/analytical_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,17 @@ def ik(
"""
_pose = pose.copy()
_pose[:3, 3][2] += self.head_z_offset

stewart_joints = self.kin.inverse_kinematics(_pose, body_yaw) # type: ignore[arg-type]

return np.array([body_yaw] + stewart_joints)

# inverse kinematics solution that modulates the body yaw to
# stay within the mechanical limits (max_body_yaw)
# additionally it makes sure the the relative yaw between the body and the head
# stays within the mechanical limits (max_relative_yaw)
reachy_joints = self.kin.inverse_kinematics_safe(_pose, # type: ignore[arg-type]
body_yaw = body_yaw,
max_relative_yaw = np.deg2rad(65),
max_body_yaw = np.deg2rad(160))

return np.array(reachy_joints)

def fk(
self,
Expand Down