Reachy Mini documentation
Chuỗi
Bắt đầu
Reachy Mini (Không dây)
Bắt đầuPhần cứngCách sử dụngĐiều khiển nâng cao cho phương tiệnĐặt lạiCài đặt Daemon từ BranchQuy trình phát triểnGhi lại ISO
Reachy Mini Lite
Mô phỏng
Hướng dẫn phần mềm
Tổng quan về SDKCài đặtKhái niệm cốt lõiHướng dẫn bắt đầuJavaScript SDK & Web AppsXây dựng & Phát hành Ứng dụngChu kỳ hoạt động và ngủTích hợp AIPython SDKREST APIKiến trúc phương tiệnNgười dùng phía Cloud-BackendCài đặt GStreamerTelemetry
Hỗ trợ và trợ giúp
Ví dụ
Demo tối giảnXemTheo dõi đầuChuỗiĐi tới Interpolation PlaygroundIMUTrình diễn Chế độ Tuân thủCác nước đã ghi lạiRerun ViewerChụp ẢnhBộ điều khiển JoystickGiao diện người dùng Vị trí đầuHướng đến của âm thanhPhát âm thanhGhi âmÂm thanh TTS (kèm theo lắc đầu)Trình quản lý phương tiện tùy chỉnh
Tích hợp
API
Chuỗi
Mã này giới thiệu các chuyển động khác nhau trên Reachy Mini.
import time
import numpy as np
from reachy_mini import ReachyMini
from reachy_mini.utils.rotation import Rotation as R
def main() -> None:
"""Run the motion sequence in a loop."""
with ReachyMini(media_backend="no_media") as reachy_mini:
reachy_mini.goto_target(np.eye(4), antennas=[0.0, 0.0], duration=1.0)
try:
while True:
pose = np.eye(4)
t = 0.0
t0 = time.time()
# --- Step 1: Yaw oscillation (0.7 rad amplitude, 0.5 Hz) ---
s = time.time()
while time.time() - s < 2.0:
t = time.time() - t0
euler_rot = np.array([0, 0.0, 0.7 * np.sin(2 * np.pi * 0.5 * t)])
rot_mat = R.from_euler("xyz", euler_rot, degrees=False).as_matrix()
pose[:3, :3] = rot_mat
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.01)
# --- Step 2: Pitch oscillation (0.3 rad amplitude, 0.5 Hz) ---
s = time.time()
while time.time() - s < 2.0:
t = time.time() - t0
euler_rot = np.array([0, 0.3 * np.sin(2 * np.pi * 0.5 * t), 0])
rot_mat = R.from_euler("xyz", euler_rot, degrees=False).as_matrix()
pose[:3, :3] = rot_mat
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.01)
# --- Step 3: Roll oscillation (0.3 rad amplitude, 0.5 Hz) ---
s = time.time()
while time.time() - s < 2.0:
t = time.time() - t0
euler_rot = np.array([0.3 * np.sin(2 * np.pi * 0.5 * t), 0, 0])
rot_mat = R.from_euler("xyz", euler_rot, degrees=False).as_matrix()
pose[:3, :3] = rot_mat
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.01)
# --- Step 4: Vertical bounce (25 mm amplitude, 0.5 Hz) ---
s = time.time()
while time.time() - s < 2.0:
t = time.time() - t0
pose = np.eye(4)
pose[:3, 3][2] += 0.025 * np.sin(2 * np.pi * 0.5 * t)
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.01)
# --- Step 5: Antenna wave (alternating, 0.5 rad amplitude) ---
s = time.time()
while time.time() - s < 2.0:
t = time.time() - t0
antennas = [
0.5 * np.sin(2 * np.pi * 0.5 * t),
-0.5 * np.sin(2 * np.pi * 0.5 * t),
]
reachy_mini.set_target(head=pose, antennas=antennas)
time.sleep(0.01)
# --- Step 6: Circular XY translation (15 mm radius, 1 Hz) ---
s = time.time()
while time.time() - s < 5.0:
t = time.time() - t0
pose[:3, 3] = [
0.015 * np.sin(2 * np.pi * 1.0 * t),
0.015 * np.sin(2 * np.pi * 1.0 * t + np.pi / 2),
0.0,
]
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.01)
# --- Step 7: Static pose sequence (position + yaw snaps) ---
pose[:3, 3] = [0, 0, 0.0]
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.5)
pose[:3, 3] = [0.02, 0.02, 0.0]
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.5)
pose[:3, 3] = [0.00, 0.02, 0.0]
euler_rot = np.array([0, 0, 0.5])
rot_mat = R.from_euler("xyz", euler_rot, degrees=False).as_matrix()
pose[:3, :3] = rot_mat
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.5)
pose[:3, 3] = [0.00, -0.02, 0.0]
euler_rot = np.array([0, 0, -0.5])
rot_mat = R.from_euler("xyz", euler_rot, degrees=False).as_matrix()
pose[:3, :3] = rot_mat
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(0.5)
pose[:3, 3] = [0, 0, 0.0]
reachy_mini.set_target(head=pose, antennas=[0, 0])
time.sleep(2)
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()