mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Add usage reporting for many new things (#2184)
- new CommandScheduler - kinematics and odometry classes - new PIDController - ProfiledPIDController - TrapezoidProfile (reported in Constraints class) Also update instances.txt to match latest NI version. One side effect is that a couple of classes are no longer constexpr.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <units/units.h>
|
||||
|
||||
#include "frc/kinematics/ChassisSpeeds.h"
|
||||
@@ -31,8 +32,11 @@ class DifferentialDriveKinematics {
|
||||
* empirical value may be larger than the physical measured value due to
|
||||
* scrubbing effects.
|
||||
*/
|
||||
constexpr explicit DifferentialDriveKinematics(units::meter_t trackWidth)
|
||||
: trackWidth(trackWidth) {}
|
||||
explicit DifferentialDriveKinematics(units::meter_t trackWidth)
|
||||
: trackWidth(trackWidth) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_Kinematics,
|
||||
HALUsageReporting::kKinematics_DifferentialDrive);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a chassis speed from left and right component velocities using
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/QR>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
|
||||
#include "frc/geometry/Translation2d.h"
|
||||
#include "frc/kinematics/ChassisSpeeds.h"
|
||||
@@ -63,6 +64,8 @@ class MecanumDriveKinematics {
|
||||
SetInverseKinematics(frontLeftWheel, frontRightWheel, rearLeftWheel,
|
||||
rearRightWheel);
|
||||
m_forwardKinematics = m_inverseKinematics.householderQr();
|
||||
HAL_Report(HALUsageReporting::kResourceType_Kinematics,
|
||||
HALUsageReporting::kKinematics_MecanumDrive);
|
||||
}
|
||||
|
||||
MecanumDriveKinematics(const MecanumDriveKinematics&) = default;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/QR>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <units/units.h>
|
||||
|
||||
#include "frc/geometry/Rotation2d.h"
|
||||
@@ -71,6 +72,9 @@ class SwerveDriveKinematics {
|
||||
}
|
||||
|
||||
m_forwardKinematics = m_inverseKinematics.householderQr();
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_Kinematics,
|
||||
HALUsageReporting::kKinematics_SwerveDrive);
|
||||
}
|
||||
|
||||
SwerveDriveKinematics(const SwerveDriveKinematics&) = default;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
|
||||
namespace frc {
|
||||
template <size_t NumModules>
|
||||
SwerveDriveOdometry<NumModules>::SwerveDriveOdometry(
|
||||
@@ -15,6 +17,8 @@ SwerveDriveOdometry<NumModules>::SwerveDriveOdometry(
|
||||
: m_kinematics(kinematics), m_pose(initialPose) {
|
||||
m_previousAngle = m_pose.Rotation();
|
||||
m_gyroOffset = m_pose.Rotation() - gyroAngle;
|
||||
HAL_Report(HALUsageReporting::kResourceType_Odometry,
|
||||
HALUsageReporting::kOdometry_SwerveDrive);
|
||||
}
|
||||
|
||||
template <size_t NumModules>
|
||||
|
||||
Reference in New Issue
Block a user