Factored out the profiled subsystem status.
Change-Id: I03df9788bbe98d12e80dd70db8cd09d9b3651724
diff --git a/y2017/control_loops/superstructure/superstructure.q b/y2017/control_loops/superstructure/superstructure.q
index 4f36449..4f854b7 100644
--- a/y2017/control_loops/superstructure/superstructure.q
+++ b/y2017/control_loops/superstructure/superstructure.q
@@ -1,36 +1,10 @@
package y2017.control_loops;
import "aos/common/controls/control_loops.q";
-import "frc971/control_loops/control_loops.q";
-
-struct JointState {
- // Position of the joint.
- float position;
- // Velocity of the joint in units/second.
- float velocity;
- // Profiled goal position of the joint.
- float goal_position;
- // Profiled goal velocity of the joint in units/second.
- float goal_velocity;
- // Unprofiled goal position from absoulte zero of the joint.
- float unprofiled_goal_position;
- // Unprofiled goal velocity of the joint in units/second.
- float unprofiled_goal_velocity;
-
- // The estimated voltage error.
- float voltage_error;
-
- // The calculated velocity with delta x/delta t
- float calculated_velocity;
-
- // Components of the control loop output
- float position_power;
- float velocity_power;
- float feedforwards_power;
-
- // State of the estimator.
- .frc971.EstimatorState estimator_state;
-};
+import "frc971/control_loops/profiled_subsystem.q";
+// TODO(austin): Add this back in when the queue compiler supports diamond
+// inheritance.
+//import "frc971/control_loops/control_loops.q";
struct IntakeGoal {
// Zero on the intake is when the intake is retracted inside the robot,
@@ -76,17 +50,6 @@
double angular_velocity;
};
-struct IntakeStatus {
- // Is it zeroed?
- bool zeroed;
-
- // Estimated position and velocities.
- JointState joint_state;
-
- // If true, we have aborted.
- bool estopped;
-};
-
struct SerializerStatus {
// The current average velocity in radians/second.
double avg_angular_velocity;
@@ -102,28 +65,6 @@
bool estopped;
};
-struct TurretStatus {
- // Is the turret zeroed?
- bool zeroed;
-
- // If true, we have aborted.
- bool estopped;
-
- // Estimate angles and angular velocities.
- JointState turret;
-};
-
-struct HoodStatus {
- // Is the turret zeroed?
- bool zeroed;
-
- // If true, we have aborted.
- bool estopped;
-
- // Estimate angles and angular velocities.
- JointState hood;
-};
-
struct ShooterStatus {
// The current average velocity in radians/second.
double avg_angular_velocity;
@@ -158,10 +99,10 @@
bool estopped;
// Each subsystems status.
- IntakeStatus intake;
+ .frc971.control_loops.ProfiledJointStatus intake;
+ .frc971.control_loops.ProfiledJointStatus turret;
+ .frc971.control_loops.ProfiledJointStatus hood;
SerializerStatus serializer;
- TurretStatus turret;
- HoodStatus hood;
ShooterStatus shooter;
};