PROS: 2D Motion Profiling PID help

I’m attempting to set up 2D Motion Profiling with PID and can’t seem to find any examples of such. I was wondering if my two snippets of code I made do the same thing. I was also wondering what this warning means.

Warning:

First Code:
ChassisControllerPID driveTrain = ChassisControllerFactory::create(
{8, 7},
{-18, -17},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
AbstractMotor::gearset::green,
{4_in, 13.5_in}
);

AsyncMotionProfileController move = AsyncControllerFactory::motionProfile(
1.0,
2.0,
10.0,
driveTrain
);

Second Code:
auto driveTrain = ChassisControllerFactory::create(
{8, 7},
{-18, -17},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
IterativePosPIDController::Gains{0.001, 0, 0.0001},
AbstractMotor::gearset::green,
{4_in, 13.5_in}
);

auto move = AsyncControllerFactory::motionProfile(
1.0,
2.0,
10.0,
driveTrain
);

1 Like

They did make a whole page dedicated to this: Pros 2D Motion Profiling

As for the warning do you have optimize as an attribute in the .hpp?

I ended up accidentally restarting the program and the warning went away. Perpahs I was too unclear in my question. Does replacing ChassisControllerPID and AsyncMotionProfileController with auto change the program in any way? I’m assuming auto is just a macro for the various types of ChassisControllers and ect.

auto is a c++ keyword that you can use to avoid writing out long and tedious typenames. It signals that the type of the variable being declared will be derived from whatever’s on the RHS of the assignment.

3 Likes