Added position control and profiling to drivetrain.
Change-Id: I09ad01c46b23f1c7b6e8530bc10b03a733245b95
diff --git a/y2015/control_loops/drivetrain/drivetrain.cc b/y2015/control_loops/drivetrain/drivetrain.cc
index bc3fa21..b5eb83a 100644
--- a/y2015/control_loops/drivetrain/drivetrain.cc
+++ b/y2015/control_loops/drivetrain/drivetrain.cc
@@ -752,11 +752,11 @@
// set the output status of the control loop state
if (status) {
status->robot_speed = dt_closedloop.GetEstimatedRobotSpeed();
- status->filtered_left_position = dt_closedloop.GetEstimatedLeftEncoder();
- status->filtered_right_position = dt_closedloop.GetEstimatedRightEncoder();
+ status->estimated_left_position = dt_closedloop.GetEstimatedLeftEncoder();
+ status->estimated_right_position = dt_closedloop.GetEstimatedRightEncoder();
- status->filtered_left_velocity = dt_closedloop.loop().X_hat(1, 0);
- status->filtered_right_velocity = dt_closedloop.loop().X_hat(3, 0);
+ status->estimated_left_velocity = dt_closedloop.loop().X_hat(1, 0);
+ status->estimated_right_velocity = dt_closedloop.loop().X_hat(3, 0);
status->output_was_capped = dt_closedloop.OutputWasCapped();
status->uncapped_left_voltage = dt_closedloop.loop().U_uncapped(0, 0);
status->uncapped_right_voltage = dt_closedloop.loop().U_uncapped(1, 0);
diff --git a/y2015/control_loops/drivetrain/drivetrain.q b/y2015/control_loops/drivetrain/drivetrain.q
index 824688c..3edd33f 100644
--- a/y2015/control_loops/drivetrain/drivetrain.q
+++ b/y2015/control_loops/drivetrain/drivetrain.q
@@ -97,13 +97,13 @@
// 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.
- double filtered_left_position;
+ double estimated_left_position;
// Estimated relative position of the right side in meters.
- double filtered_right_position;
+ double estimated_right_position;
// Estimated velocity of the left side in m/s.
- double filtered_left_velocity;
+ double estimated_left_velocity;
// Estimated velocity of the right side in m/s.
- double filtered_right_velocity;
+ double estimated_right_velocity;
// The voltage we wanted to send to the left side last cycle.
double uncapped_left_voltage;