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
16 changes: 6 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ requires-python = ">=3.10"
dependencies = [
"numpy>=2.2.5",
"scipy>=1.15.3, <2.0.0",
"reachy_mini_motor_controller>=1.3.0",
"reachy_mini_motor_controller>=1.3.0",
"eclipse-zenoh>=1.4.0",
"opencv-python<=5.0",
"cv2_enumerate_cameras>=1.2.1",
Expand All @@ -23,22 +23,23 @@ dependencies = [
"pyserial",
"huggingface-hub==0.34.4",
"sounddevice==0.5.1",
"soundfile==0.13.1",
"soundfile==0.13.1",
"reachy-mini-rust-kinematics>=1.0.1",
"asgiref",
"aiohttp",
"log-throttling==0.0.3",
"pyusb>=1.2.1",
"libusb_package>=1.0.26.3",
"pip>=25",
"rerun-sdk==0.27.1",
]


[project.optional-dependencies]
dev = [
"pytest",
"pytest",
"pytest-asyncio",
"ruff==0.12.0",
"ruff==0.12.0",
"onshape-to-robot==1.7.6",
"mujoco==3.3.0",
"placo==0.9.14",
Expand All @@ -57,11 +58,7 @@ rerun = [
# See https://github.com/rerun-io/rerun-loader-python-example-urdf/issues/12
# "rerun-loader-urdf @ git+https://github.com/rerun-io/rerun-loader-python-example-urdf.git",
]
wireless-version = [
"semver>=3,<4",
"nmcli>=1.5",
"pollen_BMI088_imu_library"
]
wireless-version = ["semver>=3,<4", "nmcli>=1.5", "pollen_BMI088_imu_library"]

[project.scripts]
reachy-mini-daemon = "reachy_mini.daemon.app.main:main"
Expand Down Expand Up @@ -109,4 +106,3 @@ python_version = "3.10"
files = ["src/"]
ignore_missing_imports = true
strict = true

5 changes: 5 additions & 0 deletions src/reachy_mini/daemon/backend/mujoco/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ def run(self) -> None:
self.current_antenna_joint_positions = (
self.get_present_antenna_joint_positions()
)
# Update the Placo kinematics model to recompute passive joints
self.update_head_kinematics_model(
self.current_head_joint_positions,
self.current_antenna_joint_positions,
)
self.current_head_pose = self.get_mj_present_head_pose()

# Update the target head joint positions from IK if necessary
Expand Down
6 changes: 4 additions & 2 deletions src/reachy_mini/kinematics/placo_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import pinocchio as pin
import placo

from scipy.spatial.transform import Rotation as R


class PlacoKinematics:
"""Placo Kinematics class for Reachy Mini.
Expand Down Expand Up @@ -269,8 +271,8 @@ def _pose_distance(
float: The Euler distance between the two poses.

"""
euler1 = pin.rpy.matrixToRpy(pose1[:3, :3])
euler2 = pin.rpy.matrixToRpy(pose2[:3, :3])
euler1 = R.from_matrix(pose1[:3, :3]).as_euler("xyz")
euler2 = R.from_matrix(pose2[:3, :3]).as_euler("xyz")
p1 = pose1[:3, 3]
p2 = pose2[:3, 3]
return float(np.linalg.norm(euler1 - euler2)), float(np.linalg.norm(p1 - p2))
Expand Down
Loading