improvement: add bb_pid_controller.install igniter task#20
Merged
Conversation
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.
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
Adds an Igniter installer that scaffolds a PID controller in the robot module with runtime-tunable gains.
Running
mix igniter.install bb_pid_controllerwill:BB.PID.Controllerentry to the robot'scontrollerssection, withkp/ki/kdreferencing:config.<name>.{kp,ki,kd}so the gains can be retuned at runtime through the BB parameter system without recompiling:config.<name>param group with:kp,:ki,:kd(defaults 1.0 / 0.0 / 0.0)[:TODO]topic paths once they know which joint to controlThe topic paths (setpoint/measurement/output) are scaffolded as
[:TODO]placeholders because the installer can't infer the joint paths from the robot topology.Options
--robot/-r{AppPrefix}.Robot--name/-npidRun the installer multiple times with different
--namevalues to scaffold multiple PID loops.Other changes
bbto~> 0.15.3(for the newBB.Igniterhelpers from improvement: addBB.Igniterhelpers for add-on installers bb#86).:mixto the dialyzer PLT so theuse Mix.Taskfallback in the installer typechecks cleanly.Test plan
mix check --no-retrypasses