weilin
April 6, 2021, 4:49am
3
That is not strictly necessary, as you can drift. But I definitely agree that holonomic drive base is easier to control for that purpose and it gives you a realistic chance at having repeatable results in the autonomous.
@Micah_7157X , you can use two PID loops for driving straight and turned combined into one.
Take a look at these:
Most everyone struggles with accurate base control in auton. At the highest level, 5225 developed a 3 tracking wheel solution that allowed them to set the world record in programming skills last year, and a handful of teams including 8059 and 139 have replicated their “odometry” based on a document they released last year. Team 5225 Introduction to Position Tracking Document
But at a less extreme level, for people just looking to take a step up from move.relative you may like the base control…
I think this worked. This was for encoder backs, so you will need to change nMoterEncoder] to SensorValue() for OSE’s.
// function to run drive motors for specified distance in units defined by WHEEL_DIAM then stop the drive motors
// +dist = forward, -dist = reverse.
void driveDistance(int dist)
{
nMotorEncoder[drive_LF] = 0; // reset the ime values to 0
nMotorEncoder[drive_RF] = 0;
driveLastError = 0; // update driveLastError
driveTarget = fabs(dist/(WHEEL_DIAM*PI) * ENCODER_TICKS); // …