Refactored polydrivetrain.
Change-Id: I1489f8d3dd97d3b26a98e3435611d4eb485aa3f8
diff --git a/y2014/control_loops/drivetrain/polydrivetrain.h b/y2014/control_loops/drivetrain/polydrivetrain.h
index 864eec8..d57ff4c 100644
--- a/y2014/control_loops/drivetrain/polydrivetrain.h
+++ b/y2014/control_loops/drivetrain/polydrivetrain.h
@@ -38,11 +38,18 @@
static bool IsInGear(Gear gear) { return gear == LOW || gear == HIGH; }
+ // Computes the speed of the motor given the hall effect position and the
+ // speed of the robot.
static double MotorSpeed(const constants::ShifterHallEffect &hall_effect,
double shifter_position, double velocity);
- Gear ComputeGear(const constants::ShifterHallEffect &hall_effect,
- double velocity, Gear current);
+ // Computes the states of the shifters for the left and right drivetrain sides
+ // given a requested state.
+ void UpdateGears(Gear requested_gear);
+
+ // Computes the next state of a shifter given the current state and the
+ // requested state.
+ static Gear UpdateSingleGear(Gear requested_gear, Gear current_gear);
void SetGoal(double wheel, double throttle, bool quickturn, bool highgear);