-
Notifications
You must be signed in to change notification settings - Fork 0
Z Code Documentation 2021
This is the coding documentation for the Truckee Robotics Team.
The two scripts, BruteforceRed.java and BruteforceBlue.java, use a move by time method to achieve goals. The reason why it’s called Bruteforce is because the robot does not know what its location is.
The following functions are all of the self-coded functions used in the Bruteforce scripts
Sets the wheels on the robot to the correct power calculations for a mecanum wheel robot. The parameters are based on a controller layout. For example, y is the left joystick y if you were driving this robot with a controller.
Parameters: double y, double x, double rx.
Usage
//move forward
calcPower(1, 0, 0);
//move backwords
calcPower(-1, 0, 0);
//strafe left
calcPower(0, -1, 0);
//spin right
calcPower(0, 0, 1);
BruteforceRed.java will drive backward for 0.3 seconds, strafe to the right for 2.5 seconds, turn on the spinning wheel for 3 seconds, drive back into the storage box for 1.5 seconds, finally all motors will be turned off. All movements are done with motors at half speed.
BruteforceBlue.java will strafe to the left for 0.5 seconds, drive forward for 2.6 seconds, turn on the spinning wheel for 3 seconds, pause for 0.5 seconds, strafe to the left into the storage box for 1.5 seconds, and finally, all motors will have the power set to 0.
The robot script (codename: big boi): bigboi.java uses a controller to control a mecanum wheel robot.
Controler 1
Button | Action |
---|---|
Left joystick y | move forward/backward |
Left joystick x | strafe left/right |
Right joystick x | spin left/right |
Left bumper | spin wheel |
Right bumper | spin wheel backward |
Controler 2:
Button | Action |
---|---|
Hold X | intake takes in |
Hold B | intake outputs |
Dpad up | linear slide moves up |
Dpad down | linear slide moves down |
There are no functions defined in this script.
Truckee Robotics Documentation - Team 20285