I’m currently using the ChassisControllerIntegrated class in the okapi lilbrary to set up the user control for our robot. However when I test it, it seems like the robot is moving at full power no matter how little or far the axis is being pushed. The sensitivity is also way too high because of this, so I was wondering if there’s any way for me to change it? Or if there’s a better class to use for this.
Here’s my current code:
void opcontrol() {
//constructs
std::shared_ptr<okapi::ChassisController> drive =
ChassisControllerBuilder()
.withMotors({-11, -19}, {12,13}) //homebase -11, -19, 12, 13 //schoolBot 1, 11, 10, 20
// Green gearset, 4 in wheel diam, 11.5 in wheel track //UPDATE THIS IN A BIT
.withSensors(
RotationSensor{14}, // Left encoder in V5 port 1
RotationSensor{17, true} // Right encoder in V5 port 2 (reversed)
)
.withDimensions(AbstractMotor::gearset::green, {{4_in, 16.25_in}, imev5GreenTPR})
.build();
ControllerButton intakeButton(ControllerDigital::L1);
ControllerButton revIntakeButton(ControllerDigital::L2);
Motor intakeMotor(3);
fleft.set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
fright.set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
bleft.set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
bright.set_brake_mode(pros::E_MOTOR_BRAKE_COAST);
controller.clear();
while(true) {
drive->getModel()->arcade(controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y),
controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_X));
if (intakeButton.isPressed()) {
intakeMotor.moveVoltage(12000);
} else if (revIntakeButton.isPressed()) {
intakeMotor.moveVoltage(-12000);
} else {
intakeMotor.moveVoltage(0);
}
pros::delay(10);
}
Thanks for the help