Reachy Mini safety guidance for enabling and disabling motor torque without head drops, jumps, or mixed-state issues.
When you toggle motor torque carelessly:
Both cause jerky, unpleasant motion.
Go to a safe position first (head will fall when torque is off):
from reachy_mini.reachy_mini import SLEEP_HEAD_POSE
import numpy as np
# Move to sleep position before disabling
antenna_angle = np.deg2rad(15)
reachy_mini.goto_target(
SLEEP_HEAD_POSE,
antennas=[-antenna_angle, antenna_angle],
duration=1.0,
)
reachy_mini.disable_motors()
Set goal to current position first (prevents jump to old goal):
def _goto_current_pose(reachy_mini, duration=0.05):
"""Set goal to current position to prevent jumps."""
head_pose = reachy_mini.get_current_head_pose()
_, antennas = reachy_mini.get_current_joint_positions()
reachy_mini.goto_target(
head=head_pose,
antennas=list(antennas) if antennas is not None else None,
duration=duration,
)
There is a known edge case when enabling/disabling only a subset of motors. The workaround is to call a full disable before enabling:
def _safe_enable_motors(self, reachy_mini: ReachyMini) -> None:
"""Enable motors safely, handling edge cases."""
self._goto_current_pose(reachy_mini, duration=0.05)
reachy_mini.disable_motors() # Needed to handle edge case with mixed motor states
reachy_mini.enable_motors()
Reference: See ~/reachy_mini_resources/fire_nation_attacked/fire_nation_attacked/main.py for a working implementation of this pattern.
If
~/reachy_mini_resources/doesn't exist, runskills/reachy-mini-setup-environment.mdto clone reference apps.
def safe_enable_motors(reachy_mini: ReachyMini) -> None:
"""Enable motors without jerky motion."""
# 1. Read current position
head_pose = reachy_mini.get_current_head_pose()
_, antennas = reachy_mini.get_current_joint_positions()
# 2. Set goal to current (very short duration)
reachy_mini.goto_target(
head=head_pose,
antennas=list(antennas) if antennas is not None else None,
duration=0.05,
)
# 3. Full disable (handles mixed motor state edge case)
reachy_mini.disable_motors()
# 4. Enable all motors
reachy_mini.enable_motors()
Best example: ~/reachy_mini_resources/marionette/marionette/main.py
This app toggles torque for motion recording and demonstrates the full safe pattern.
分析心理健康数据、识别心理模式、评估心理健康状况、提供个性化心理健康建议。支持与睡眠、运动、营养等其他健康数据的关联分析。