Hello,
In OkapiLib, in order to use the PID feature of the Chassis Controller, you need to specify gains with the withGains
method in the builder.
std::shared_ptr<OdomChassisController> chassis = ChassisControllerBuilder()
.withMotors(20, -11, -12, 19) // left motor is 1, right motor is 2 (reversed)
.withGains(
{0.001, 0, 0.0001}, // Distance controller gains
{0.001, 0, 0.0001}, // Turn controller gains
{0.001, 0, 0.0001} // Angle controller gains (helps drive straight)
)
// green gearset, 4 inch wheel diameter, 11.5 inch wheelbase
.withDimensions(AbstractMotor::gearset::green, {{4_in, 15.75_in}, imev5GreenTPR})
.withOdometry() // use the same scales as the chassis (above)
.buildOdometry(); // build an odometry chassis`
Where can I get these gains from? Or how do I measure them?