Skip to content

Conversation

@jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Dec 6, 2025

TODO:

  • parameter remote access protocol

@jimsynz jimsynz force-pushed the parameters branch 2 times, most recently from d133a43 to 32a7238 Compare December 6, 2025 18:41
@jimsynz jimsynz marked this pull request as ready for review December 6, 2025 18:41
Implements a complete parameter system for BB robots:

Phase 1 - Core Infrastructure:
- `BB.Parameter` module for get/set/list operations
- ETS-backed storage in `BB.Robot.State`
- Spark.Options validation for type safety
- PubSub notifications on parameter changes

Phase 2 - DSL Integration:
- `parameters` section with `param` and `group` entities
- Inline params on `controller`, `sensor`, `actuator` entities
- `ParameterTransformer` generates schema and default functions
- Unit-typed parameters via `{:unit, unit_type}` syntax

Phase 3 - Persistence:
- `BB.Parameter.Store` behaviour for pluggable backends
- `BB.Parameter.Store.Dets` implementation using OTP DETS
- `parameter_store` DSL option in settings section
- Automatic save on change, load on startup
Add `BB.Parameter.Protocol` behaviour for parameter bridges that provide
bidirectional parameter access between BB and remote systems (flight
controllers, GCS, web UIs).

Outbound (local → remote):
- `init/2` - initialise bridge state
- `handle_change/3` - push local parameter changes to remote clients

Inbound (remote → local):
- `list_remote/1` - enumerate remote parameters with PubSub paths
- `get_remote/2` - read remote parameter values
- `set_remote/3` - write remote parameter values
- `subscribe_remote/2` - subscribe to remote parameter changes

Also adds:
- `bridge` DSL entity in parameters section
- Fault-isolated supervisors: BridgeSupervisor, SensorSupervisor,
  ControllerSupervisor
- `BB.Parameter.{list,get,set,subscribe}_remote` API functions
- Reference implementation in test/support for testing
Add two new tutorials following the Diataxis framework:
- 07-parameters.md: core parameter system (DSL, get/set, PubSub)
- 08-parameter-bridges.md: remote parameter access via bridges

Simplify `BB.Parameter.Protocol` by removing redundant `init/2` callback.
Bridges are always GenServers, so they use GenServer's `init/1` directly
with robot metadata passed via the `:bb` key in opts.

Update 06-urdf-export.md to link to the new parameters tutorial.
@jimsynz jimsynz merged commit a5c92b2 into main Dec 6, 2025
14 checks passed
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