Description:
In this Lab you will develop four Autonomous Routines to Play the FREIGHT FRENZY Game. The routines must accomplish the objectives within 30 seconds. The routines are listed below:
Red Left (Auto_Red_Left.java)
Robot places block in lower shelf of team shipping unit
Robot moves to carousel and spins duck
Robot parks in team storage area
Red Right (Auto_Red_Right.java)
Robot places block in lower shelf of team shipping unit
Robot moves to warehouse
Blue Left (Auto_Blue_Left.java)
Robot places block in lower shelf of team shipping unit
Robot moves to warehouse
Blue Right(Auto_Blue_Right.java)
Robot places block in lower shelf of team shipping unit
Robot moves to carousel and spins duck
Robot parks in team storage area
Requirements:
Develop code, test, and run the Autonomous routines as described above. Your group must accomplish at least two of the four routines.
Take pictures of your robot doing the autonomous routines (at least two)
Place pictures on your weekly Google Slide Deck and write sentences summarizing your autonomous routines.
Resources:
To open and close the "hands" (servos), use the following commands:
robot.rightHand.setPosition(0); // Moves Right Servo to far position
robot.rightHand.setPosition(1); // Moves Right Servo to near position
robot.leftHand.setPosition(0); // Left Servo to far position
robot.leftHand.setPosition(1); // Left Servo to near position
// You can use values from 0.0 to 1.0 for Servos
To raise and lower the Arm, use these commands:
robot.leftArmMotorDeg(0.5, 90, 5); // Moves Arm 90 degrees at 0.5 power
Be careful with this command. You can get the arm stuck in awkward positions. I suggest you test this command with the Arm straight up to get and idea of how far the Arm will move.
To move the Spinner, try this command sequence:
robot.rightArm.setPower(0.8); // Starts motor
delay(5); // Waits 5 seconds
robot.rightArm.setPower(0); // Stops Motor
Example Command Sequence (Start on line 44 of the Auto_Red_Right.java)
// Start at Line 44
robot.moveDistance(24, 0.5);
robot.leftArmMotorDeg(0.6, 45, 5); // Move Arm Up
robot.rightHand.setPosition(0); // Open Hand
robot.leftHand.setPosition(1); // Open Hand
delay(2); // Wait 2 seconds
robot.turnAngle(90, 0.5);
robot.moveDistance(48, 0.5);
The above code might need to be adjusted to work exactly . This example is meant to be a guide.