[wpilib] Add IsConnected function to all gyros (#4465)

This commit is contained in:
Thad House
2022-10-24 20:04:16 -07:00
committed by GitHub
parent 1d2e8eb153
commit 11244a49d9
8 changed files with 66 additions and 0 deletions

View File

@@ -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;