diff --git a/wpimath/src/main/native/cpp/system/LinearSystemLoop.cpp b/wpimath/src/main/native/cpp/system/LinearSystemLoop.cpp new file mode 100644 index 0000000000..16979d911e --- /dev/null +++ b/wpimath/src/main/native/cpp/system/LinearSystemLoop.cpp @@ -0,0 +1,14 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "frc/system/LinearSystemLoop.h" + +namespace frc { + +template class EXPORT_TEMPLATE_DEFINE(WPILIB_DLLEXPORT) + LinearSystemLoop<1, 1, 1>; +template class EXPORT_TEMPLATE_DEFINE(WPILIB_DLLEXPORT) + LinearSystemLoop<2, 1, 1>; + +} // namespace frc diff --git a/wpimath/src/main/native/include/frc/system/LinearSystemLoop.h b/wpimath/src/main/native/include/frc/system/LinearSystemLoop.h index dd95cf5d1b..1300a82a02 100644 --- a/wpimath/src/main/native/include/frc/system/LinearSystemLoop.h +++ b/wpimath/src/main/native/include/frc/system/LinearSystemLoop.h @@ -4,6 +4,8 @@ #pragma once +#include + #include "frc/EigenCore.h" #include "frc/controller/LinearPlantInversionFeedforward.h" #include "frc/controller/LinearQuadraticRegulator.h" @@ -210,7 +212,7 @@ class LinearSystemLoop { * Return the observer used internally. */ const KalmanFilter& Observer() const { - return m_observer; + return *m_observer; } /** @@ -282,4 +284,9 @@ class LinearSystemLoop { static constexpr int kOutputs = Outputs; }; +extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT) + LinearSystemLoop<1, 1, 1>; +extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT) + LinearSystemLoop<2, 1, 1>; + } // namespace frc