[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

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