mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpimath] Add usage reporting for state-space classes (#8453)
- LinearQuadraticRegulator - Kalman filters - Pose estimators - LinearSystemLoop Fixes #2925.
This commit is contained in:
@@ -135,6 +135,8 @@ class LinearQuadraticRegulator {
|
||||
}
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kController_LinearQuadraticRegulator, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,6 +196,8 @@ class LinearQuadraticRegulator {
|
||||
}
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kController_LinearQuadraticRegulator, 1);
|
||||
}
|
||||
|
||||
LinearQuadraticRegulator(LinearQuadraticRegulator&&) = default;
|
||||
|
||||
@@ -137,6 +137,8 @@ class ExtendedKalmanFilter {
|
||||
m_initP = StateMatrix::Zero();
|
||||
}
|
||||
m_P = m_initP;
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,6 +223,8 @@ class ExtendedKalmanFilter {
|
||||
m_initP = StateMatrix::Zero();
|
||||
}
|
||||
m_P = m_initP;
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,6 +118,8 @@ class KalmanFilter {
|
||||
}
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,6 +70,8 @@ class WPILIB_DLLEXPORT PoseEstimator {
|
||||
}
|
||||
|
||||
SetVisionMeasurementStdDevs(visionMeasurementStdDevs);
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_PoseEstimator, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,6 +76,8 @@ class WPILIB_DLLEXPORT PoseEstimator3d {
|
||||
}
|
||||
|
||||
SetVisionMeasurementStdDevs(visionMeasurementStdDevs);
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_PoseEstimator3d, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -149,6 +149,8 @@ class SteadyStateKalmanFilter {
|
||||
}
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 4);
|
||||
}
|
||||
|
||||
SteadyStateKalmanFilter(SteadyStateKalmanFilter&&) = default;
|
||||
|
||||
@@ -107,6 +107,8 @@ class UnscentedKalmanFilter {
|
||||
m_dt = dt;
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,6 +168,8 @@ class UnscentedKalmanFilter {
|
||||
m_dt = dt;
|
||||
|
||||
Reset();
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kEstimator_KalmanFilter, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,6 +129,8 @@ class LinearSystemLoop {
|
||||
m_clampFunc(clampFunction) {
|
||||
m_nextR.setZero();
|
||||
Reset(m_nextR);
|
||||
wpi::math::MathSharedStore::ReportUsage(
|
||||
wpi::math::MathUsageId::kSystem_LinearSystemLoop, 1);
|
||||
}
|
||||
|
||||
LinearSystemLoop(LinearSystemLoop&&) = default;
|
||||
|
||||
@@ -26,6 +26,11 @@ enum class MathUsageId {
|
||||
kController_ProfiledPIDController,
|
||||
kController_BangBangController,
|
||||
kTrajectory_PathWeaver,
|
||||
kController_LinearQuadraticRegulator,
|
||||
kEstimator_KalmanFilter,
|
||||
kEstimator_PoseEstimator,
|
||||
kEstimator_PoseEstimator3d,
|
||||
kSystem_LinearSystemLoop,
|
||||
};
|
||||
|
||||
class WPILIB_DLLEXPORT MathShared {
|
||||
|
||||
Reference in New Issue
Block a user