Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 1.89 KB

File metadata and controls

76 lines (57 loc) · 1.89 KB

Python SDK Reference

Movement

Basic Control (goto_target)

Smooth interpolation between points. You can control head, antennas, and body_yaw.

from reachy_mini import ReachyMini
from reachy_mini.utils import create_head_pose
import numpy as np

with ReachyMini() as mini:
    # Move everything at once
    mini.goto_target(
        head=create_head_pose(z=10, mm=True),    # Up 10mm
        antennas=np.deg2rad([45, 45]),           # Antennas out
        body_yaw=np.deg2rad(30),                 # Turn body
        duration=2.0,                            # Take 2 seconds
        method="minjerk"                         # Smooth acceleration
    )

Interpolation methods: linear, minjerk (default), ease, cartoon.

Instant Control (set_target)

Bypasses interpolation. Use this for high-frequency control (e.g., following a joystick or generated trajectory).

Sensors & Media

Camera

Get raw frames (OpenCV format) or use the GStreamer backend for low latency.

import cv2
frame = mini.media.get_frame()
cv2.imshow("Reachy", frame)

Audio

Reachy uses sounddevice for audio I/O.

# Record
sample = mini.media.get_audio_sample()

# Play
mini.media.play_sound("wake_up.wav")
# Or push raw chunks:
# mini.media.push_audio_sample(chunk)

Recording Moves

You can record a motion by moving the robot (compliant mode) or sending commands, and save it for later replay.

mini.start_recording()
# ... robot moves ...
recorded_data = mini.stop_recording()

Motor Modes

  • mini.enable_motors(): Stiff. Holds position.
  • mini.disable_motors(): Limp. No power.
  • mini.enable_gravity_compensation(): "Soft" mode. Move head by hand, stays where you leave it.

Look At Commands

# 2D (Image coordinates) - 0,0 is top-left
mini.look_at_image(x, y)

# 3D (World coordinates)
mini.look_at_world(x, y, z)