Okapi's ChassisController with Inertial Sensor

I am using VEX PROS for the first time this year, and I stumbled across Okapi’s ChassisController, that makes auton much, much easier. However, since the functions run in a closed loop, they don’t see what happens to the robot. In our auton, the robot runs into the goal and sometimes gets turned a little bit. This messes up the whole rest of the auton, and it seems to be random when it happens. Is there any way I can incorporate an inertial sensor into the ChassisController so that it always turns correctly?

I am aware that you can use rotational sensors on the wheels, but I don’t think that would help. I am working on using the OdomChassisController to see if that would help, but in the Okapi docs it says

If you are using a ChassisControllerIntegrated, the chassis dimensions will be different than the odometry scales given to withDimensions. This is because ChassisControllerIntegrated still requires scales for the powered wheels, while the tracking wheels have a different set of scales. You will need to pass an extra ChassisScales to withOdometry to specify the scales for the tracking wheels.

I have the measurements for withDimensions, but what would I have to measure for the “tracking wheels”?

And finally, would using a PID chassis controller fix my problem? I’m not sure what difference it would make, because I think moveDistance() and turnAngle() already use a PID controller.

I realized that after I posted the question I missed a few things.

Here’s the properly formatted article entry:

If you are using a ChassisControllerIntegrated, the chassis dimensions will be 
different than the odometry scales given to withDimensions. This is because 
ChassisControllerIntegrated still requires scales for the powered wheels, while
the tracking wheels have a different set of scales. You will need to pass an extra 
ChassisScales to withOdometry to specify the scales for the tracking wheels.

Here’s my current constructor:

std::shared_ptr<okapi::OdomChassisController> chassis =
  okapi::ChassisControllerBuilder()
    .withMotors(5, 17, 19, 4)
    // Blue gearset, 4 in wheel diam, 12.5 in wheel track
    .withDimensions({okapi::AbstractMotor::gearset::blue, (36.0 / 72.0)}, {{4_in, 13.5_in}, 1200L}) // 1200 for the gear ratio
    .withOdometry()
    .buildOdometry(); 

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.