[hal] Change usage reporting to string-based (#7763)

This commit is contained in:
Peter Johnson
2025-02-07 12:37:23 -08:00
committed by GitHub
parent bfff891b5c
commit 764ada9b66
188 changed files with 637 additions and 2298 deletions

View File

@@ -41,8 +41,8 @@ class WPILIB_DLLEXPORT DifferentialDriveKinematics
constexpr explicit DifferentialDriveKinematics(units::meter_t trackWidth)
: trackWidth(trackWidth) {
if (!std::is_constant_evaluated()) {
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kKinematics_DifferentialDrive, 1);
wpi::math::MathSharedStore::ReportUsage("DifferentialDriveKinematics",
"");
}
}

View File

@@ -66,8 +66,7 @@ class WPILIB_DLLEXPORT MecanumDriveKinematics
SetInverseKinematics(frontLeftWheel, frontRightWheel, rearLeftWheel,
rearRightWheel);
m_forwardKinematics = m_inverseKinematics.householderQr();
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kKinematics_MecanumDrive, 1);
wpi::math::MathSharedStore::ReportUsage("MecanumDriveKinematics", "");
}
MecanumDriveKinematics(const MecanumDriveKinematics&) = default;

View File

@@ -78,8 +78,7 @@ class SwerveDriveKinematics
m_forwardKinematics = m_inverseKinematics.householderQr();
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kKinematics_SwerveDrive, 1);
wpi::math::MathSharedStore::ReportUsage("SwerveDriveKinematics", "");
}
explicit SwerveDriveKinematics(
@@ -95,8 +94,7 @@ class SwerveDriveKinematics
m_forwardKinematics = m_inverseKinematics.householderQr();
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kKinematics_SwerveDrive, 1);
wpi::math::MathSharedStore::ReportUsage("Kinematics_SwerveDrive", "");
}
SwerveDriveKinematics(const SwerveDriveKinematics&) = default;

View File

@@ -48,8 +48,7 @@ class SwerveDriveOdometry
: SwerveDriveOdometry::Odometry(m_kinematicsImpl, gyroAngle,
modulePositions, initialPose),
m_kinematicsImpl(kinematics) {
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kOdometry_SwerveDrive, 1);
wpi::math::MathSharedStore::ReportUsage("SwerveDriveOdometry", "");
}
private:

View File

@@ -53,8 +53,7 @@ class SwerveDriveOdometry3d
: SwerveDriveOdometry3d::Odometry3d(m_kinematicsImpl, gyroAngle,
modulePositions, initialPose),
m_kinematicsImpl(kinematics) {
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kOdometry_SwerveDrive, 1);
wpi::math::MathSharedStore::ReportUsage("SwerveDriveOdometry3d", "");
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop