Reachy Mini documentation

기록된 이동

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

기록된 이동

이 예제는 Reachy Mini에서 데이터셋의 모든 가용한 동작을 재생하는 방법을 보여줍니다. 춤과 감정을 위한 사전 구축된 라이브러리를 사용하거나, 사용자 정의 데이터셋을 제공할 수 있습니다.

다음 명령으로 실행합니다:

python recorded_moves.py -l [dance, emotions]

Or with a custom dataset:

python recorded_moves.py --dataset path/to/your/dataset

import argparse

from reachy_mini import ReachyMini
from reachy_mini.motion.recorded_move import RecordedMove, RecordedMoves

# Keep compatibility with the original library flag while allowing custom datasets.
LIBRARY_DATASETS = {
    "dance": "pollen-robotics/reachy-mini-dances-library",
    "emotions": "pollen-robotics/reachy-mini-emotions-library",
}


def main(dataset_path: str) -> None:
    """Connect to Reachy and run the main demonstration loop."""
    recorded_moves = RecordedMoves(dataset_path)

    print("Connecting to Reachy Mini...")
    with ReachyMini() as reachy:
        print("Connection successful! Starting dance sequence...\n")
        try:
            while True:
                for move_name in recorded_moves.list_moves():
                    move: RecordedMove = recorded_moves.get(move_name)
                    print(f"Playing move: {move_name}: {move.description}\n")
                    reachy.play_move(move, initial_goto_duration=1.0)

        except KeyboardInterrupt:
            print("\n Sequence interrupted by user. Shutting down.")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Demonstrate and play all available dance moves for Reachy Mini."
    )
    parser.add_argument(
        "-l",
        "--library",
        type=str,
        default="dance",
        choices=sorted(LIBRARY_DATASETS.keys()),
        help="Pick one of the original libraries (default: dance).",
    )
    parser.add_argument(
        "--dataset",
        type=str,
        help="Local path or HF dataset id. Overrides --library when provided.",
    )
    args = parser.parse_args()
    dataset_path = args.dataset or LIBRARY_DATASETS[args.library]
    main(dataset_path)
Update on GitHub