Working on Autonomous
Tags: software and controlPersonhours: 5
Task: Create a temporary autonomous for the bot
We attempted to create an autonomous for our first scrimmage. It aimed to make the robot to drive forward and drive into the safe zone. However, we forgot to align the robot and it failed at the scrimmage.
Instead of talking about the code like usual, the code's main functions are well documented so that any person can understand its functions without a prior knowledge of coding.
public void autonomous2 (){ switch(autoState){ case 0: //moves the robot forward .5 meters if (robot.driveStrafe(false, .60, .35)) { robot.resetMotors(true); autoState++; } break; case 1: //scan jewels and decide which one to hit if (robot.driveForward(false, .25, .35)) { autoTimer = futureTime(1f); robot.resetMotors(true); autoState++; } break; case 2: //short move to knock off jewel robot.glyphSystem.ToggleGrip(); autoTimer = futureTime(1f); robot.resetMotors(true); autoState++; break; case 3: //back off of the balance stone if (robot.driveForward(true, .10, .35)) { autoTimer = futureTime(3f); robot.resetMotors(true); autoState++; } break; case 4: //re-orient the robot autoState++; break; case 5: //drive to proper crypto box column based on vuforia target autoState++; break; case 6: // turn towards crypto box autoState++; break; case 7: //drive to crypto box autoState++; break; case 8: //deposit glyph autoState++; break; case 9: //back away from crypto box autoState++; break; } }
Date | October 29, 2017