|
libstp
Robotics library for Botball
|
Tunes motion PID gains (distance, lateral, heading) via Hooke-Jeeves coordinate descent. More...
#include <motion_tune.hpp>
Public Member Functions | |
| MotionTuner (drive::Drive &drive, odometry::IOdometry &odometry, motion::UnifiedMotionPidConfig &pid_config) | |
| std::map< std::string, MotionTuneResult > | tune (const std::vector< std::string > ¶ms, const MotionTuneConfig &cfg) const |
| Tune multiple parameters in sequence. | |
| MotionTuneResult | tuneParam (const std::string ¶m_name, const MotionTuneConfig &cfg) const |
| Tune a single motion PID parameter. | |
| void | requestPauseAfterTrial () const noexcept |
| Queue a pause that takes effect after the current trial completes. | |
| void | resume () const noexcept |
| Cancel a queued pause or resume from an active pause. | |
| std::string | pauseState () const |
| Current operator-control state: "running", "stop_queued", or "stopped". | |
Tunes motion PID gains (distance, lateral, heading) via Hooke-Jeeves coordinate descent.
For each parameter the tuner:
The UnifiedMotionPidConfig referenced on construction is mutated in-place during every trial (the gains are written directly before each motion is created) and, after tuning, retains the best-found gains. Callers should persist the config themselves after tune() returns.
Definition at line 37 of file motion_tune.hpp.
| libstp::autotune::MotionTuner::MotionTuner | ( | drive::Drive & | drive, |
| odometry::IOdometry & | odometry, | ||
| motion::UnifiedMotionPidConfig & | pid_config ) |
| drive | Chassis drive controller (reference, not owned). |
| odometry | Odometry source (reference, not owned). |
| pid_config | Motion PID config to tune in place (reference, not owned). |
|
nodiscard |
Current operator-control state: "running", "stop_queued", or "stopped".
|
noexcept |
Queue a pause that takes effect after the current trial completes.
|
noexcept |
Cancel a queued pause or resume from an active pause.
|
nodiscard |
Tune multiple parameters in sequence.
Valid param names are "distance", "lateral", and "heading". The pid_config is updated with the best-found gains for each parameter.
| params | List of parameter names to tune. |
| cfg | Tuning configuration. |
|
nodiscard |
Tune a single motion PID parameter.
| param_name | One of "distance", "lateral", or "heading". |
| cfg | Tuning configuration. |