Skip to content

improvement: add bb_pid_controller.install igniter task#20

Merged
jimsynz merged 1 commit into
mainfrom
igniter-installer
May 13, 2026
Merged

improvement: add bb_pid_controller.install igniter task#20
jimsynz merged 1 commit into
mainfrom
igniter-installer

Conversation

@jimsynz
Copy link
Copy Markdown
Contributor

@jimsynz jimsynz commented May 13, 2026

Summary

Adds an Igniter installer that scaffolds a PID controller in the robot module with runtime-tunable gains.

Running mix igniter.install bb_pid_controller will:

  • Add a BB.PID.Controller entry to the robot's controllers section, with kp/ki/kd referencing :config.<name>.{kp,ki,kd} so the gains can be retuned at runtime through the BB parameter system without recompiling
  • Define the :config.<name> param group with :kp, :ki, :kd (defaults 1.0 / 0.0 / 0.0)
  • Import the package's formatter rules
  • Print a notice reminding the user to fill in the [:TODO] topic paths once they know which joint to control

The topic paths (setpoint/measurement/output) are scaffolded as [:TODO] placeholders because the installer can't infer the joint paths from the robot topology.

Options

Flag Default Purpose
--robot / -r {AppPrefix}.Robot Robot module to target
--name / -n pid Controller name and param group name

Run the installer multiple times with different --name values to scaffold multiple PID loops.

Other changes

Test plan

  • mix check --no-retry passes
  • 8 new unit tests covering controller, param group, custom names, formatter import, TODO notice, and idempotency
  • All 28 tests pass

Adds an installer that scaffolds a PID controller in the robot module with
runtime-tunable gains. The kp/ki/kd gains are wired as `param([:config,
<name>, :kp])` etc. so they can be retuned at runtime through the BB
parameter system without recompiling.

The topic paths (setpoint/measurement/output) are scaffolded as `[:TODO]`
placeholders for the user to fill in once they know their joint paths,
since the installer can't infer those.

Options: `--robot`, `--name` (default `pid`).

Bumps `bb` to `~> 0.15.3` (for the new `BB.Igniter` helpers) and adds `:mix`
to the dialyzer PLT so the `use Mix.Task` fallback in the installer
typechecks cleanly.
@jimsynz jimsynz merged commit 5912dad into main May 13, 2026
15 checks passed
@jimsynz jimsynz deleted the igniter-installer branch May 13, 2026 09:56
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.

1 participant