Xenon27
February 3, 2022, 5:59am
60
Bruhmoment:
99999v, I have a more of a coding question. We are coding the auton and we manually set up the motors for the drivetrain instead of using the in built drivetrain function. I want to know how to code the inertial sensor so that the robot is accurate in going forward/brackward and in its turn? Plz help? Our competition is this sunday so plz help? Thanks!!
we used a custom PID control loop for our turns based on the inertial values.
I will be allocating this thread to answering any questions in regards to the tutorial
[C++ VEXCode V5 Text Tutorials - Autonomous PID and Multitasking]
Fair Warning: I am unsure if I have the positive and negative motor values correct, as this is all done on the top of my head. So If the robot is continuing to go even after the lateral position is reached, change
error = averagePosition - desiredValue;
to
error = desiredValue - averagePosition;
If the robot continues to go even a…
you probably don’t have time to learn this before Saturday though, so I would recommend using the drivetrain turning either with inertial or encoders for now and learning this way afterwards.