mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[wpimath] Add extern templates for common cases
This helps reduce compile times and memory usage.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
#include <wpi/array.h>
|
||||
#include <wpi/timestamp.h>
|
||||
|
||||
@@ -320,4 +321,7 @@ class SwerveDrivePoseEstimator {
|
||||
}
|
||||
};
|
||||
|
||||
extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT)
|
||||
SwerveDrivePoseEstimator<4>;
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
#include <wpi/array.h>
|
||||
|
||||
#include "Eigen/Cholesky"
|
||||
@@ -425,4 +426,9 @@ class UnscentedKalmanFilter {
|
||||
MerweScaledSigmaPoints<States> m_pts;
|
||||
};
|
||||
|
||||
extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT)
|
||||
UnscentedKalmanFilter<3, 3, 1>;
|
||||
extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT)
|
||||
UnscentedKalmanFilter<5, 3, 3>;
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
#include <wpi/array.h>
|
||||
|
||||
#include "Eigen/Core"
|
||||
@@ -185,6 +186,10 @@ class SwerveDriveKinematics {
|
||||
|
||||
mutable Translation2d m_previousCoR;
|
||||
};
|
||||
|
||||
extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT)
|
||||
SwerveDriveKinematics<4>;
|
||||
|
||||
} // namespace frc
|
||||
|
||||
#include "SwerveDriveKinematics.inc"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <cstddef>
|
||||
#include <ctime>
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
#include <wpi/timestamp.h>
|
||||
|
||||
#include "SwerveDriveKinematics.h"
|
||||
@@ -112,6 +113,9 @@ class SwerveDriveOdometry {
|
||||
Rotation2d m_gyroOffset;
|
||||
};
|
||||
|
||||
extern template class EXPORT_TEMPLATE_DECLARE(WPILIB_DLLEXPORT)
|
||||
SwerveDriveOdometry<4>;
|
||||
|
||||
} // namespace frc
|
||||
|
||||
#include "SwerveDriveOdometry.inc"
|
||||
|
||||
Reference in New Issue
Block a user