Neaten up drivetrain queue comments.
Removes a lot of repetition.
Change-Id: Ib060fd43ae079c162c6d758bd0273739d686efab
diff --git a/frc971/control_loops/drivetrain/drivetrain.q b/frc971/control_loops/drivetrain/drivetrain.q
index b4a71ec..7fa91b9 100644
--- a/frc971/control_loops/drivetrain/drivetrain.q
+++ b/frc971/control_loops/drivetrain/drivetrain.q
@@ -6,33 +6,30 @@
struct GearLogging {
// Which controller is being used.
int8_t controller_index;
- // Whether the left loop is the high-gear one.
+
+ // Whether each loop for the drivetrain sides is the high-gear one.
bool left_loop_high;
- // Whether the right loop is the high-gear one.
bool right_loop_high;
- // The state of the left shifter.
+
+ // The states of each drivetrain shifter.
int8_t left_state;
- // The state of the right shifter.
int8_t right_state;
};
// For logging information about the state of the shifters.
struct CIMLogging {
- // Whether the code thinks the left side is currently in gear.
+ // Whether the code thinks each drivetrain side is currently in gear.
bool left_in_gear;
- // Whether the code thinks the right side is currently in gear.
bool right_in_gear;
- // The velocity in rad/s (positive forward) the code thinks the left motor
- // is currently spinning at.
+
+ // The angular velocities (in rad/s, positive forward) the code thinks motors
+ // on each side of the drivetrain are moving at.
double left_motor_speed;
- // The velocity in rad/s (positive forward) the code thinks the right motor
- // is currently spinning at.
double right_motor_speed;
- // The velocity estimate for the left side of the robot in m/s (positive
- // forward) used for shifting.
+
+ // The velocity estimates for each drivetrain side of the robot (in m/s,
+ // positive forward) that can be used for shifting.
double left_velocity;
- // The velocity estimate for the right side of the robot in m/s (positive
- // forward) used for shifting.
double right_velocity;
};
@@ -43,43 +40,46 @@
// Position of the steering wheel (positive = turning left when going
// forwards).
double steering;
+
// Position of the throttle (positive forwards).
double throttle;
+
// True to shift into high, false to shift into low.
bool highgear;
+
// True to activate quickturn.
bool quickturn;
+
// True to have the closed-loop controller take over.
bool control_loop_driving;
- // Position goal for the left side in meters when the closed-loop controller
- // is active.
+
+ // Position goals for each drivetrain side (in meters) when the
+ // closed-loop controller is active.
double left_goal;
- // Velocity goal for the left side in m/s when the closed-loop controller
- // is active.
- double left_velocity_goal;
- // Position goal for the right side in meters when the closed-loop
- // controller is active.
double right_goal;
- // Velocity goal for the right side in m/s when the closed-loop controller
- // is active.
+
+ // Velocity goal for each drivetrain side (in m/s) when the closed-loop
+ // controller is active.
+ double left_velocity_goal;
double right_velocity_goal;
};
message Position {
- // Relative position of the left side in meters.
+ // Relative position of each drivetrain side (in meters).
double left_encoder;
- // Relative position of the right side in meters.
double right_encoder;
- // The speed in m/s of the left side from the most recent encoder pulse,
- // or 0 if there was no edge within the last 5ms.
+
+ // The speed in m/s of each drivetrain side from the most recent encoder
+ // pulse, or 0 if there was no edge within the last 5ms.
double left_speed;
- // The speed in m/s of the right side from the most recent encoder pulse,
- // or 0 if there was no edge within the last 5ms.
double right_speed;
- // Position of the left shifter (smaller = towards low gear).
+
+ // Position of each drivetrain shifter, scaled from 0.0 to 1.0 where smaller
+ // is towards low gear.
double left_shifter_position;
- // Position of the right shifter (smaller = towards low gear).
double right_shifter_position;
+
+ // Raw analog voltages of each shifter hall effect for logging purposes.
double low_left_hall;
double high_left_hall;
double low_right_hall;
@@ -87,32 +87,31 @@
};
message Output {
- // Voltage to send to the left motor(s).
+ // Voltage to send to motor(s) on either side of the drivetrain.
double left_voltage;
- // Voltage to send to the right motor(s).
double right_voltage;
- // True to set the left shifter piston for high gear.
+
+ // Whether to set each shifter piston to high gear.
bool left_high;
- // True to set the right shifter piston for high gear.
bool right_high;
};
message Status {
// Estimated speed of the center of the robot in m/s (positive forwards).
double robot_speed;
- // Estimated relative position of the left side in meters.
+
+ // Estimated relative position of each drivetrain side (in meters).
double filtered_left_position;
- // Estimated relative position of the right side in meters.
double filtered_right_position;
- // Estimated velocity of the left side in m/s.
+
+ // Estimated velocity of each drivetrain side (in m/s).
double filtered_left_velocity;
- // Estimated velocity of the left side in m/s.
double filtered_right_velocity;
- // The voltage we wanted to send to the left side last cycle.
+ // The voltage we wanted to send to each drivetrain side last cycle.
double uncapped_left_voltage;
- // The voltage we wanted to send to the right side last cycle.
double uncapped_right_voltage;
+
// True if the output voltage was capped last cycle.
bool output_was_capped;
};