[hal, wpilib] Remove analog accumulator and analog gyro (#7697)

The 2 high level classes were temporarily kept to keep the examples compiling. We will remove those when we have the interface into the built in IMU.
This commit is contained in:
Thad House
2025-01-17 12:58:31 -08:00
committed by GitHub
parent 92f0a3c961
commit f80874dd4b
76 changed files with 33 additions and 3886 deletions

View File

@@ -1,121 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <memory>
#include "frc/simulation/CallbackStore.h"
namespace frc {
class AnalogGyro;
namespace sim {
/**
* Class to control a simulated analog gyro.
*/
class AnalogGyroSim {
public:
/**
* Constructs from an AnalogGyro object.
*
* @param gyro AnalogGyro to simulate
*/
explicit AnalogGyroSim(const AnalogGyro& gyro);
/**
* Constructs from an analog input channel number.
*
* @param channel Channel number
*/
explicit AnalogGyroSim(int channel);
/**
* Register a callback on the angle.
*
* @param callback the callback that will be called whenever the angle changes
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAngleCallback(NotifyCallback callback,
bool initialNotify);
/**
* Get the current angle of the gyro.
*
* @return the angle measured by the gyro
*/
double GetAngle() const;
/**
* Change the angle measured by the gyro.
*
* @param angle the new value
*/
void SetAngle(double angle);
/**
* Register a callback on the rate.
*
* @param callback the callback that will be called whenever the rate changes
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterRateCallback(NotifyCallback callback,
bool initialNotify);
/**
* Get the rate of angle change on this gyro.
*
* @return the rate
*/
double GetRate() const;
/**
* Change the rate of the gyro.
*
* @param rate the new rate
*/
void SetRate(double rate);
/**
* Register a callback on whether the gyro is initialized.
*
* @param callback the callback that will be called whenever the gyro is
* initialized
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterInitializedCallback(
NotifyCallback callback, bool initialNotify);
/**
* Check if the gyro is initialized.
*
* @return true if initialized
*/
bool GetInitialized() const;
/**
* Set whether this gyro is initialized.
*
* @param initialized the new value
*/
void SetInitialized(bool initialized);
/**
* Reset all simulation data for this object.
*/
void ResetData();
private:
int m_index;
};
} // namespace sim
} // namespace frc

View File

@@ -137,136 +137,6 @@ class AnalogInputSim {
*/
void SetVoltage(double voltage);
/**
* Register a callback on whether the accumulator is initialized.
*
* @param callback the callback that will be called whenever the accumulator
* is initialized
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAccumulatorInitializedCallback(
NotifyCallback callback, bool initialNotify);
/**
* Check if the accumulator has been initialized.
*
* @return true if initialized
*/
bool GetAccumulatorInitialized() const;
/**
* Change whether the accumulator has been initialized.
*
* @param accumulatorInitialized the new value
*/
void SetAccumulatorInitialized(bool accumulatorInitialized);
/**
* Register a callback on the accumulator value.
*
* @param callback the callback that will be called whenever the accumulator
* value is changed
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAccumulatorValueCallback(
NotifyCallback callback, bool initialNotify);
/**
* Get the accumulator value.
*
* @return the accumulator value
*/
int64_t GetAccumulatorValue() const;
/**
* Change the accumulator value.
*
* @param accumulatorValue the new value
*/
void SetAccumulatorValue(int64_t accumulatorValue);
/**
* Register a callback on the accumulator count.
*
* @param callback the callback that will be called whenever the accumulator
* count is changed
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAccumulatorCountCallback(
NotifyCallback callback, bool initialNotify);
/**
* Get the accumulator count.
*
* @return the accumulator count.
*/
int64_t GetAccumulatorCount() const;
/**
* Change the accumulator count.
*
* @param accumulatorCount the new count.
*/
void SetAccumulatorCount(int64_t accumulatorCount);
/**
* Register a callback on the accumulator center.
*
* @param callback the callback that will be called whenever the accumulator
* center is changed
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAccumulatorCenterCallback(
NotifyCallback callback, bool initialNotify);
/**
* Get the accumulator center.
*
* @return the accumulator center
*/
int GetAccumulatorCenter() const;
/**
* Change the accumulator center.
*
* @param accumulatorCenter the new center
*/
void SetAccumulatorCenter(int accumulatorCenter);
/**
* Register a callback on the accumulator deadband.
*
* @param callback the callback that will be called whenever the accumulator
* deadband is changed
* @param initialNotify if true, the callback will be run on the initial value
* @return the CallbackStore object associated with this callback
*/
[[nodiscard]]
std::unique_ptr<CallbackStore> RegisterAccumulatorDeadbandCallback(
NotifyCallback callback, bool initialNotify);
/**
* Get the accumulator deadband.
*
* @return the accumulator deadband
*/
int GetAccumulatorDeadband() const;
/**
* Change the accumulator deadband.
*
* @param accumulatorDeadband the new deadband
*/
void SetAccumulatorDeadband(int accumulatorDeadband);
/**
* Reset all simulation data for this object.
*/