Hi,
My team is trying to move from block program to okapi. They started coding and observing the bot steering to left or right right before it stops, when chassis->moveDistance(1_ft). Below is the code which is being used to test this. can any one please review and let me know what is causing this?
Drive motors are connected to 60 tooth gear and wheels are connected to 84 tooth gear.
IMU is connected to port 6
std::shared_ptrokapi::OdomChassisController chassis =
ChassisControllerBuilder()
.withMotors({-3, -7}, {-9, -14})
.withDimensions({AbstractMotor::gearset::green, (60 / 84.0)}, {{4_in, 15_in}, imev5GreenTPR})
.withGains(
{.00063, 0.00001, 0.000015},
{0.00179, 0,0}, // Turn controller gains
{0.00005, .0005, .00005})
.withOdometry()
.withDerivativeFilters(
std::make_unique<AverageFilter<3>>(), // Distance controller filter
std::make_unique<AverageFilter<3>>(), // Turn controller filter
std::make_unique<AverageFilter<3>>() // Angle controller filter
)
.withClosedLoopControllerTimeUtil(5, 5, 250_ms)
.withMaxVoltage(12000)
.withLogger(
std::make_shared(
TimeUtilFactory::createDefault().getTimer(), // It needs a Timer
“/ser/sout”, // Output to the PROS terminal
Logger::LogLevel::debug // Most verbose log level
))
.buildOdometry();
auton code:
chassis->moveDistance(1_ft);
Thanks so much.