Skip to content

Conversation

TroteaTeodor
Copy link

Summary

This PR introduces a new command-line tool lerobot-animate that allows users to easily create, save, and play custom animations with SO-101 robot arms through an intuitive interactive interface.

Features

  • Interactive pose recording: Manually move the robot arm and press ENTER to record poses
  • Configurable playback controls:
    • speed command (0.1-5.0x) to control movement speed between poses
    • delay command (0-5.0s) to set pause duration between poses
  • Animation management: Save/load animations as JSON files with metadata
  • CLI integration: Seamlessly integrates with existing LeRobot commands (lerobot-find-port)
  • Auto-load support: Load and play animations directly from command line
  • Loop playback: Continuous animation loops for demonstrations

Usage Examples

Find robot port and start animation tool

lerobot-find-port
lerobot-animate /dev/tty.usbmodem5A680123451

Interactive commands

speed 2.0 # Double speed movement
delay 0.2 # 200ms pause between poses
play # Play current animation
save # Save animation to file

Technical Implementation

  • Package integration: Added as lerobot.animate module with proper entry point
  • CLI argument parsing: Accepts port as required argument with optional flags
  • Error handling: Robust connection handling and graceful error recovery
  • Status display: Real-time status showing poses recorded, current speed, and delay
  • Code quality: Follows LeRobot coding standards and conventions

Documentation

  • Added comprehensive README section with usage examples
  • Follows existing documentation style and formatting
  • Includes all commands, parameters, and CLI options

Testing

  • Tested with SO-101 robot arms
  • Includes example animation file (upandnown.json)
  • Validates parameter ranges and input handling

Benefits

  • Easier prototyping: Quickly create robot demonstrations without coding
  • Educational tool: Great for teaching robotics concepts and arm movement
  • Debugging aid: Test robot movements and poses interactively
  • Content creation: Create smooth animations for demos and presentations

This tool complements LeRobot's existing capabilities by providing an accessible way for users to experiment with robot arm movements and create custom animations without writing code.

- Add animate.py module for creating and playing robot animations
- Support recording poses by manually moving the arm
- Save/load animations to JSON files
- Add CLI with port argument and playback options
- Include example upandnown animation
@Liu9999ai
Copy link

@TroteaTeodor hi may I know can this PR allow user to save the recorded lerobot dataset with increased speed? I mean all the .json, .parquet .mp4 will be saved with increased speed or not? (so that I can train model using dataset with increased speed, and during inference can run at faster speed....)

@TroteaTeodor
Copy link
Author

@TroteaTeodor hi may I know can this PR allow user to save the recorded lerobot dataset with increased speed? I mean all the .json, .parquet .mp4 will be saved with increased speed or not? (so that I can train model using dataset with increased speed, and during inference can run at faster speed....)

Hi @Liu9999ai, my current implementation doesn’t support recording a dataset while it’s playing. It’s mainly a simple way to animate the arm so you can move it around, save the position, and then replay it.
Regarding speed/delay: it isn’t stored in the output .json files for positions, but you can control the playback speed when you run the animation itself. You can also probably see that if you do help in the cli while running it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants