mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[hal] Change usage reporting to string-based (#7763)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/UsageReporting.h>
|
||||
#include <wpi/sendable/SendableBuilder.h>
|
||||
#include <wpi/sendable/SendableRegistry.h>
|
||||
|
||||
@@ -42,8 +42,7 @@ void DifferentialDrive::ArcadeDrive(double xSpeed, double zRotation,
|
||||
bool squareInputs) {
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive,
|
||||
HALUsageReporting::kRobotDrive2_DifferentialArcade, 2);
|
||||
HAL_ReportUsage("RobotDrive", "DifferentialArcade");
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -65,8 +64,7 @@ void DifferentialDrive::CurvatureDrive(double xSpeed, double zRotation,
|
||||
bool allowTurnInPlace) {
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive,
|
||||
HALUsageReporting::kRobotDrive2_DifferentialCurvature, 2);
|
||||
HAL_ReportUsage("RobotDrive", "DifferentialCurvature");
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -88,8 +86,7 @@ void DifferentialDrive::TankDrive(double leftSpeed, double rightSpeed,
|
||||
bool squareInputs) {
|
||||
static bool reported = false;
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive,
|
||||
HALUsageReporting::kRobotDrive2_DifferentialTank, 2);
|
||||
HAL_ReportUsage("RobotDrive", "DifferentialTank");
|
||||
reported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/UsageReporting.h>
|
||||
#include <wpi/sendable/SendableBuilder.h>
|
||||
#include <wpi/sendable/SendableRegistry.h>
|
||||
|
||||
@@ -52,8 +52,7 @@ MecanumDrive::MecanumDrive(std::function<void(double)> frontLeftMotor,
|
||||
void MecanumDrive::DriveCartesian(double xSpeed, double ySpeed,
|
||||
double zRotation, Rotation2d gyroAngle) {
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive,
|
||||
HALUsageReporting::kRobotDrive2_MecanumCartesian, 4);
|
||||
HAL_ReportUsage("RobotDrive", "MecanumCartesian");
|
||||
reported = true;
|
||||
}
|
||||
|
||||
@@ -79,8 +78,7 @@ void MecanumDrive::DriveCartesian(double xSpeed, double ySpeed,
|
||||
void MecanumDrive::DrivePolar(double magnitude, Rotation2d angle,
|
||||
double zRotation) {
|
||||
if (!reported) {
|
||||
HAL_Report(HALUsageReporting::kResourceType_RobotDrive,
|
||||
HALUsageReporting::kRobotDrive2_MecanumPolar, 4);
|
||||
HAL_ReportUsage("RobotDrive", "MecanumPolar");
|
||||
reported = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
|
||||
#include "frc/motorcontrol/MotorController.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
Reference in New Issue
Block a user