improvement: installer registers arm_commands handlers in generated robot#1
Merged
Conversation
…obot
`mix igniter.install bb_so101` now adds the `arm_commands` example package
as a sparse git dep against `beam-bots/bb_examples`, and registers the
three demo command handlers — `BB.Examples.ArmCommands.{Home, MoveToPose,
DemoCircle}` — as commands on the generated robot.
Each command is registered with full DSL `argument` metadata, so the
bb_liveview dashboard immediately renders proper input widgets for every
goal field:
- `:position` (float) for home
- `:ee_link` (atom) for move_to_pose and demo_circle
- `:plane` (`{:in, [:xy, :xz, :yz]}` enum), `:radius` (float),
`:points` (integer), `:settle_tolerance_m` (float),
`:settle_timeout_ms` (integer) for demo_circle
The user gets a fully demo-ready arm out of a single
`mix igniter.install bb_so101` — including IK-driven moves to a Cartesian
target and a configurable demo circle.
## Why a sparse git dep?
`arm_commands` lives in the `bb_examples` monorepo, distributed as a git
dep rather than via Hex on the grounds that example/demo code doesn't
need versioned releases. The `sparse:` checkout means consumers only
pull the `arm_commands/` sub-directory, not the entire monorepo.
## Implementation note
There's no `BB.Igniter.add_command/4` helper in `bb` yet, so the
installer carries its own small `add_command/4` private function that
wraps `Spark.Igniter.update_dsl` the same way `BB.Igniter.add_controller/4`
already does internally. If/when more installers need this, it can be
promoted into `BB.Igniter`.
## Test plan
- [x] `mix check --no-retry` green (16 installer tests, +4 new covering
the arm_commands dep + each command registration)
- [x] Idempotency test passes — running the installer twice produces no
further changes.
1549ddd to
4b10c5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mix igniter.install bb_so101now adds thearm_commandsexample packageas a sparse git dep against
beam-bots/bb_examples, andregisters the three demo command handlers as commands on the generated
robot —
home,move_to_pose, anddemo_circle— each with full DSLargumentmetadata so the bb_liveview dashboard renders proper inputwidgets for every goal field.
The user gets a fully demo-ready arm out of a single
mix igniter.install bb_so101: IK-driven moves to a Cartesian target, aconfigurable demo circle in any of the three axis-aligned planes, and a
parameterised
homecommand.What gets generated
Implementation note
There's no
BB.Igniter.add_command/4helper inbbyet, so theinstaller carries its own small
add_command/4private function thatwraps
Spark.Igniter.update_dslthe same wayBB.Igniter.add_controller/4already does internally. Idempotent on command name. If/when more
installers need this, it can be promoted into
BB.Igniter.Test plan
mix check --no-retrygreenthree commands registered with the right handler and at least one
representative
argumentdeclaration.twice produces no further changes.