|
| 1 | +/** |
| 2 | + * @file controller.cpp |
| 3 | + * @brief This file contains the implementation of the controller functionalities for the robot. |
| 4 | + * |
| 5 | + * The controller functionalities include handling the main and partner controllers, switching control between them, |
| 6 | + * and providing feedback to the driver about the state of the robot and its components. |
| 7 | + * |
| 8 | + |
| 9 | +## Main Controller Controls |
| 10 | + |
| 11 | +Based on the type of drive as well as the program orientation of the robot, the joysticks on the main controller are used: |
| 12 | + |
| 13 | + |
| 14 | +- **Left Joystick (Vertical Axis)**: Controls the forward and backward movement of the robot. |
| 15 | +- **Right Joystick (Horizontal Axis)**: Controls the left and right movement (turning) of the robot. |
| 16 | +--- |
| 17 | + |
| 18 | +- **R1 Button**: Activates the intake motor to push out objects. |
| 19 | +- **L1 Button**: Activates the intake motor to pull in objects. |
| 20 | + |
| 21 | +--- |
| 22 | +- **Digital Up Button**: Toggles the drivetrain orientation (forward or backward). |
| 23 | +- **Digital Down Button**: Executes the autonomous routine during user control. |
| 24 | +- **Digital Right Button**: Toggles the drivetrain reversal. |
| 25 | +- **Digital Left Button**: Switches control between the main and partner controllers if the partner controller is connected. |
| 26 | + |
| 27 | +--- |
| 28 | +- **Digital B Button**: Toggles the state of the MoGo mech between grabbing and not grabbing. |
| 29 | +- **Digital Y Button**: This button toggles the state of the sweeper between active or retracted. |
| 30 | +- ***NOT IMPLEMENTED -* Digital A Button**: This button controls whether the hang is active. |
| 31 | +--- |
| 32 | + |
| 33 | +- **R2 Button**: Pulls the Lady Brown down to its loading zone. |
| 34 | +- **L2 Button**: Lifts the Lady Brown towards the neutral wall stake. |
| 35 | + |
| 36 | + |
| 37 | +## Partner Controller Controls |
| 38 | +- **Digital Y Button**: Sends a rumble pattern "..-" to the main controller. |
| 39 | +- **Digital X Button**: Sends a rumble pattern ".-." to the main controller. |
| 40 | +- **Digital Up Button**: Sends a rumble pattern "-.." to the main controller. |
| 41 | +- **Digital Right Button**: Sends a rumble pattern "-.-" to the main controller. |
| 42 | +- **Digital R1 Button**: Sends a rumble pattern "..." to the main controller to notify of only 15 seconds remaining. |
| 43 | + |
| 44 | + |
| 45 | +## Additional Functionalities |
| 46 | +- **Motor Disconnect Notification**: The main controller provides haptic and visual feedback if a motor disconnects or reconnects. |
| 47 | + - Three short pulses indicate a motor disconnect. |
| 48 | + - One long pulse indicates a motor reconnect. |
| 49 | + - The LCD screen on the controller displays the current disconnected motors. |
0 commit comments