14#include <units/acceleration.h>
15#include <units/angle.h>
16#include <units/angular_velocity.h>
17#include <units/dimensionless.h>
18#include <units/magnetic_field_strength.h>
19#include <units/temperature.h>
20#include <units/time.h>
21#include <units/voltage.h>
103 std::stringstream ss;
399 ctre::phoenix::StatusCode
SetYaw(units::angle::degree_t newValue)
416 ctre::phoenix::StatusCode
SetYaw(units::angle::degree_t newValue, units::time::second_t timeoutSeconds)
418 std::stringstream ss;
461 std::stringstream ss;
481 bool _isInitialized =
false;
482 bool _isVersionOk =
false;
487 units::time::second_t _resetTimestamp{0_s};
491 void ReportIfTooOld();
545 std::unique_ptr<sim::Pigeon2SimState> _simState{};
558 if (_simState ==
nullptr)
559 _simState = std::make_unique<sim::Pigeon2SimState>(*
this);
1543 ctre::phoenix::StatusCode
SetYaw(units::angle::degree_t newValue, units::time::second_t timeoutSeconds)
1555 ctre::phoenix::StatusCode
SetYaw(units::angle::degree_t newValue)
1557 return SetYaw(newValue, 0.050_s);
ii that the Software will be uninterrupted or error free
Definition: CTRE_LICENSE.txt:191
CTREXPORT int c_ctre_phoenixpro_serialize_double(int spn, double value, char **str)
@ OK
No Error.
Definition: StatusCodes.h:1101
@ NotSupported
This is not supported.
Definition: StatusCodes.h:1704
Configs to trim the Pigeon2's gyroscope.
Definition: Configs.hpp:185
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:237
std::string ToString() const
Definition: Configs.hpp:215
std::string Serialize() const
Definition: Configs.hpp:227
Configs for Pigeon 2's Mount Pose configuration.
Definition: Configs.hpp:111
std::string Serialize() const
Definition: Configs.hpp:153
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:163
std::string ToString() const
Definition: Configs.hpp:141
Definition: Configs.hpp:22
Definition: Configurator.hpp:21
ctre::phoenix::StatusCode GetConfigsPrivate(std::string &serializedString, units::time::second_t timeoutSeconds) const
Definition: Configurator.hpp:61
units::time::second_t defaultTimeoutSeconds
The default amount of time to wait for a config.
Definition: Configurator.hpp:26
ctre::phoenix::StatusCode SetConfigsPrivate(const std::string &serializedString, units::time::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
Definition: Configurator.hpp:37
Class description for the Pigeon 2 IMU sensor that measures orientation.
Definition: CorePigeon2.hpp:40
std::string ToString() const
Get the string representation of this configuration.
Definition: CorePigeon2.hpp:89
bool FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs...
Definition: CorePigeon2.hpp:55
GyroTrimConfigs GyroTrim
Configs to trim the Pigeon2's gyroscope.
Definition: CorePigeon2.hpp:76
Pigeon2FeaturesConfigs Pigeon2Features
Configs to enable/disable various features of the Pigeon2.
Definition: CorePigeon2.hpp:84
std::string Serialize() const
Get the serialized form of this configuration.
Definition: CorePigeon2.hpp:101
MountPoseConfigs MountPose
Configs for Pigeon 2's Mount Pose configuration.
Definition: CorePigeon2.hpp:65
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Take a string and deserialize it to this configuration.
Definition: CorePigeon2.hpp:113
Class description for the Pigeon 2 IMU sensor that measures orientation.
Definition: CorePigeon2.hpp:129
ctre::phoenix::StatusCode Refresh(GyroTrimConfigs &configs) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:274
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition: CorePigeon2.hpp:440
ctre::phoenix::StatusCode Apply(const GyroTrimConfigs &configs)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:305
ctre::phoenix::StatusCode Apply(const Pigeon2FeaturesConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:379
ctre::phoenix::StatusCode Apply(const Pigeon2Configuration &configs)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:184
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition: CorePigeon2.hpp:459
ctre::phoenix::StatusCode Refresh(MountPoseConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:227
Pigeon2Configurator(const Pigeon2Configurator &)=delete
Delete the copy constructor, we can only pass by reference.
ctre::phoenix::StatusCode Refresh(Pigeon2FeaturesConfigs &configs) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:334
ctre::phoenix::StatusCode Apply(const MountPoseConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:259
ctre::phoenix::StatusCode Refresh(Pigeon2FeaturesConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:347
ctre::phoenix::StatusCode Apply(const Pigeon2FeaturesConfigs &configs)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:365
ctre::phoenix::StatusCode Apply(const MountPoseConfigs &configs)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:245
ctre::phoenix::StatusCode Refresh(GyroTrimConfigs &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:287
ctre::phoenix::StatusCode Apply(const Pigeon2Configuration &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:198
ctre::phoenix::StatusCode Apply(const GyroTrimConfigs &configs, units::time::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition: CorePigeon2.hpp:319
ctre::phoenix::StatusCode Refresh(Pigeon2Configuration &configs) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:152
ctre::phoenix::StatusCode SetYaw(units::angle::degree_t newValue, units::time::second_t timeoutSeconds)
The yaw to set the Pigeon2 to right now.
Definition: CorePigeon2.hpp:416
ctre::phoenix::StatusCode Refresh(Pigeon2Configuration &configs, units::time::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:166
ctre::phoenix::StatusCode SetYaw(units::angle::degree_t newValue)
The yaw to set the Pigeon2 to right now.
Definition: CorePigeon2.hpp:399
ctre::phoenix::StatusCode Refresh(MountPoseConfigs &configs) const
Refreshes the values of the specified config group.
Definition: CorePigeon2.hpp:214
Configs to enable/disable various features of the Pigeon2.
Definition: Configs.hpp:256
std::string ToString() const
Definition: Configs.hpp:280
std::string Serialize() const
Definition: Configs.hpp:292
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:302
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:65
Definition: DeviceIdentifier.hpp:19
Parent class for all devices.
Definition: ParentDevice.hpp:30
Class description for the Pigeon 2 IMU sensor that measures orientation.
Definition: CorePigeon2.hpp:477
ctre::phoenix::StatusCode SetControl(controls::ControlRequest &request)
Control motor with generic control request object.
Definition: CorePigeon2.hpp:1514
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetMagneticFieldY()
The biased magnitude of the magnetic field measured by the Pigeon 2 in the Y direction.
configs::Pigeon2Configurator & GetConfigurator()
Gets the configurator for this Pigeon2.
Definition: CorePigeon2.hpp:526
StatusSignalValue< units::angular_velocity::degrees_per_second_t > & GetAngularVelocityY()
The angular velocity (ω) of the Pigeon 2 about the Y axis.
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetMagneticFieldX()
The biased magnitude of the magnetic field measured by the Pigeon 2 in the X direction.
CorePigeon2(int deviceId, std::string canbus="")
Constructs a new Pigeon 2 sensor object.
StatusSignalValue< int > & GetVersionMajor()
App Major Version number.
StatusSignalValue< units::angle::degree_t > & GetAccumGyroY()
The accumulated gyro about the Y axis without any sensor fusing.
StatusSignalValue< bool > & GetTemperatureCompensationDisabled()
Whether the temperature-compensation feature is disabled.
StatusSignalValue< units::dimensionless::scalar_t > & GetQuatW()
The W component of the reported Quaternion.
StatusSignalValue< bool > & GetStickyFault_SaturatedMagneter()
Magnetometer values are saturated.
StatusSignalValue< bool > & GetStickyFault_BootupAccelerometer()
Bootup checks failed: Accelerometer.
StatusSignalValue< bool > & GetStickyFault_BootIntoMotion()
Motion Detected during bootup.
StatusSignalValue< int > & GetVersionMinor()
App Minor Version number.
StatusSignalValue< units::time::second_t > & GetUpTime()
How long the Pigeon 2's been up in seconds, caps at 255 seconds.
StatusSignalValue< bool > & GetFault_SaturatedMagneter()
Magnetometer values are saturated.
ctre::phoenix::StatusCode SetYaw(units::angle::degree_t newValue)
The yaw to set the Pigeon2 to right now.
Definition: CorePigeon2.hpp:1555
ctre::phoenix::StatusCode ClearStickyFaults(units::time::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition: CorePigeon2.hpp:1569
StatusSignalValue< bool > & GetStickyFault_SaturatedGyrosscope()
Gyroscope values are saturated.
StatusSignalValue< bool > & GetStickyFault_BootupMagnetometer()
Bootup checks failed: Magnetometer.
StatusSignalValue< bool > & GetNoMotionEnabled()
Whether the no-motion calibration feature is enabled.
ctre::phoenix::StatusCode SetControl(controls::ControlRequest &&request)
Control motor with generic control request object.
Definition: CorePigeon2.hpp:1530
StatusSignalValue< bool > & GetFault_Hardware()
Hardware fault occurred.
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetRawMagneticFieldX()
The raw magnitude of the magnetic field measured by the Pigeon 2 in the X direction.
StatusSignalValue< bool > & GetFault_BootupAccelerometer()
Bootup checks failed: Accelerometer.
StatusSignalValue< bool > & GetFault_BootDuringEnable()
Device boot while detecting the enable signal.
StatusSignalValue< units::angular_velocity::degrees_per_second_t > & GetAngularVelocityX()
The angular velocity (ω) of the Pigeon 2 about the X axis.
StatusSignalValue< units::acceleration::standard_gravity_t > & GetAccelerationZ()
The acceleration measured by Pigeon2 in the Z direction.
StatusSignalValue< units::acceleration::standard_gravity_t > & GetAccelerationY()
The acceleration measured by Pigeon2 in the Y direction.
StatusSignalValue< bool > & GetFault_BootIntoMotion()
Motion Detected during bootup.
StatusSignalValue< units::dimensionless::scalar_t > & GetGravityVectorX()
The X component of the gravity vector.
StatusSignalValue< units::acceleration::standard_gravity_t > & GetAccelerationX()
The acceleration measured by Pigeon2 in the X direction.
StatusSignalValue< units::angle::degree_t > & GetAccumGyroZ()
The accumulated gyro about the Z axis without any sensor fusing.
StatusSignalValue< units::dimensionless::scalar_t > & GetNoMotionCount()
The number of times a no-motion event occurred, wraps at 15.
StatusSignalValue< units::temperature::celsius_t > & GetTemperature()
Temperature of the Pigeon 2.
StatusSignalValue< bool > & GetFault_BootupGyroscope()
Bootup checks failed: Gyroscope.
StatusSignalValue< units::dimensionless::scalar_t > & GetQuatX()
The X component of the reported Quaternion.
StatusSignalValue< int > & GetVersionBuild()
App Build Version number.
StatusSignalValue< bool > & GetStickyFault_BootDuringEnable()
Device boot while detecting the enable signal.
StatusSignalValue< units::angle::degree_t > & GetPitch()
Current reported pitch of the Pigeon2.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition: CorePigeon2.hpp:1583
StatusSignalValue< bool > & GetFault_SaturatedAccelometer()
Accelerometer values are saturated.
CorePigeon2(CorePigeon2 const &)=delete
StatusSignalValue< bool > & GetStickyFault_DataAcquiredLate()
Motion stack data acquisition was slower than expected.
StatusSignalValue< int > & GetVersionBugfix()
App Bugfix Version number.
StatusSignalValue< units::dimensionless::scalar_t > & GetQuatY()
The Y component of the reported Quaternion.
StatusSignalValue< bool > & GetFault_DataAcquiredLate()
Motion stack data acquisition was slower than expected.
StatusSignalValue< bool > & GetFault_SaturatedGyrosscope()
Gyroscope values are saturated.
StatusSignalValue< bool > & GetStickyFault_Undervoltage()
Device supply voltage dropped to near brownout levels.
StatusSignalValue< units::angular_velocity::degrees_per_second_t > & GetAngularVelocityZ()
The angular velocity (ω) of the Pigeon 2 about the Z axis.
StatusSignalValue< bool > & GetStickyFault_LoopTimeSlow()
Motion stack loop time was slower than expected.
StatusSignalValue< units::angle::degree_t > & GetYaw()
Current reported yaw of the Pigeon2.
configs::Pigeon2Configurator const & GetConfigurator() const
Gets the configurator for this Pigeon2.
Definition: CorePigeon2.hpp:538
StatusSignalValue< bool > & GetFault_LoopTimeSlow()
Motion stack loop time was slower than expected.
StatusSignalValue< units::angle::degree_t > & GetAccumGyroX()
The accumulated gyro about the X axis without any sensor fusing.
StatusSignalValue< units::voltage::volt_t > & GetSupplyVoltage()
Measured supply voltage to the Pigeon2.
StatusSignalValue< units::dimensionless::scalar_t > & GetGravityVectorZ()
The Z component of the gravity vector.
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetRawMagneticFieldY()
The raw magnitude of the magnetic field measured by the Pigeon 2 in the Y direction.
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetMagneticFieldZ()
The biased magnitude of the magnetic field measured by the Pigeon 2 in the Z direction.
StatusSignalValue< units::angle::degree_t > & GetRoll()
Current reported roll of the Pigeon2.
StatusSignalValue< bool > & GetStickyFault_SaturatedAccelometer()
Accelerometer values are saturated.
StatusSignalValue< units::dimensionless::scalar_t > & GetQuatZ()
The Z component of the reported Quaternion.
StatusSignalValue< int > & GetStickyFaultField()
Integer representing all sticky faults.
ctre::phoenix::StatusCode SetYaw(units::angle::degree_t newValue, units::time::second_t timeoutSeconds)
The yaw to set the Pigeon2 to right now.
Definition: CorePigeon2.hpp:1543
StatusSignalValue< units::dimensionless::scalar_t > & GetGravityVectorY()
The Y component of the gravity vector.
StatusSignalValue< units::magnetic_field_strength::microtesla_t > & GetRawMagneticFieldZ()
The raw magnitude of the magnetic field measured by the Pigeon 2 in the Z direction.
StatusSignalValue< bool > & GetStickyFault_BootupGyroscope()
Bootup checks failed: Gyroscope.
StatusSignalValue< int > & GetVersion()
Full Version.
CorePigeon2 & operator=(CorePigeon2 const &)=delete
sim::Pigeon2SimState & GetSimState()
Get the simulation state for this device.
Definition: CorePigeon2.hpp:556
StatusSignalValue< bool > & GetFault_BootupMagnetometer()
Bootup checks failed: Magnetometer.
StatusSignalValue< int > & GetFaultField()
Integer representing all faults.
StatusSignalValue< bool > & GetStickyFault_Hardware()
Hardware fault occurred.
StatusSignalValue< bool > & GetFault_Undervoltage()
Device supply voltage dropped to near brownout levels.
Class to control the state of a simulated hardware::Pigeon2.
Definition: Pigeon2SimState.hpp:30
static constexpr int Startup_ResetFlags
Definition: SpnValue.hpp:26
CTREXPORT double GetCurrentTimeSeconds()
Get the current timestamp in seconds.
Definition: string_util.hpp:14