When coding my autons using okapi chassis builder. I couldn’t get the chassis to change speed when using. chassis->getModel()->setMaxVelocity(100);
I’m using okapi V4 and pros V3.2.0.
Motor leftMotor(7, false, AbstractMotor::gearset::red, AbstractMotor::encoderUnits::degrees);
Motor rightMotor(5, true, AbstractMotor::gearset::red, AbstractMotor::encoderUnits::degrees);
Motor middleMotor(6, false, AbstractMotor::gearset::red, AbstractMotor::encoderUnits::degrees);
std::shared_ptr<ChassisController> chassis = ChassisControllerBuilder()
.withMotors(leftMotor, rightMotor, middleMotor)
.withSensors(leftEncoder, rightEncoder)
.withDimensions(AbstractMotor::gearset::red, {{4_in, 10_in}, imev5RedTPR})
.withMaxVelocity(60)
.withLogger(
std::make_shared<Logger>(
TimeUtilFactory::createDefault().getTimer(), // It needs a Timer
"/usd/Chassis_Diagnostics", // Output to the SDCard
Logger::LogLevel::info // Most verbose log level
)
)
.build();
void autonomous() {
chassis->moveDistance(1_ft);
chassis->getModel()->setMaxVelocity(100);
chassis->moveDistance(1_ft);
}