Refactor year-agnostic catapult code to frc971
This breaks up the y2022 catapult code into multiple files and moves
them into the frc971 folder. Year-specific parameters are now
provided via the constructors, and the goal message is moved into
frc971 as well.
Signed-off-by: Niko Sohmers <nikolai@sohmers.com>
Change-Id: I4ea720ae62a7c6c229d6c24a1f08edd7bc5b9728
diff --git a/frc971/control_loops/state_feedback_loop.h b/frc971/control_loops/state_feedback_loop.h
index 3c90434..988aaa9 100644
--- a/frc971/control_loops/state_feedback_loop.h
+++ b/frc971/control_loops/state_feedback_loop.h
@@ -256,8 +256,12 @@
static const int kNumInputs = number_of_inputs;
private:
- Eigen::Matrix<Scalar, number_of_states, 1> X_;
- Eigen::Matrix<Scalar, number_of_outputs, 1> Y_;
+ // X_ and Y_ must be explicitly initialized to avoid having gcc complain about
+ // uninitialized values when using the move constructor.
+ Eigen::Matrix<Scalar, number_of_states, 1> X_ =
+ Eigen::Matrix<Scalar, number_of_states, 1>::Zero();
+ Eigen::Matrix<Scalar, number_of_outputs, 1> Y_ =
+ Eigen::Matrix<Scalar, number_of_outputs, 1>::Zero();
Eigen::Matrix<Scalar, number_of_inputs, Eigen::Dynamic> last_U_;
::std::vector<::std::unique_ptr<StateFeedbackPlantCoefficients<