Orchestrates the full auto-tune pipeline in a single C++ entry point so phase-to-phase state coherence is guaranteed.
More...
|
| | AutoTuner (drive::Drive &drive, odometry::IOdometry &odometry, motion::UnifiedMotionPidConfig &motion_pid_config) |
| void | setConfirmCallback (ConfirmCallback cb) |
| | Install a callback invoked before every phase in tuneAll().
|
| AutoTuneResult | tuneAll (const AutoTuneConfig &cfg) |
| std::map< int, VelLpfResult > | runVelLpfPhase (const VelLpfConfig &cfg) |
| std::map< int, StaticFrictionResult > | runStaticFrictionPhase (const StaticFrictionConfig &cfg) |
| std::map< int, FirmwarePidResult > | runFirmwarePidPhase (const FirmwarePidConfig &cfg, std::optional< std::map< int, int > > max_bemf_speeds=std::nullopt) |
| EncoderCalResult | runEncoderCalibrationPhase (const EncoderCalConfig &cfg) |
| std::map< std::string, AxisResult > | runCharacterizePhase (const std::vector< std::string > &axes, const CharacterizeConfig &cfg) |
| std::map< std::string, VelocityTuneResult > | runVelocityPhase (const std::vector< std::string > &axes, const std::map< std::string, double > &max_velocities, const VelocityTuneConfig &cfg) |
| std::map< std::string, MotionTuneResult > | runMotionPhase (const std::vector< std::string > ¶ms, const MotionTuneConfig &cfg) |
| ToleranceResult | runTolerancesPhase (const std::map< std::string, MotionTuneResult > &motion_results, const MotionTuneConfig &motion_cfg, const ToleranceConfig &cfg) |
Orchestrates the full auto-tune pipeline in a single C++ entry point so phase-to-phase state coherence is guaranteed.
Every phase reads its inputs straight from the live IMotor, Drive, and UnifiedMotionPidConfig instances and writes its results back to those same objects before returning. Python wrappers do not need to shuttle calibration values between phases.
Execution order (each phase depends on the one before it):
- vel_lpf — per-motor IIR alpha (drives velocity feedback)
- static_friction — kS for feedforward / minimum-command
- firmware_pid — STM32 MAV-mode inner PID
- encoder_cal — global ticks_to_rad scale (republishes kinematics)
- characterize — physical drive limits (max v, accel, decel)
- velocity — chassis-axis velocity PID
- motion — distance / heading PID
- tolerances — derived from motion residuals
Definition at line 109 of file auto_tuner.hpp.
Install a callback invoked before every phase in tuneAll().
The callback receives a stable phase key — one of "vel_lpf", "static_friction", "firmware_pid", "encoder_cal", "characterize", "velocity", "motion", "tolerances" — so callers can show prompts, record telemetry, or skip phases at runtime.
For phases that command motion on multiple axes/params the key is extended with a colon suffix, e.g. "characterize:forward", "velocity:vx", "motion:heading".