Okapilib OdomChassisController driving and turning to much

@rbenasutti I just started setting up my code for programming autons. I’ve used this code in passed years just fine. The problem is after I setup the chassis controller the robot doesn’t drive or turn the right distances. I’ve tried several things but nothing seams to get better just different. I’ve attached my code and robot specs below and would like it if you’d read it and tell me if you see anything wrong with it.

Robot specs.

My chassis is built using 4 motor V5 motors with green cartridges in them. I’m using 4in omni wheels. two of them are direct drive and the other two are chain driven but they don’t have a ratio on them.
Chassis dimensions from center of wheel to center of wheel:

  • 7.5in long
  • 11.75in wide

Software Versions

VexOS 1.0.12
Kernel 3.3.1 pros-mainline
Okapilib 4.0.5 pros-mainline

Chassis declaration.

Motor frontLeftMotor(7, false, AbstractMotor::gearset::green, AbstractMotor::encoderUnits::degrees);
Motor backLeftMotor(8, false, AbstractMotor::gearset::green, AbstractMotor::encoderUnits::degrees);
Motor frontRightMotor(4, true, AbstractMotor::gearset::green, AbstractMotor::encoderUnits::degrees);
Motor backRightMotor(6, true, AbstractMotor::gearset::green, AbstractMotor::encoderUnits::degrees);

std::shared_ptr<OdomChassisController> chassis = ChassisControllerBuilder()
	.withMotors(frontLeftMotor, frontRightMotor, backRightMotor, backLeftMotor)
    ADIEncoder{'C', 'D'}, // Left encoder in ADI ports A & B
    ADIEncoder{'A', 'B'}  // Right encoder in ADI ports C & D (reversed)
    {0.0025, 0, 0}, // Distance controller gains
    {0.002, 0, 0}, // Turn controller gains
    {0.002, 0, 0.00006}  // Angle controller gains (helps drive straight)
  .withDimensions(AbstractMotor::gearset::green, {{4_in, 12_in}, imev5GreenTPR})
  .withOdometry({{4_in, 5.5_in}, quadEncoderTPR}, StateMode::FRAME_TRANSFORMATION) // use the same scales as the chassis (above)
  .buildOdometry(); // build an odometry chassis

Auton Code.


What is the observed result after each of the statements in the auton code?

After the first statement, did the robot drive 2 feet? Did it drive 6 feet? Did it drive 4 feet 1 inch?
DId the robot then turn 40 degrees? 130 degrees? 89 degrees?


It’s like what you said it would drive 8ft instead of 2ft. And turn double of what you asked it to. After it was messed up I just tried to get it turning right by adjusting the chassis width in the .withdimensions part of the chassis builder. This exact code with other measurements worked for my robot last season. That’s why I’m not sure what’s up.