Skip to content

Improve eye LED animation utility#35

Open
hello-shivam-bhardwaj wants to merge 1 commit into
mainfrom
feature/eye-led-control-utility
Open

Improve eye LED animation utility#35
hello-shivam-bhardwaj wants to merge 1 commit into
mainfrom
feature/eye-led-control-utility

Conversation

@hello-shivam-bhardwaj

Copy link
Copy Markdown

Summary

This PR improves the existing stretch_eye_animations utility so it can be used both interactively and from command-line scripts.

The utility now supports:

  • --list to print available eye animation names and indexes without touching hardware.
  • --list-colors to print named RGB colors.
  • --animation to set both eyes at once.
  • --left and --right to control each eye separately.
  • --color, --rgb, and --intensity for color/intensity control.
  • --direct and --usb for direct serial access, matching other power-periph utilities.
  • Existing interactive behavior when no command is supplied.

Why

During PIMU LED timing validation, we needed a repeatable way to command eye LED patterns without adding temporary firmware hooks. The previous utility required repeated interactive prompts, which made hardware testing slower and harder to document.

This keeps the control surface in Stretch Body, where operators and test scripts already expect robot utilities to live.

Examples

List animations:

stretch_eye_animations --list

Set both eyes to idle glow at Stretch default color:

stretch_eye_animations --animation IDLE_GLOW --color stretch --intensity 255

Set different animations per eye using direct serial:

stretch_eye_animations --direct --usb /dev/hello-power-periph --left LOOK_LEFT --right LOOK_RIGHT --color blue --intensity 128

Use explicit RGB values:

stretch_eye_animations --animation ALERT --rgb 255 0 0 --intensity 255

Validation

Local:

  • python3 -m py_compile stretch4_body/tools/stretch_eye_animations.py

Bench NUC on stretch-se4-4032 / 10.1.10.32:

  • Copied the new utility to /tmp.
  • Ran --list successfully.
  • Sent a direct eye command through /dev/hello-power-periph successfully.
  • Restored the eyes to IDLE_GLOW at default Stretch color/intensity after the test.

Review Notes

This PR does not change firmware behavior or the PowerPeriph API. It only makes the existing eye animation command path easier to use from scripts and bench tests.

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