mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] Add IsConnected function to all gyros (#4465)
This commit is contained in:
@@ -205,6 +205,8 @@ class ADIS16448_IMU : public nt::NTSendable,
|
||||
|
||||
int SetYawAxis(IMUAxis yaw_axis);
|
||||
|
||||
bool IsConnected() const;
|
||||
|
||||
int ConfigDecRate(uint16_t DecimationRate);
|
||||
|
||||
/**
|
||||
@@ -361,10 +363,12 @@ class ADIS16448_IMU : public nt::NTSendable,
|
||||
CalibrationTime m_calibration_time{0};
|
||||
SPI* m_spi = nullptr;
|
||||
DigitalInput* m_auto_interrupt = nullptr;
|
||||
bool m_connected{false};
|
||||
|
||||
std::thread m_acquire_task;
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimBoolean m_simConnected;
|
||||
hal::SimDouble m_simGyroAngleX;
|
||||
hal::SimDouble m_simGyroAngleY;
|
||||
hal::SimDouble m_simGyroAngleZ;
|
||||
|
||||
@@ -159,6 +159,8 @@ class ADIS16470_IMU : public nt::NTSendable,
|
||||
|
||||
int SetYawAxis(IMUAxis yaw_axis);
|
||||
|
||||
bool IsConnected() const;
|
||||
|
||||
// IMU yaw axis
|
||||
IMUAxis m_yaw_axis;
|
||||
|
||||
@@ -382,10 +384,12 @@ class ADIS16470_IMU : public nt::NTSendable,
|
||||
SPI* m_spi = nullptr;
|
||||
DigitalInput* m_auto_interrupt = nullptr;
|
||||
double m_scaled_sample_rate = 2500.0; // Default sample rate setting
|
||||
bool m_connected{false};
|
||||
|
||||
std::thread m_acquire_task;
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimBoolean m_simConnected;
|
||||
hal::SimDouble m_simGyroAngleX;
|
||||
hal::SimDouble m_simGyroAngleY;
|
||||
hal::SimDouble m_simGyroAngleZ;
|
||||
|
||||
@@ -49,6 +49,8 @@ class ADXRS450_Gyro : public Gyro,
|
||||
ADXRS450_Gyro(ADXRS450_Gyro&&) = default;
|
||||
ADXRS450_Gyro& operator=(ADXRS450_Gyro&&) = default;
|
||||
|
||||
bool IsConnected() const;
|
||||
|
||||
/**
|
||||
* Return the actual angle in degrees that the robot is currently facing.
|
||||
*
|
||||
@@ -105,8 +107,10 @@ class ADXRS450_Gyro : public Gyro,
|
||||
private:
|
||||
SPI m_spi;
|
||||
SPI::Port m_port;
|
||||
bool m_connected{false};
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimBoolean m_simConnected;
|
||||
hal::SimDouble m_simAngle;
|
||||
hal::SimDouble m_simRate;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user