BeatBot
BeatBot makes a UFactory xArm 7-DOF dance to whatever song you throw at it.
Core trick
Detects beats with librosa and maps each beat to a pose from a bank, clamped by per-joint angle envelopes and speed caps.
Description
BeatBot makes a UFactory xArm 7-DOF dance to whatever song you throw at it. Librosa picks the beats offline, and the arm runs through a small bank of joint poses on every beat, with safety baked in so it never whips itself around: per-joint angle envelopes, slow speed and accel caps, and a beat-rate throttle for fast songs. A webcam records the run, ffmpeg muxes the song audio into the video, and the whole take pushes back to the repo for review.
What made this different was the build loop. Most of what's been shown with Opus 4.7 is webapps and agents. We pointed it at a real 7-DOF arm with real torque, on hardware we already use for vision research. Claude wrote the choreography, the safety clamps, the beat scheduler, the camera fallback, and the SIGINT handling. It read our existing visual_servoing repo to match conventions, remembered the lab IP and conda env across turns, and when something broke on the robot we just pushed the log and the recorded video back to the repo. Claude pulled them and diagnosed directly from the artifacts, including a subtle threading bug where Ctrl-C wasn't unwinding the xArm's blocking calls.
README excerpt
# Dancing-Arm Open source, beat-synced dance for the UFactory xArm 7-DOF. Plays a song, detects beats with librosa, and moves the arm through a small bank of safe joint poses on each beat. The full source for the beat tracker, pose bank, safety envelope, and webcam recorder is in this repository under the MIT license. ## Hardware - UFactory xArm (7 joints) on the LAN, default IP `192.168.1.241`. - The script uses joint-angle control in degrees via `xarm-python-sdk`. ## Install ```bash # macOS audio + video backends brew install portaudio ffmpeg # python deps pip install -r requirements.txt ``` `ffmpeg` is required for muxing the song audio into the saved webcam video. If you already have the `semvs` conda env from `visual_servoing_for_suction_grippers`, `xarm-python-sdk` and `opencv-python` are already installed; you only need to add the audio stack: ```bash conda activate semvs brew install portaudio ffmpeg pip install librosa sounddevice soundfile ``` ## Run A no-copyright song is bundled at `samples/eliveta.mp3` and is the default audio. You can run with no arguments at all. Dry run (preview choreography, no arm motion, no recording): ```bash python3 dance.py --dry-run --no-record ``` When you're happy, connect to the arm. Webcam recording is on by default and outputs land in `runs/`: ```bash python3 dance.py ``` Each run writes: - `runs/dance_<song>_<timestamp>.mp4` (webcam video with the song muxed as audio) - `runs/dance_<song>_<timestamp>.log` (full std