|
libstp
Robotics library for Botball
|
Calibrate per-motor ticks_to_rad using the IMU heading as ground truth. More...
#include <encoder_calibrator.hpp>
Public Member Functions | |
| EncoderCalibrator (drive::Drive &drive, odometry::IOdometry &odometry) | |
| EncoderCalResult | calibrate (const EncoderCalConfig &cfg) const |
Calibrate per-motor ticks_to_rad using the IMU heading as ground truth.
The calibrator commands a slow in-place rotation, accumulates the IMU heading change vs. the odometry-integrated heading change, and rescales MotorCalibration::ticks_to_rad by imu_angle / odom_angle for every motor.
Because the same scale factor is applied to all motors, this only fixes the systematic component of the ticks_to_rad assumption (e.g. wrong gear-ratio constant). Individual per-motor variation requires a richer kinematics model and is out of scope here.
Definition at line 28 of file encoder_calibrator.hpp.
| libstp::autotune::EncoderCalibrator::EncoderCalibrator | ( | drive::Drive & | drive, |
| odometry::IOdometry & | odometry ) |
|
nodiscard |