Skip to content

Commit 196802d

Browse files
authored
Merge pull request #60 from calhighrobotics/docs/issue-55/controller-documentation
docs/issue 55/controller documentation
2 parents 0ec2bba + 2d48002 commit 196802d

File tree

5 files changed

+55
-40
lines changed

5 files changed

+55
-40
lines changed

docs/TASKS.md

-35
This file was deleted.

docs/controller_bindings.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.

docs/style_guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Style Guide
1+
# Style Guide - Code
22

33
### This style guide is meant to brief contributors on the conventions utilized within this codebase.
44

src/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ void opcontrol() {
142142
}
143143
// Checks for drivetrain reversal - Changes conditions in a value handler function in the drivetrain class
144144
if (controller.get_digital_new_press(pros::E_CONTROLLER_DIGITAL_RIGHT)) {
145+
//isReversed is static, it is changed for the global state.
145146
Drivetrain::isReversed = !Drivetrain::isReversed;
146-
// Output the current drive mode to the controller screen
147147

148+
// Output the current drive mode to the controller screen
148149
controller.print(0, 0, "reversal: %d", Drivetrain::isReversed);
149150
}
150151

src/subsystems/intake.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Intake::Intake() {
1616
void Intake::run() {
1717

1818
if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_R1)) {
19-
IntakeMotor.move_velocity(-FASTER_VELOCITY);
20-
HookMotor.move_velocity(-SLOWER_VELOCITY);
21-
} else if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) {
2219
IntakeMotor.move_velocity(FASTER_VELOCITY);
2320
HookMotor.move_velocity(SLOWER_VELOCITY);
21+
} else if (controller.get_digital(pros::E_CONTROLLER_DIGITAL_L1)) {
22+
IntakeMotor.move_velocity(-FASTER_VELOCITY);
23+
HookMotor.move_velocity(-SLOWER_VELOCITY);
2424
} else {
2525
IntakeMotor.brake();
2626
HookMotor.brake();

0 commit comments

Comments
 (0)