41namespace motorcontrol {
72 std::string
toString(std::string prependString) {
112 BasePigeon(
int deviceNumber, std::string
const &version, std::string
const &canbus =
"");
131 int SetYaw(
double angleDeg,
int timeoutMs = 0);
142 int AddYaw(
double angleDeg,
int timeoutMs = 0);
350 uint8_t subValue,
int ordinal,
int timeoutMs = 0);
389 int32_t & valueReceived, uint8_t & subValue, int32_t ordinal,
494 enum MotionDriverState {
505 ConfigCompass_5 = 10,
506 SelfTestCompass = 11,
507 WaitForGyroStable = 12,
508 AdditionalAccelAdjust = 13,
516 SetValue = 0x00, AddOffset = 0x01, MatchCompass = 0x02, SetOffset = 0xFF,
525 ResetStats _resetStats = { 0, 0, 0,
false };
529 uint32_t _deviceNumber;
530 uint32_t _usageHist = 0;
533 BasePigeonSimCollection* _simCollection;
536 const uint32_t EXPECTED_RESPONSE_TIMEOUT_MS = (200);
538 int PrivateSetParameter(
ParamEnum paramEnum, TareType tareType,
539 double angleDeg,
int timeoutMs = 0);
541 double GetTemp(
const uint64_t & statusFrame);
Simple address holder.
Definition: CANBusAddressable.h:9
CTRE Talon SRX Motor Controller when used on CAN Bus.
Definition: TalonSRX.h:145
Pigeon IMU Class.
Definition: BasePigeon.h:101
ErrorCode Get6dQuaternion(double wxyz[4]) const
Get 6d Quaternion data.
double GetRoll() const
Get the roll from the Pigeon.
BasePigeon(ctre::phoenix::motorcontrol::can::TalonSRX &talonSrx)
ErrorCode ConfigGetParameter(ParamEnum param, int32_t valueToSend, int32_t &valueReceived, uint8_t &subValue, int32_t ordinal, int32_t timeoutMs)
Gets a parameter by passing an int by reference.
int GetFirmwareVersion()
Gets the firmware version of the device.
int GetStatusFramePeriod(PigeonIMU_StatusFrame frame, int timeoutMs=0)
Gets the period of the given status frame.
bool HasResetOccurred() const
int GetRawGyro(double xyz_dps[3]) const
Get Raw Gyro data.
virtual ErrorCode ConfigFactoryDefault(int timeoutMs=50)
Configures all persistent settings to defaults.
double ConfigGetParameter(ctre::phoenix::ParamEnum param, int ordinal, int timeoutMs=0)
Gets a parameter.
ErrorCode ConfigSetCustomParam(int newValue, int paramIndex, int timeoutMs=0)
Sets the value of a custom parameter.
ErrorCode ClearStickyFaults(int timeoutMs=0)
Clears the Sticky Faults.
int GetBiasedAccelerometer(int16_t ba_xyz[3]) const
Get Biased Accelerometer data.
double GetPitch() const
Get the pitch from the Pigeon.
BasePigeon(int deviceNumber, std::string const &version, std::string const &canbus="")
Create a Pigeon object that communicates with Pigeon on CAN Bus.
double GetCompassFieldStrength() const
Gets the compass' measured magnetic field strength.
int GetAccumGyro(double xyz_deg[3]) const
Get AccumGyro data.
int GetBiasedMagnetometer(int16_t bm_xyz[3]) const
Get Biased Magnetometer data.
uint32_t GetResetFlags() const
int SetAccumZAngle(double angleDeg, int timeoutMs=0)
Sets the AccumZAngle.
virtual BasePigeonSimCollection & GetSimCollection()
int SetYaw(double angleDeg, int timeoutMs=0)
Sets the Yaw register to the specified value.
double GetCompassHeading() const
Get the continuous compass heading.
ErrorCode GetYawPitchRoll(double ypr[3]) const
Get Yaw, Pitch, and Roll data.
int ConfigGetCustomParam(int paramIndex, int timeoutMs=0)
Gets the value of a custom parameter.
static void DestroyAllBasePigeons()
Destructs all pigeon objects.
int SetYawToCompass(int timeoutMs=0)
Sets the Yaw register to match the current compass value.
void * GetLowLevelHandle() const
Definition: BasePigeon.h:449
int GetRawMagnetometer(int16_t rm_xyz[3]) const
Get Raw Magnetometer data.
ErrorCode GetLastError() const
Call GetLastError() generated by this object.
virtual void GetAllConfigs(BasePigeonConfiguration &allConfigs, int timeoutMs=50)
Gets all persistant settings.
double GetTemp() const
Gets the temperature of the pigeon.
double GetYaw() const
Get the yaw from the Pigeon.
virtual ctre::phoenix::ErrorCode ConfigAllSettings(const BasePigeonConfiguration &allConfigs, int timeoutMs=50)
Configures all persistent settings.
int AddYaw(double angleDeg, int timeoutMs=0)
Atomically add to the Yaw register.
ErrorCode SetStatusFramePeriod(PigeonIMU_StatusFrame statusFrame, uint8_t periodMs, int timeoutMs=0)
Sets the period of the given status frame.
ErrorCode SetControlFramePeriod(PigeonIMU_ControlFrame frame, int periodMs)
Sets the period of the given control frame.
uint32_t GetFirmVers() const
double GetAbsoluteCompassHeading() const
Get the absolute compass heading.
ErrorCode ConfigSetParameter(ParamEnum param, double value, uint8_t subValue, int ordinal, int timeoutMs=0)
Sets a parameter.
uint32_t GetResetCount() const
uint32_t GetUpTime() const
Gets the current Pigeon uptime.
Collection of simulation functions available to a Pigeon IMU.
Definition: BasePigeonSimCollection.h:23
PigeonIMU_StatusFrame
Enumerated type for status frame types.
Definition: PigeonIMU_StatusFrame.h:9
PigeonIMU_ControlFrame
Enumerated type for status frame types.
Definition: PigeonIMU_ControlFrame.h:9
ParamEnum
Signal enumeration for generic signal access.
Definition: paramEnum.h:13
ErrorCode
Definition: ErrorCode.h:13
namespace ctre
Definition: paramEnum.h:5
Configurables for any custom param configs.
Definition: CustomParamConfiguration.h:11
int customParam1
Custom Param 1.
Definition: CustomParamConfiguration.h:19
bool enableOptimizations
Enable optimizations for ConfigAll (defaults true)
Definition: CustomParamConfiguration.h:23
int customParam0
Custom Param 0.
Definition: CustomParamConfiguration.h:15
std::string toString()
Definition: CustomParamConfiguration.h:34
Util class to help with Pigeon configurations.
Definition: BasePigeon.h:82
static bool CustomParam1Different(const BasePigeonConfiguration &settings)
Definition: BasePigeon.h:93
static bool CustomParam0Different(const BasePigeonConfiguration &settings)
Determine if specified value is different from default.
Definition: BasePigeon.h:92
Configurables available to Pigeon.
Definition: BasePigeon.h:57
std::string toString()
Definition: BasePigeon.h:63
std::string toString(std::string prependString)
Definition: BasePigeon.h:72
BasePigeonConfiguration()
Definition: BasePigeon.h:58