CTRE Phoenix 6 C++ 26.70.0-alpha-2
Loading...
Searching...
No Matches
CorePigeon2.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
13
18
20#include <wpi/units/acceleration.hpp>
21#include <wpi/units/angle.hpp>
22#include <wpi/units/angular_velocity.hpp>
23#include <wpi/units/dimensionless.hpp>
24#include <wpi/units/magnetic_field_strength.hpp>
25#include <wpi/units/temperature.hpp>
26#include <wpi/units/time.hpp>
27#include <wpi/units/voltage.hpp>
28
29namespace ctre {
30namespace phoenix6 {
31
32namespace hardware {
33namespace core {
34 class CorePigeon2;
35}
36}
37
38namespace configs {
39
40/**
41 * All configurations for the hardware#Pigeon2.
42 */
44{
45public:
46 constexpr Pigeon2Configuration() = default;
47
48 /**
49 * \brief True if we should factory default newer unsupported configs,
50 * false to leave newer unsupported configs alone.
51 *
52 * \details This flag addresses a corner case where the device may have
53 * firmware with newer configs that didn't exist when this
54 * version of the API was built. If this occurs and this
55 * flag is true, unsupported new configs will be factory
56 * defaulted to avoid unexpected behavior.
57 *
58 * This is also the behavior in Phoenix 5, so this flag
59 * is defaulted to true to match.
60 */
62
63
64 /**
65 * \brief Configs for Pigeon 2's Mount Pose configuration.
66 *
67 * \details These configs allow the Pigeon2 to be mounted in whatever
68 * orientation that's desired and ensure the reported
69 * Yaw/Pitch/Roll is from the robot's reference.
70 *
71 * Parameter list:
72 *
73 * - MountPoseConfigs#MountPoseYaw
74 * - MountPoseConfigs#MountPosePitch
75 * - MountPoseConfigs#MountPoseRoll
76 *
77 */
79
80 /**
81 * \brief Configs to trim the Pigeon2's gyroscope.
82 *
83 * \details Pigeon2 allows the user to trim the gyroscope's
84 * sensitivity. While this isn't necessary for the Pigeon2,
85 * as it comes calibrated out-of-the-box, users can make use
86 * of this to make the Pigeon2 even more accurate for their
87 * application.
88 *
89 * Parameter list:
90 *
91 * - GyroTrimConfigs#GyroScalarX
92 * - GyroTrimConfigs#GyroScalarY
93 * - GyroTrimConfigs#GyroScalarZ
94 *
95 */
97
98 /**
99 * \brief Configs to enable/disable various features of the Pigeon2.
100 *
101 * \details These configs allow the user to enable or disable various
102 * aspects of the Pigeon2.
103 *
104 * Parameter list:
105 *
106 * - Pigeon2FeaturesConfigs#EnableCompass
107 * - Pigeon2FeaturesConfigs#DisableTemperatureCompensation
108 * - Pigeon2FeaturesConfigs#DisableNoMotionCalibration
109 *
110 */
112
113 /**
114 * \brief Custom Params.
115 *
116 * \details Custom paramaters that have no real impact on controller.
117 *
118 * Parameter list:
119 *
120 * - CustomParamsConfigs#CustomParam0
121 * - CustomParamsConfigs#CustomParam1
122 *
123 */
125
126 /**
127 * \brief Modifies this configuration's MountPose parameter and returns itself for
128 * method-chaining and easier to use config API.
129 *
130 * Configs for Pigeon 2's Mount Pose configuration.
131 *
132 * \details These configs allow the Pigeon2 to be mounted in whatever
133 * orientation that's desired and ensure the reported
134 * Yaw/Pitch/Roll is from the robot's reference.
135 *
136 * Parameter list:
137 *
138 * - MountPoseConfigs#MountPoseYaw
139 * - MountPoseConfigs#MountPosePitch
140 * - MountPoseConfigs#MountPoseRoll
141 *
142 *
143 * \param newMountPose Parameter to modify
144 * \returns Itself
145 */
147 {
148 MountPose = std::move(newMountPose);
149 return *this;
150 }
151
152 /**
153 * \brief Modifies this configuration's GyroTrim parameter and returns itself for
154 * method-chaining and easier to use config API.
155 *
156 * Configs to trim the Pigeon2's gyroscope.
157 *
158 * \details Pigeon2 allows the user to trim the gyroscope's
159 * sensitivity. While this isn't necessary for the Pigeon2,
160 * as it comes calibrated out-of-the-box, users can make use
161 * of this to make the Pigeon2 even more accurate for their
162 * application.
163 *
164 * Parameter list:
165 *
166 * - GyroTrimConfigs#GyroScalarX
167 * - GyroTrimConfigs#GyroScalarY
168 * - GyroTrimConfigs#GyroScalarZ
169 *
170 *
171 * \param newGyroTrim Parameter to modify
172 * \returns Itself
173 */
175 {
176 GyroTrim = std::move(newGyroTrim);
177 return *this;
178 }
179
180 /**
181 * \brief Modifies this configuration's Pigeon2Features parameter and returns itself for
182 * method-chaining and easier to use config API.
183 *
184 * Configs to enable/disable various features of the Pigeon2.
185 *
186 * \details These configs allow the user to enable or disable various
187 * aspects of the Pigeon2.
188 *
189 * Parameter list:
190 *
191 * - Pigeon2FeaturesConfigs#EnableCompass
192 * - Pigeon2FeaturesConfigs#DisableTemperatureCompensation
193 * - Pigeon2FeaturesConfigs#DisableNoMotionCalibration
194 *
195 *
196 * \param newPigeon2Features Parameter to modify
197 * \returns Itself
198 */
200 {
201 Pigeon2Features = std::move(newPigeon2Features);
202 return *this;
203 }
204
205 /**
206 * \brief Modifies this configuration's CustomParams parameter and returns itself for
207 * method-chaining and easier to use config API.
208 *
209 * Custom Params.
210 *
211 * \details Custom paramaters that have no real impact on controller.
212 *
213 * Parameter list:
214 *
215 * - CustomParamsConfigs#CustomParam0
216 * - CustomParamsConfigs#CustomParam1
217 *
218 *
219 * \param newCustomParams Parameter to modify
220 * \returns Itself
221 */
223 {
224 CustomParams = std::move(newCustomParams);
225 return *this;
226 }
227
228 /**
229 * \brief Get the string representation of this configuration
230 */
231 std::string ToString() const override;
232
233 /**
234 * \brief Get the serialized form of this configuration
235 */
236 std::string Serialize() const final;
237 /**
238 * \brief Take a string and deserialize it to this configuration
239 */
240 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
241};
242
243/**
244 * Handles applying and refreshing configurations for the hardware#Pigeon2.
245 */
246class Pigeon2Configurator : public ParentConfigurator
247{
248private:
249 Pigeon2Configurator(hardware::DeviceIdentifier id) :
250 ParentConfigurator{std::move(id)}
251 {}
252
254
255public:
256 /**
257 * \brief Applies the contents of the specified config to the device.
258 *
259 * This will wait up to #DefaultTimeoutSeconds.
260 *
261 * \details Call to apply the selected configs.
262 *
263 * \param configs Configs to apply against.
264 * \returns Status code of applying the configs
265 */
270
271 /**
272 * \brief Applies the contents of the specified config to the device.
273 *
274 * \details Call to apply the selected configs.
275 *
276 * \param configs Configs to apply against.
277 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
278 * \returns Status code of applying the configs
279 */
280 ctre::phoenix::StatusCode Apply(const Pigeon2Configuration &configs, wpi::units::second_t timeoutSeconds)
281 {
282 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, configs.FutureProofConfigs, false);
283 }
284
285 /**
286 * \brief Applies the contents of the specified config to the device.
287 *
288 * This will wait up to #DefaultTimeoutSeconds.
289 *
290 * \details Call to apply the selected configs.
291 *
292 * \param configs Configs to apply against.
293 * \returns Status code of applying the configs
294 */
299
300 /**
301 * \brief Applies the contents of the specified config to the device.
302 *
303 * \details Call to apply the selected configs.
304 *
305 * \param configs Configs to apply against.
306 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
307 * \returns Status code of applying the configs
308 */
309 ctre::phoenix::StatusCode Apply(const MountPoseConfigs &configs, wpi::units::second_t timeoutSeconds)
310 {
311 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
312 }
313
314 /**
315 * \brief Applies the contents of the specified config to the device.
316 *
317 * This will wait up to #DefaultTimeoutSeconds.
318 *
319 * \details Call to apply the selected configs.
320 *
321 * \param configs Configs to apply against.
322 * \returns Status code of applying the configs
323 */
328
329 /**
330 * \brief Applies the contents of the specified config to the device.
331 *
332 * \details Call to apply the selected configs.
333 *
334 * \param configs Configs to apply against.
335 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
336 * \returns Status code of applying the configs
337 */
338 ctre::phoenix::StatusCode Apply(const GyroTrimConfigs &configs, wpi::units::second_t timeoutSeconds)
339 {
340 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
341 }
342
343 /**
344 * \brief Applies the contents of the specified config to the device.
345 *
346 * This will wait up to #DefaultTimeoutSeconds.
347 *
348 * \details Call to apply the selected configs.
349 *
350 * \param configs Configs to apply against.
351 * \returns Status code of applying the configs
352 */
357
358 /**
359 * \brief Applies the contents of the specified config to the device.
360 *
361 * \details Call to apply the selected configs.
362 *
363 * \param configs Configs to apply against.
364 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
365 * \returns Status code of applying the configs
366 */
367 ctre::phoenix::StatusCode Apply(const Pigeon2FeaturesConfigs &configs, wpi::units::second_t timeoutSeconds)
368 {
369 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
370 }
371
372 /**
373 * \brief Applies the contents of the specified config to the device.
374 *
375 * This will wait up to #DefaultTimeoutSeconds.
376 *
377 * \details Call to apply the selected configs.
378 *
379 * \param configs Configs to apply against.
380 * \returns Status code of applying the configs
381 */
386
387 /**
388 * \brief Applies the contents of the specified config to the device.
389 *
390 * \details Call to apply the selected configs.
391 *
392 * \param configs Configs to apply against.
393 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
394 * \returns Status code of applying the configs
395 */
396 ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds)
397 {
398 return SetConfigsPrivate(configs.Serialize(), timeoutSeconds, false, false);
399 }
400
401 /**
402 * \brief Refreshes the values of the specified config group.
403 *
404 * This will wait up to #DefaultTimeoutSeconds.
405 *
406 * \details Call to refresh the selected configs from the device.
407 *
408 * \param configs The configs to refresh
409 * \returns Status code of refreshing the configs
410 */
415
416 /**
417 * \brief Refreshes the values of the specified config group.
418 *
419 * \details Call to refresh the selected configs from the device.
420 *
421 * \param configs The configs to refresh
422 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
423 * \returns Status code of refreshing the configs
424 */
425 ctre::phoenix::StatusCode Refresh(Pigeon2Configuration &configs, wpi::units::second_t timeoutSeconds) const
426 {
427 std::string ref;
428 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
429 configs.Deserialize(ref);
430 return ret;
431 }
432
433 /**
434 * \brief Refreshes the values of the specified config group.
435 *
436 * This will wait up to #DefaultTimeoutSeconds.
437 *
438 * \details Call to refresh the selected configs from the device.
439 *
440 * \param configs The configs to refresh
441 * \returns Status code of refreshing the configs
442 */
447 /**
448 * \brief Refreshes the values of the specified config group.
449 *
450 * \details Call to refresh the selected configs from the device.
451 *
452 * \param configs The configs to refresh
453 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
454 * \returns Status code of refreshing the configs
455 */
456 ctre::phoenix::StatusCode Refresh(MountPoseConfigs &configs, wpi::units::second_t timeoutSeconds) const
457 {
458 std::string ref;
459 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
460 configs.Deserialize(ref);
461 return ret;
462 }
463
464 /**
465 * \brief Refreshes the values of the specified config group.
466 *
467 * This will wait up to #DefaultTimeoutSeconds.
468 *
469 * \details Call to refresh the selected configs from the device.
470 *
471 * \param configs The configs to refresh
472 * \returns Status code of refreshing the configs
473 */
478 /**
479 * \brief Refreshes the values of the specified config group.
480 *
481 * \details Call to refresh the selected configs from the device.
482 *
483 * \param configs The configs to refresh
484 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
485 * \returns Status code of refreshing the configs
486 */
487 ctre::phoenix::StatusCode Refresh(GyroTrimConfigs &configs, wpi::units::second_t timeoutSeconds) const
488 {
489 std::string ref;
490 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
491 configs.Deserialize(ref);
492 return ret;
493 }
494
495 /**
496 * \brief Refreshes the values of the specified config group.
497 *
498 * This will wait up to #DefaultTimeoutSeconds.
499 *
500 * \details Call to refresh the selected configs from the device.
501 *
502 * \param configs The configs to refresh
503 * \returns Status code of refreshing the configs
504 */
509 /**
510 * \brief Refreshes the values of the specified config group.
511 *
512 * \details Call to refresh the selected configs from the device.
513 *
514 * \param configs The configs to refresh
515 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
516 * \returns Status code of refreshing the configs
517 */
518 ctre::phoenix::StatusCode Refresh(Pigeon2FeaturesConfigs &configs, wpi::units::second_t timeoutSeconds) const
519 {
520 std::string ref;
521 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
522 configs.Deserialize(ref);
523 return ret;
524 }
525
526 /**
527 * \brief Refreshes the values of the specified config group.
528 *
529 * This will wait up to #DefaultTimeoutSeconds.
530 *
531 * \details Call to refresh the selected configs from the device.
532 *
533 * \param configs The configs to refresh
534 * \returns Status code of refreshing the configs
535 */
540 /**
541 * \brief Refreshes the values of the specified config group.
542 *
543 * \details Call to refresh the selected configs from the device.
544 *
545 * \param configs The configs to refresh
546 * \param timeoutSeconds Maximum amount of time to wait when performing configuration
547 * \returns Status code of refreshing the configs
548 */
549 ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds) const
550 {
551 std::string ref;
552 ctre::phoenix::StatusCode ret = GetConfigsPrivate(ref, timeoutSeconds);
553 configs.Deserialize(ref);
554 return ret;
555 }
556
557
558 /**
559 * \brief The yaw to set the Pigeon2 to right now.
560 *
561 * This will wait up to #DefaultTimeoutSeconds.
562 *
563 * This is available in the configurator in case the user wants
564 * to initialize their device entirely without passing a device
565 * reference down to the code that performs the initialization.
566 * In this case, the user passes down the configurator object
567 * and performs all the initialization code on the object.
568 *
569 * \param newValue Value to set to. Units are in deg.
570 * \returns StatusCode of the set command
571 */
572 ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue)
573 {
574 return SetYaw(newValue, DefaultTimeoutSeconds);
575 }
576 /**
577 * \brief The yaw to set the Pigeon2 to right now.
578 *
579 * This is available in the configurator in case the user wants
580 * to initialize their device entirely without passing a device
581 * reference down to the code that performs the initialization.
582 * In this case, the user passes down the configurator object
583 * and performs all the initialization code on the object.
584 *
585 * \param newValue Value to set to. Units are in deg.
586 * \param timeoutSeconds Maximum time to wait up to in seconds.
587 * \returns StatusCode of the set command
588 */
589 ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue, wpi::units::second_t timeoutSeconds);
590
591 /**
592 * \brief Clear the sticky faults in the device.
593 *
594 * \details This typically has no impact on the device functionality.
595 * Instead, it just clears telemetry faults that are accessible via
596 * API and Tuner Self-Test.
597 *
598 * This will wait up to #DefaultTimeoutSeconds.
599 *
600 * This is available in the configurator in case the user wants
601 * to initialize their device entirely without passing a device
602 * reference down to the code that performs the initialization.
603 * In this case, the user passes down the configurator object
604 * and performs all the initialization code on the object.
605 *
606 * \returns StatusCode of the set command
607 */
612 /**
613 * \brief Clear the sticky faults in the device.
614 *
615 * \details This typically has no impact on the device functionality.
616 * Instead, it just clears telemetry faults that are accessible via
617 * API and Tuner Self-Test.
618 *
619 * This is available in the configurator in case the user wants
620 * to initialize their device entirely without passing a device
621 * reference down to the code that performs the initialization.
622 * In this case, the user passes down the configurator object
623 * and performs all the initialization code on the object.
624 *
625 * \param timeoutSeconds Maximum time to wait up to in seconds.
626 * \returns StatusCode of the set command
627 */
628 ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds);
629
630 /**
631 * \brief Clear sticky fault: Hardware fault occurred
632 *
633 * This will wait up to #DefaultTimeoutSeconds.
634 *
635 * This is available in the configurator in case the user wants
636 * to initialize their device entirely without passing a device
637 * reference down to the code that performs the initialization.
638 * In this case, the user passes down the configurator object
639 * and performs all the initialization code on the object.
640 *
641 * \returns StatusCode of the set command
642 */
647 /**
648 * \brief Clear sticky fault: Hardware fault occurred
649 *
650 * This is available in the configurator in case the user wants
651 * to initialize their device entirely without passing a device
652 * reference down to the code that performs the initialization.
653 * In this case, the user passes down the configurator object
654 * and performs all the initialization code on the object.
655 *
656 * \param timeoutSeconds Maximum time to wait up to in seconds.
657 * \returns StatusCode of the set command
658 */
659 ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds);
660
661 /**
662 * \brief Clear sticky fault: Device supply voltage dropped to near
663 * brownout levels
664 *
665 * This will wait up to #DefaultTimeoutSeconds.
666 *
667 * This is available in the configurator in case the user wants
668 * to initialize their device entirely without passing a device
669 * reference down to the code that performs the initialization.
670 * In this case, the user passes down the configurator object
671 * and performs all the initialization code on the object.
672 *
673 * \returns StatusCode of the set command
674 */
679 /**
680 * \brief Clear sticky fault: Device supply voltage dropped to near
681 * brownout levels
682 *
683 * This is available in the configurator in case the user wants
684 * to initialize their device entirely without passing a device
685 * reference down to the code that performs the initialization.
686 * In this case, the user passes down the configurator object
687 * and performs all the initialization code on the object.
688 *
689 * \param timeoutSeconds Maximum time to wait up to in seconds.
690 * \returns StatusCode of the set command
691 */
692 ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds);
693
694 /**
695 * \brief Clear sticky fault: Device boot while detecting the enable
696 * signal
697 *
698 * This will wait up to #DefaultTimeoutSeconds.
699 *
700 * This is available in the configurator in case the user wants
701 * to initialize their device entirely without passing a device
702 * reference down to the code that performs the initialization.
703 * In this case, the user passes down the configurator object
704 * and performs all the initialization code on the object.
705 *
706 * \returns StatusCode of the set command
707 */
712 /**
713 * \brief Clear sticky fault: Device boot while detecting the enable
714 * signal
715 *
716 * This is available in the configurator in case the user wants
717 * to initialize their device entirely without passing a device
718 * reference down to the code that performs the initialization.
719 * In this case, the user passes down the configurator object
720 * and performs all the initialization code on the object.
721 *
722 * \param timeoutSeconds Maximum time to wait up to in seconds.
723 * \returns StatusCode of the set command
724 */
726
727 /**
728 * \brief Clear sticky fault: An unlicensed feature is in use, device
729 * may not behave as expected.
730 *
731 * This will wait up to #DefaultTimeoutSeconds.
732 *
733 * This is available in the configurator in case the user wants
734 * to initialize their device entirely without passing a device
735 * reference down to the code that performs the initialization.
736 * In this case, the user passes down the configurator object
737 * and performs all the initialization code on the object.
738 *
739 * \returns StatusCode of the set command
740 */
745 /**
746 * \brief Clear sticky fault: An unlicensed feature is in use, device
747 * may not behave as expected.
748 *
749 * This is available in the configurator in case the user wants
750 * to initialize their device entirely without passing a device
751 * reference down to the code that performs the initialization.
752 * In this case, the user passes down the configurator object
753 * and performs all the initialization code on the object.
754 *
755 * \param timeoutSeconds Maximum time to wait up to in seconds.
756 * \returns StatusCode of the set command
757 */
759
760 /**
761 * \brief Clear sticky fault: Bootup checks failed: Accelerometer
762 *
763 * This will wait up to #DefaultTimeoutSeconds.
764 *
765 * This is available in the configurator in case the user wants
766 * to initialize their device entirely without passing a device
767 * reference down to the code that performs the initialization.
768 * In this case, the user passes down the configurator object
769 * and performs all the initialization code on the object.
770 *
771 * \returns StatusCode of the set command
772 */
777 /**
778 * \brief Clear sticky fault: Bootup checks failed: Accelerometer
779 *
780 * This is available in the configurator in case the user wants
781 * to initialize their device entirely without passing a device
782 * reference down to the code that performs the initialization.
783 * In this case, the user passes down the configurator object
784 * and performs all the initialization code on the object.
785 *
786 * \param timeoutSeconds Maximum time to wait up to in seconds.
787 * \returns StatusCode of the set command
788 */
790
791 /**
792 * \brief Clear sticky fault: Bootup checks failed: Gyroscope
793 *
794 * This will wait up to #DefaultTimeoutSeconds.
795 *
796 * This is available in the configurator in case the user wants
797 * to initialize their device entirely without passing a device
798 * reference down to the code that performs the initialization.
799 * In this case, the user passes down the configurator object
800 * and performs all the initialization code on the object.
801 *
802 * \returns StatusCode of the set command
803 */
808 /**
809 * \brief Clear sticky fault: Bootup checks failed: Gyroscope
810 *
811 * This is available in the configurator in case the user wants
812 * to initialize their device entirely without passing a device
813 * reference down to the code that performs the initialization.
814 * In this case, the user passes down the configurator object
815 * and performs all the initialization code on the object.
816 *
817 * \param timeoutSeconds Maximum time to wait up to in seconds.
818 * \returns StatusCode of the set command
819 */
821
822 /**
823 * \brief Clear sticky fault: Bootup checks failed: Magnetometer
824 *
825 * This will wait up to #DefaultTimeoutSeconds.
826 *
827 * This is available in the configurator in case the user wants
828 * to initialize their device entirely without passing a device
829 * reference down to the code that performs the initialization.
830 * In this case, the user passes down the configurator object
831 * and performs all the initialization code on the object.
832 *
833 * \returns StatusCode of the set command
834 */
839 /**
840 * \brief Clear sticky fault: Bootup checks failed: Magnetometer
841 *
842 * This is available in the configurator in case the user wants
843 * to initialize their device entirely without passing a device
844 * reference down to the code that performs the initialization.
845 * In this case, the user passes down the configurator object
846 * and performs all the initialization code on the object.
847 *
848 * \param timeoutSeconds Maximum time to wait up to in seconds.
849 * \returns StatusCode of the set command
850 */
852
853 /**
854 * \brief Clear sticky fault: Motion Detected during bootup.
855 *
856 * This will wait up to #DefaultTimeoutSeconds.
857 *
858 * This is available in the configurator in case the user wants
859 * to initialize their device entirely without passing a device
860 * reference down to the code that performs the initialization.
861 * In this case, the user passes down the configurator object
862 * and performs all the initialization code on the object.
863 *
864 * \returns StatusCode of the set command
865 */
870 /**
871 * \brief Clear sticky fault: Motion Detected during bootup.
872 *
873 * This is available in the configurator in case the user wants
874 * to initialize their device entirely without passing a device
875 * reference down to the code that performs the initialization.
876 * In this case, the user passes down the configurator object
877 * and performs all the initialization code on the object.
878 *
879 * \param timeoutSeconds Maximum time to wait up to in seconds.
880 * \returns StatusCode of the set command
881 */
882 ctre::phoenix::StatusCode ClearStickyFault_BootIntoMotion(wpi::units::second_t timeoutSeconds);
883
884 /**
885 * \brief Clear sticky fault: Motion stack data acquisition was slower
886 * than expected
887 *
888 * This will wait up to #DefaultTimeoutSeconds.
889 *
890 * This is available in the configurator in case the user wants
891 * to initialize their device entirely without passing a device
892 * reference down to the code that performs the initialization.
893 * In this case, the user passes down the configurator object
894 * and performs all the initialization code on the object.
895 *
896 * \returns StatusCode of the set command
897 */
902 /**
903 * \brief Clear sticky fault: Motion stack data acquisition was slower
904 * than expected
905 *
906 * This is available in the configurator in case the user wants
907 * to initialize their device entirely without passing a device
908 * reference down to the code that performs the initialization.
909 * In this case, the user passes down the configurator object
910 * and performs all the initialization code on the object.
911 *
912 * \param timeoutSeconds Maximum time to wait up to in seconds.
913 * \returns StatusCode of the set command
914 */
916
917 /**
918 * \brief Clear sticky fault: Motion stack loop time was slower than
919 * expected.
920 *
921 * This will wait up to #DefaultTimeoutSeconds.
922 *
923 * This is available in the configurator in case the user wants
924 * to initialize their device entirely without passing a device
925 * reference down to the code that performs the initialization.
926 * In this case, the user passes down the configurator object
927 * and performs all the initialization code on the object.
928 *
929 * \returns StatusCode of the set command
930 */
935 /**
936 * \brief Clear sticky fault: Motion stack loop time was slower than
937 * expected.
938 *
939 * This is available in the configurator in case the user wants
940 * to initialize their device entirely without passing a device
941 * reference down to the code that performs the initialization.
942 * In this case, the user passes down the configurator object
943 * and performs all the initialization code on the object.
944 *
945 * \param timeoutSeconds Maximum time to wait up to in seconds.
946 * \returns StatusCode of the set command
947 */
948 ctre::phoenix::StatusCode ClearStickyFault_LoopTimeSlow(wpi::units::second_t timeoutSeconds);
949
950 /**
951 * \brief Clear sticky fault: Magnetometer values are saturated
952 *
953 * This will wait up to #DefaultTimeoutSeconds.
954 *
955 * This is available in the configurator in case the user wants
956 * to initialize their device entirely without passing a device
957 * reference down to the code that performs the initialization.
958 * In this case, the user passes down the configurator object
959 * and performs all the initialization code on the object.
960 *
961 * \returns StatusCode of the set command
962 */
967 /**
968 * \brief Clear sticky fault: Magnetometer values are saturated
969 *
970 * This is available in the configurator in case the user wants
971 * to initialize their device entirely without passing a device
972 * reference down to the code that performs the initialization.
973 * In this case, the user passes down the configurator object
974 * and performs all the initialization code on the object.
975 *
976 * \param timeoutSeconds Maximum time to wait up to in seconds.
977 * \returns StatusCode of the set command
978 */
980
981 /**
982 * \brief Clear sticky fault: Accelerometer values are saturated
983 *
984 * This will wait up to #DefaultTimeoutSeconds.
985 *
986 * This is available in the configurator in case the user wants
987 * to initialize their device entirely without passing a device
988 * reference down to the code that performs the initialization.
989 * In this case, the user passes down the configurator object
990 * and performs all the initialization code on the object.
991 *
992 * \returns StatusCode of the set command
993 */
998 /**
999 * \brief Clear sticky fault: Accelerometer values are saturated
1000 *
1001 * This is available in the configurator in case the user wants
1002 * to initialize their device entirely without passing a device
1003 * reference down to the code that performs the initialization.
1004 * In this case, the user passes down the configurator object
1005 * and performs all the initialization code on the object.
1006 *
1007 * \param timeoutSeconds Maximum time to wait up to in seconds.
1008 * \returns StatusCode of the set command
1009 */
1011
1012 /**
1013 * \brief Clear sticky fault: Gyroscope values are saturated
1014 *
1015 * This will wait up to #DefaultTimeoutSeconds.
1016 *
1017 * This is available in the configurator in case the user wants
1018 * to initialize their device entirely without passing a device
1019 * reference down to the code that performs the initialization.
1020 * In this case, the user passes down the configurator object
1021 * and performs all the initialization code on the object.
1022 *
1023 * \returns StatusCode of the set command
1024 */
1029 /**
1030 * \brief Clear sticky fault: Gyroscope values are saturated
1031 *
1032 * This is available in the configurator in case the user wants
1033 * to initialize their device entirely without passing a device
1034 * reference down to the code that performs the initialization.
1035 * In this case, the user passes down the configurator object
1036 * and performs all the initialization code on the object.
1037 *
1038 * \param timeoutSeconds Maximum time to wait up to in seconds.
1039 * \returns StatusCode of the set command
1040 */
1042};
1043
1044}
1045
1046namespace hardware {
1047namespace core {
1048
1049#if defined(_WIN32) || defined(_WIN64)
1050#pragma warning(push)
1051#pragma warning(disable : 4250)
1052#endif
1053
1054/**
1055 * Class for the Pigeon 2 IMU sensor that measures orientation.
1056 */
1058{
1059private:
1061
1062public:
1063 /**
1064 * \brief The configuration class for this device.
1065 */
1067
1068 /**
1069 * Constructs a new Pigeon 2 sensor object.
1070 *
1071 * \param deviceId ID of the device, as configured in Phoenix Tuner
1072 * \param canbus The CAN bus this device is on
1073 */
1074 CorePigeon2(int deviceId, CANBus canbus);
1075
1076 /**
1077 * \brief Constructs a stubbed-out CorePigeon2, where all status signals, controls,
1078 * configs, etc. perform no action and immediately return OK. This can be used to
1079 * silence error messages for devices that have been completely removed from the robot.
1080 *
1081 * \returns Stubbed-out CorePigeon2
1082 */
1084 {
1085 return CorePigeon2{-1, CANBus{}};
1086 }
1087
1088 /**
1089 * \brief Gets the configurator for this Pigeon2. Users may use this to refresh
1090 * and apply configs.
1091 *
1092 * \returns Configurator for this Pigeon2
1093 */
1095 {
1096 return _configs;
1097 }
1098
1099 /**
1100 * \brief Gets the configurator for this Pigeon2
1101 *
1102 * \details Gets the configurator for this Pigeon2
1103 *
1104 * \returns Configurator for this Pigeon2
1105 */
1107 {
1108 return _configs;
1109 }
1110
1111
1112private:
1113 std::unique_ptr<sim::Pigeon2SimState> _simState{};
1114public:
1115 /**
1116 * \brief Get the simulation state for this device.
1117 *
1118 * \details This function reuses an allocated simulation
1119 * state object, so it is safe to call this function multiple
1120 * times in a robot loop.
1121 *
1122 * \returns Simulation state
1123 */
1125 {
1126 if (_simState == nullptr)
1127 _simState = std::make_unique<sim::Pigeon2SimState>(*this);
1128 return *_simState;
1129 }
1130
1131
1132
1133 /**
1134 * \brief App Major Version number.
1135 *
1136 * - Minimum Value: 0
1137 * - Maximum Value: 255
1138 * - Default Value: 0
1139 * - Units:
1140 *
1141 * Default Rates:
1142 * - CAN: 4.0 Hz
1143 *
1144 * This refreshes and returns a cached StatusSignal object.
1145 *
1146 * \param refresh Whether to refresh the StatusSignal before returning it;
1147 * defaults to true
1148 * \returns VersionMajor Status Signal Object
1149 */
1150 StatusSignal<int> &GetVersionMajor(bool refresh = true);
1151
1152 /**
1153 * \brief App Minor Version number.
1154 *
1155 * - Minimum Value: 0
1156 * - Maximum Value: 255
1157 * - Default Value: 0
1158 * - Units:
1159 *
1160 * Default Rates:
1161 * - CAN: 4.0 Hz
1162 *
1163 * This refreshes and returns a cached StatusSignal object.
1164 *
1165 * \param refresh Whether to refresh the StatusSignal before returning it;
1166 * defaults to true
1167 * \returns VersionMinor Status Signal Object
1168 */
1169 StatusSignal<int> &GetVersionMinor(bool refresh = true);
1170
1171 /**
1172 * \brief App Bugfix Version number.
1173 *
1174 * - Minimum Value: 0
1175 * - Maximum Value: 255
1176 * - Default Value: 0
1177 * - Units:
1178 *
1179 * Default Rates:
1180 * - CAN: 4.0 Hz
1181 *
1182 * This refreshes and returns a cached StatusSignal object.
1183 *
1184 * \param refresh Whether to refresh the StatusSignal before returning it;
1185 * defaults to true
1186 * \returns VersionBugfix Status Signal Object
1187 */
1189
1190 /**
1191 * \brief App Build Version number.
1192 *
1193 * - Minimum Value: 0
1194 * - Maximum Value: 255
1195 * - Default Value: 0
1196 * - Units:
1197 *
1198 * Default Rates:
1199 * - CAN: 4.0 Hz
1200 *
1201 * This refreshes and returns a cached StatusSignal object.
1202 *
1203 * \param refresh Whether to refresh the StatusSignal before returning it;
1204 * defaults to true
1205 * \returns VersionBuild Status Signal Object
1206 */
1207 StatusSignal<int> &GetVersionBuild(bool refresh = true);
1208
1209 /**
1210 * \brief Full Version of firmware in device. The format is a four
1211 * byte value.
1212 *
1213 * - Minimum Value: 0
1214 * - Maximum Value: 4294967295
1215 * - Default Value: 0
1216 * - Units:
1217 *
1218 * Default Rates:
1219 * - CAN: 4.0 Hz
1220 *
1221 * This refreshes and returns a cached StatusSignal object.
1222 *
1223 * \param refresh Whether to refresh the StatusSignal before returning it;
1224 * defaults to true
1225 * \returns Version Status Signal Object
1226 */
1227 StatusSignal<int> &GetVersion(bool refresh = true);
1228
1229 /**
1230 * \brief Integer representing all fault flags reported by the device.
1231 *
1232 * \details These are device specific and are not used directly in
1233 * typical applications. Use the signal specific GetFault_*() methods
1234 * instead.
1235 *
1236 * - Minimum Value: 0
1237 * - Maximum Value: 4294967295
1238 * - Default Value: 0
1239 * - Units:
1240 *
1241 * Default Rates:
1242 * - CAN: 4.0 Hz
1243 *
1244 * This refreshes and returns a cached StatusSignal object.
1245 *
1246 * \param refresh Whether to refresh the StatusSignal before returning it;
1247 * defaults to true
1248 * \returns FaultField Status Signal Object
1249 */
1250 StatusSignal<int> &GetFaultField(bool refresh = true);
1251
1252 /**
1253 * \brief Integer representing all (persistent) sticky fault flags
1254 * reported by the device.
1255 *
1256 * \details These are device specific and are not used directly in
1257 * typical applications. Use the signal specific GetStickyFault_*()
1258 * methods instead.
1259 *
1260 * - Minimum Value: 0
1261 * - Maximum Value: 4294967295
1262 * - Default Value: 0
1263 * - Units:
1264 *
1265 * Default Rates:
1266 * - CAN: 4.0 Hz
1267 *
1268 * This refreshes and returns a cached StatusSignal object.
1269 *
1270 * \param refresh Whether to refresh the StatusSignal before returning it;
1271 * defaults to true
1272 * \returns StickyFaultField Status Signal Object
1273 */
1275
1276 /**
1277 * \brief Current reported yaw of the Pigeon2.
1278 *
1279 * - Minimum Value: -368640.0
1280 * - Maximum Value: 368639.99725341797
1281 * - Default Value: 0
1282 * - Units: deg
1283 *
1284 * Default Rates:
1285 * - CAN 2.0: 100.0 Hz
1286 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1287 *
1288 * This refreshes and returns a cached StatusSignal object.
1289 *
1290 * \param refresh Whether to refresh the StatusSignal before returning it;
1291 * defaults to true
1292 * \returns Yaw Status Signal Object
1293 */
1295
1296 /**
1297 * \brief Current reported pitch of the Pigeon2.
1298 *
1299 * - Minimum Value: -90.0
1300 * - Maximum Value: 89.9560546875
1301 * - Default Value: 0
1302 * - Units: deg
1303 *
1304 * Default Rates:
1305 * - CAN 2.0: 100.0 Hz
1306 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1307 *
1308 * This refreshes and returns a cached StatusSignal object.
1309 *
1310 * \param refresh Whether to refresh the StatusSignal before returning it;
1311 * defaults to true
1312 * \returns Pitch Status Signal Object
1313 */
1315
1316 /**
1317 * \brief Current reported roll of the Pigeon2.
1318 *
1319 * - Minimum Value: -180.0
1320 * - Maximum Value: 179.9560546875
1321 * - Default Value: 0
1322 * - Units: deg
1323 *
1324 * Default Rates:
1325 * - CAN 2.0: 100.0 Hz
1326 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1327 *
1328 * This refreshes and returns a cached StatusSignal object.
1329 *
1330 * \param refresh Whether to refresh the StatusSignal before returning it;
1331 * defaults to true
1332 * \returns Roll Status Signal Object
1333 */
1335
1336 /**
1337 * \brief The W component of the reported Quaternion.
1338 *
1339 * - Minimum Value: -1.0001220852154804
1340 * - Maximum Value: 1.0
1341 * - Default Value: 0
1342 * - Units:
1343 *
1344 * Default Rates:
1345 * - CAN 2.0: 50.0 Hz
1346 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1347 *
1348 * This refreshes and returns a cached StatusSignal object.
1349 *
1350 * \param refresh Whether to refresh the StatusSignal before returning it;
1351 * defaults to true
1352 * \returns QuatW Status Signal Object
1353 */
1355
1356 /**
1357 * \brief The X component of the reported Quaternion.
1358 *
1359 * - Minimum Value: -1.0001220852154804
1360 * - Maximum Value: 1.0
1361 * - Default Value: 0
1362 * - Units:
1363 *
1364 * Default Rates:
1365 * - CAN 2.0: 50.0 Hz
1366 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1367 *
1368 * This refreshes and returns a cached StatusSignal object.
1369 *
1370 * \param refresh Whether to refresh the StatusSignal before returning it;
1371 * defaults to true
1372 * \returns QuatX Status Signal Object
1373 */
1375
1376 /**
1377 * \brief The Y component of the reported Quaternion.
1378 *
1379 * - Minimum Value: -1.0001220852154804
1380 * - Maximum Value: 1.0
1381 * - Default Value: 0
1382 * - Units:
1383 *
1384 * Default Rates:
1385 * - CAN 2.0: 50.0 Hz
1386 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1387 *
1388 * This refreshes and returns a cached StatusSignal object.
1389 *
1390 * \param refresh Whether to refresh the StatusSignal before returning it;
1391 * defaults to true
1392 * \returns QuatY Status Signal Object
1393 */
1395
1396 /**
1397 * \brief The Z component of the reported Quaternion.
1398 *
1399 * - Minimum Value: -1.0001220852154804
1400 * - Maximum Value: 1.0
1401 * - Default Value: 0
1402 * - Units:
1403 *
1404 * Default Rates:
1405 * - CAN 2.0: 50.0 Hz
1406 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1407 *
1408 * This refreshes and returns a cached StatusSignal object.
1409 *
1410 * \param refresh Whether to refresh the StatusSignal before returning it;
1411 * defaults to true
1412 * \returns QuatZ Status Signal Object
1413 */
1415
1416 /**
1417 * \brief The X component of the gravity vector.
1418 *
1419 * \details This is the X component of the reported gravity-vector.
1420 * The gravity vector is not the acceleration experienced by the
1421 * Pigeon2, rather it is where the Pigeon2 believes "Down" is. This
1422 * can be used for mechanisms that are linearly related to gravity,
1423 * such as an arm pivoting about a point, as the contribution of
1424 * gravity to the arm is directly proportional to the contribution of
1425 * gravity about one of these primary axis.
1426 *
1427 * - Minimum Value: -1.000030518509476
1428 * - Maximum Value: 1.0
1429 * - Default Value: 0
1430 * - Units:
1431 *
1432 * Default Rates:
1433 * - CAN 2.0: 10.0 Hz
1434 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1435 *
1436 * This refreshes and returns a cached StatusSignal object.
1437 *
1438 * \param refresh Whether to refresh the StatusSignal before returning it;
1439 * defaults to true
1440 * \returns GravityVectorX Status Signal Object
1441 */
1443
1444 /**
1445 * \brief The Y component of the gravity vector.
1446 *
1447 * \details This is the X component of the reported gravity-vector.
1448 * The gravity vector is not the acceleration experienced by the
1449 * Pigeon2, rather it is where the Pigeon2 believes "Down" is. This
1450 * can be used for mechanisms that are linearly related to gravity,
1451 * such as an arm pivoting about a point, as the contribution of
1452 * gravity to the arm is directly proportional to the contribution of
1453 * gravity about one of these primary axis.
1454 *
1455 * - Minimum Value: -1.000030518509476
1456 * - Maximum Value: 1.0
1457 * - Default Value: 0
1458 * - Units:
1459 *
1460 * Default Rates:
1461 * - CAN 2.0: 10.0 Hz
1462 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1463 *
1464 * This refreshes and returns a cached StatusSignal object.
1465 *
1466 * \param refresh Whether to refresh the StatusSignal before returning it;
1467 * defaults to true
1468 * \returns GravityVectorY Status Signal Object
1469 */
1471
1472 /**
1473 * \brief The Z component of the gravity vector.
1474 *
1475 * \details This is the Z component of the reported gravity-vector.
1476 * The gravity vector is not the acceleration experienced by the
1477 * Pigeon2, rather it is where the Pigeon2 believes "Down" is. This
1478 * can be used for mechanisms that are linearly related to gravity,
1479 * such as an arm pivoting about a point, as the contribution of
1480 * gravity to the arm is directly proportional to the contribution of
1481 * gravity about one of these primary axis.
1482 *
1483 * - Minimum Value: -1.000030518509476
1484 * - Maximum Value: 1.0
1485 * - Default Value: 0
1486 * - Units:
1487 *
1488 * Default Rates:
1489 * - CAN 2.0: 10.0 Hz
1490 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1491 *
1492 * This refreshes and returns a cached StatusSignal object.
1493 *
1494 * \param refresh Whether to refresh the StatusSignal before returning it;
1495 * defaults to true
1496 * \returns GravityVectorZ Status Signal Object
1497 */
1499
1500 /**
1501 * \brief Temperature of the Pigeon 2.
1502 *
1503 * - Minimum Value: -128.0
1504 * - Maximum Value: 127.99609375
1505 * - Default Value: 0
1506 * - Units: ℃
1507 *
1508 * Default Rates:
1509 * - CAN 2.0: 4.0 Hz
1510 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1511 *
1512 * This refreshes and returns a cached StatusSignal object.
1513 *
1514 * \param refresh Whether to refresh the StatusSignal before returning it;
1515 * defaults to true
1516 * \returns Temperature Status Signal Object
1517 */
1519
1520 /**
1521 * \brief Whether the no-motion calibration feature is enabled.
1522 *
1523 * - Default Value: 0
1524 *
1525 * Default Rates:
1526 * - CAN 2.0: 4.0 Hz
1527 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1528 *
1529 * This refreshes and returns a cached StatusSignal object.
1530 *
1531 * \param refresh Whether to refresh the StatusSignal before returning it;
1532 * defaults to true
1533 * \returns NoMotionEnabled Status Signal Object
1534 */
1536
1537 /**
1538 * \brief The number of times a no-motion event occurred, wraps at 15.
1539 *
1540 * - Minimum Value: 0
1541 * - Maximum Value: 15
1542 * - Default Value: 0
1543 * - Units:
1544 *
1545 * Default Rates:
1546 * - CAN 2.0: 4.0 Hz
1547 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1548 *
1549 * This refreshes and returns a cached StatusSignal object.
1550 *
1551 * \param refresh Whether to refresh the StatusSignal before returning it;
1552 * defaults to true
1553 * \returns NoMotionCount Status Signal Object
1554 */
1556
1557 /**
1558 * \brief Whether the temperature-compensation feature is disabled.
1559 *
1560 * - Default Value: 0
1561 *
1562 * Default Rates:
1563 * - CAN 2.0: 4.0 Hz
1564 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1565 *
1566 * This refreshes and returns a cached StatusSignal object.
1567 *
1568 * \param refresh Whether to refresh the StatusSignal before returning it;
1569 * defaults to true
1570 * \returns TemperatureCompensationDisabled Status Signal Object
1571 */
1573
1574 /**
1575 * \brief How long the Pigeon 2's been up in seconds, caps at 255
1576 * seconds.
1577 *
1578 * - Minimum Value: 0
1579 * - Maximum Value: 255
1580 * - Default Value: 0
1581 * - Units: s
1582 *
1583 * Default Rates:
1584 * - CAN 2.0: 4.0 Hz
1585 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1586 *
1587 * This refreshes and returns a cached StatusSignal object.
1588 *
1589 * \param refresh Whether to refresh the StatusSignal before returning it;
1590 * defaults to true
1591 * \returns UpTime Status Signal Object
1592 */
1594
1595 /**
1596 * \brief The accumulated gyro about the X axis without any sensor
1597 * fusing.
1598 *
1599 * - Minimum Value: -23040.0
1600 * - Maximum Value: 23039.9560546875
1601 * - Default Value: 0
1602 * - Units: deg
1603 *
1604 * Default Rates:
1605 * - CAN 2.0: 4.0 Hz
1606 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1607 *
1608 * This refreshes and returns a cached StatusSignal object.
1609 *
1610 * \param refresh Whether to refresh the StatusSignal before returning it;
1611 * defaults to true
1612 * \returns AccumGyroX Status Signal Object
1613 */
1615
1616 /**
1617 * \brief The accumulated gyro about the Y axis without any sensor
1618 * fusing.
1619 *
1620 * - Minimum Value: -23040.0
1621 * - Maximum Value: 23039.9560546875
1622 * - Default Value: 0
1623 * - Units: deg
1624 *
1625 * Default Rates:
1626 * - CAN 2.0: 4.0 Hz
1627 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1628 *
1629 * This refreshes and returns a cached StatusSignal object.
1630 *
1631 * \param refresh Whether to refresh the StatusSignal before returning it;
1632 * defaults to true
1633 * \returns AccumGyroY Status Signal Object
1634 */
1636
1637 /**
1638 * \brief The accumulated gyro about the Z axis without any sensor
1639 * fusing.
1640 *
1641 * - Minimum Value: -23040.0
1642 * - Maximum Value: 23039.9560546875
1643 * - Default Value: 0
1644 * - Units: deg
1645 *
1646 * Default Rates:
1647 * - CAN 2.0: 4.0 Hz
1648 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1649 *
1650 * This refreshes and returns a cached StatusSignal object.
1651 *
1652 * \param refresh Whether to refresh the StatusSignal before returning it;
1653 * defaults to true
1654 * \returns AccumGyroZ Status Signal Object
1655 */
1657
1658 /**
1659 * \brief The angular velocity (ω) of the Pigeon 2 about the X axis
1660 * with respect to the world frame. This value is mount-calibrated.
1661 *
1662 * - Minimum Value: -2048.0
1663 * - Maximum Value: 2047.99609375
1664 * - Default Value: 0
1665 * - Units: dps
1666 *
1667 * Default Rates:
1668 * - CAN 2.0: 10.0 Hz
1669 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1670 *
1671 * This refreshes and returns a cached StatusSignal object.
1672 *
1673 * \param refresh Whether to refresh the StatusSignal before returning it;
1674 * defaults to true
1675 * \returns AngularVelocityXWorld Status Signal Object
1676 */
1678
1679 /**
1680 * \brief The angular velocity (ω) of the Pigeon 2 about the Y axis
1681 * with respect to the world frame. This value is mount-calibrated.
1682 *
1683 * - Minimum Value: -2048.0
1684 * - Maximum Value: 2047.99609375
1685 * - Default Value: 0
1686 * - Units: dps
1687 *
1688 * Default Rates:
1689 * - CAN 2.0: 10.0 Hz
1690 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1691 *
1692 * This refreshes and returns a cached StatusSignal object.
1693 *
1694 * \param refresh Whether to refresh the StatusSignal before returning it;
1695 * defaults to true
1696 * \returns AngularVelocityYWorld Status Signal Object
1697 */
1699
1700 /**
1701 * \brief The angular velocity (ω) of the Pigeon 2 about the Z axis
1702 * with respect to the world frame. This value is mount-calibrated.
1703 *
1704 * - Minimum Value: -2048.0
1705 * - Maximum Value: 2047.99609375
1706 * - Default Value: 0
1707 * - Units: dps
1708 *
1709 * Default Rates:
1710 * - CAN 2.0: 10.0 Hz
1711 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1712 *
1713 * This refreshes and returns a cached StatusSignal object.
1714 *
1715 * \param refresh Whether to refresh the StatusSignal before returning it;
1716 * defaults to true
1717 * \returns AngularVelocityZWorld Status Signal Object
1718 */
1720
1721 /**
1722 * \brief The acceleration measured by Pigeon2 in the X direction.
1723 *
1724 * \details This value includes the acceleration due to gravity. If
1725 * this is undesirable, get the gravity vector and subtract out the
1726 * contribution in this direction.
1727 *
1728 * - Minimum Value: -2.0
1729 * - Maximum Value: 1.99993896484375
1730 * - Default Value: 0
1731 * - Units: g
1732 *
1733 * Default Rates:
1734 * - CAN 2.0: 10.0 Hz
1735 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1736 *
1737 * This refreshes and returns a cached StatusSignal object.
1738 *
1739 * \param refresh Whether to refresh the StatusSignal before returning it;
1740 * defaults to true
1741 * \returns AccelerationX Status Signal Object
1742 */
1744
1745 /**
1746 * \brief The acceleration measured by Pigeon2 in the Y direction.
1747 *
1748 * \details This value includes the acceleration due to gravity. If
1749 * this is undesirable, get the gravity vector and subtract out the
1750 * contribution in this direction.
1751 *
1752 * - Minimum Value: -2.0
1753 * - Maximum Value: 1.99993896484375
1754 * - Default Value: 0
1755 * - Units: g
1756 *
1757 * Default Rates:
1758 * - CAN 2.0: 10.0 Hz
1759 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1760 *
1761 * This refreshes and returns a cached StatusSignal object.
1762 *
1763 * \param refresh Whether to refresh the StatusSignal before returning it;
1764 * defaults to true
1765 * \returns AccelerationY Status Signal Object
1766 */
1768
1769 /**
1770 * \brief The acceleration measured by Pigeon2 in the Z direction.
1771 *
1772 * \details This value includes the acceleration due to gravity. If
1773 * this is undesirable, get the gravity vector and subtract out the
1774 * contribution in this direction.
1775 *
1776 * - Minimum Value: -2.0
1777 * - Maximum Value: 1.99993896484375
1778 * - Default Value: 0
1779 * - Units: g
1780 *
1781 * Default Rates:
1782 * - CAN 2.0: 10.0 Hz
1783 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1784 *
1785 * This refreshes and returns a cached StatusSignal object.
1786 *
1787 * \param refresh Whether to refresh the StatusSignal before returning it;
1788 * defaults to true
1789 * \returns AccelerationZ Status Signal Object
1790 */
1792
1793 /**
1794 * \brief Measured supply voltage to the Pigeon2.
1795 *
1796 * - Minimum Value: 0.0
1797 * - Maximum Value: 31.99951171875
1798 * - Default Value: 0
1799 * - Units: V
1800 *
1801 * Default Rates:
1802 * - CAN 2.0: 4.0 Hz
1803 * - CAN FD: 100.0 Hz (TimeSynced with Pro)
1804 *
1805 * This refreshes and returns a cached StatusSignal object.
1806 *
1807 * \param refresh Whether to refresh the StatusSignal before returning it;
1808 * defaults to true
1809 * \returns SupplyVoltage Status Signal Object
1810 */
1812
1813 /**
1814 * \brief The angular velocity (ω) of the Pigeon 2 about the device's
1815 * X axis.
1816 *
1817 * \details This value is not mount-calibrated.
1818 *
1819 * - Minimum Value: -1998.048780487805
1820 * - Maximum Value: 1997.987804878049
1821 * - Default Value: 0
1822 * - Units: dps
1823 *
1824 * Default Rates:
1825 * - CAN: 4.0 Hz
1826 *
1827 * This refreshes and returns a cached StatusSignal object.
1828 *
1829 * \param refresh Whether to refresh the StatusSignal before returning it;
1830 * defaults to true
1831 * \returns AngularVelocityXDevice Status Signal Object
1832 */
1834
1835 /**
1836 * \brief The angular velocity (ω) of the Pigeon 2 about the device's
1837 * Y axis.
1838 *
1839 * \details This value is not mount-calibrated.
1840 *
1841 * - Minimum Value: -1998.048780487805
1842 * - Maximum Value: 1997.987804878049
1843 * - Default Value: 0
1844 * - Units: dps
1845 *
1846 * Default Rates:
1847 * - CAN: 4.0 Hz
1848 *
1849 * This refreshes and returns a cached StatusSignal object.
1850 *
1851 * \param refresh Whether to refresh the StatusSignal before returning it;
1852 * defaults to true
1853 * \returns AngularVelocityYDevice Status Signal Object
1854 */
1856
1857 /**
1858 * \brief The angular velocity (ω) of the Pigeon 2 about the device's
1859 * Z axis.
1860 *
1861 * \details This value is not mount-calibrated.
1862 *
1863 * - Minimum Value: -1998.048780487805
1864 * - Maximum Value: 1997.987804878049
1865 * - Default Value: 0
1866 * - Units: dps
1867 *
1868 * Default Rates:
1869 * - CAN: 4.0 Hz
1870 *
1871 * This refreshes and returns a cached StatusSignal object.
1872 *
1873 * \param refresh Whether to refresh the StatusSignal before returning it;
1874 * defaults to true
1875 * \returns AngularVelocityZDevice Status Signal Object
1876 */
1878
1879 /**
1880 * \brief The biased magnitude of the magnetic field measured by the
1881 * Pigeon 2 in the X direction. This is only valid after performing a
1882 * magnetometer calibration.
1883 *
1884 * - Minimum Value: -19660.8
1885 * - Maximum Value: 19660.2
1886 * - Default Value: 0
1887 * - Units: uT
1888 *
1889 * Default Rates:
1890 * - CAN: 4.0 Hz
1891 *
1892 * This refreshes and returns a cached StatusSignal object.
1893 *
1894 * \param refresh Whether to refresh the StatusSignal before returning it;
1895 * defaults to true
1896 * \returns MagneticFieldX Status Signal Object
1897 */
1899
1900 /**
1901 * \brief The biased magnitude of the magnetic field measured by the
1902 * Pigeon 2 in the Y direction. This is only valid after performing a
1903 * magnetometer calibration.
1904 *
1905 * - Minimum Value: -19660.8
1906 * - Maximum Value: 19660.2
1907 * - Default Value: 0
1908 * - Units: uT
1909 *
1910 * Default Rates:
1911 * - CAN: 4.0 Hz
1912 *
1913 * This refreshes and returns a cached StatusSignal object.
1914 *
1915 * \param refresh Whether to refresh the StatusSignal before returning it;
1916 * defaults to true
1917 * \returns MagneticFieldY Status Signal Object
1918 */
1920
1921 /**
1922 * \brief The biased magnitude of the magnetic field measured by the
1923 * Pigeon 2 in the Z direction. This is only valid after performing a
1924 * magnetometer calibration.
1925 *
1926 * - Minimum Value: -19660.8
1927 * - Maximum Value: 19660.2
1928 * - Default Value: 0
1929 * - Units: uT
1930 *
1931 * Default Rates:
1932 * - CAN: 4.0 Hz
1933 *
1934 * This refreshes and returns a cached StatusSignal object.
1935 *
1936 * \param refresh Whether to refresh the StatusSignal before returning it;
1937 * defaults to true
1938 * \returns MagneticFieldZ Status Signal Object
1939 */
1941
1942 /**
1943 * \brief The raw magnitude of the magnetic field measured by the
1944 * Pigeon 2 in the X direction. This is only valid after performing a
1945 * magnetometer calibration.
1946 *
1947 * - Minimum Value: -19660.8
1948 * - Maximum Value: 19660.2
1949 * - Default Value: 0
1950 * - Units: uT
1951 *
1952 * Default Rates:
1953 * - CAN: 4.0 Hz
1954 *
1955 * This refreshes and returns a cached StatusSignal object.
1956 *
1957 * \param refresh Whether to refresh the StatusSignal before returning it;
1958 * defaults to true
1959 * \returns RawMagneticFieldX Status Signal Object
1960 */
1962
1963 /**
1964 * \brief The raw magnitude of the magnetic field measured by the
1965 * Pigeon 2 in the Y direction. This is only valid after performing a
1966 * magnetometer calibration.
1967 *
1968 * - Minimum Value: -19660.8
1969 * - Maximum Value: 19660.2
1970 * - Default Value: 0
1971 * - Units: uT
1972 *
1973 * Default Rates:
1974 * - CAN: 4.0 Hz
1975 *
1976 * This refreshes and returns a cached StatusSignal object.
1977 *
1978 * \param refresh Whether to refresh the StatusSignal before returning it;
1979 * defaults to true
1980 * \returns RawMagneticFieldY Status Signal Object
1981 */
1983
1984 /**
1985 * \brief The raw magnitude of the magnetic field measured by the
1986 * Pigeon 2 in the Z direction. This is only valid after performing a
1987 * magnetometer calibration.
1988 *
1989 * - Minimum Value: -19660.8
1990 * - Maximum Value: 19660.2
1991 * - Default Value: 0
1992 * - Units: uT
1993 *
1994 * Default Rates:
1995 * - CAN: 4.0 Hz
1996 *
1997 * This refreshes and returns a cached StatusSignal object.
1998 *
1999 * \param refresh Whether to refresh the StatusSignal before returning it;
2000 * defaults to true
2001 * \returns RawMagneticFieldZ Status Signal Object
2002 */
2004
2005 /**
2006 * \brief Whether the device is Phoenix Pro licensed.
2007 *
2008 * - Default Value: False
2009 *
2010 * Default Rates:
2011 * - CAN: 4.0 Hz
2012 *
2013 * This refreshes and returns a cached StatusSignal object.
2014 *
2015 * \param refresh Whether to refresh the StatusSignal before returning it;
2016 * defaults to true
2017 * \returns IsProLicensed Status Signal Object
2018 */
2020
2021 /**
2022 * \brief Hardware fault occurred
2023 *
2024 * - Default Value: False
2025 *
2026 * Default Rates:
2027 * - CAN: 4.0 Hz
2028 *
2029 * This refreshes and returns a cached StatusSignal object.
2030 *
2031 * \param refresh Whether to refresh the StatusSignal before returning it;
2032 * defaults to true
2033 * \returns Fault_Hardware Status Signal Object
2034 */
2036
2037 /**
2038 * \brief Hardware fault occurred
2039 *
2040 * - Default Value: False
2041 *
2042 * Default Rates:
2043 * - CAN: 4.0 Hz
2044 *
2045 * This refreshes and returns a cached StatusSignal object.
2046 *
2047 * \param refresh Whether to refresh the StatusSignal before returning it;
2048 * defaults to true
2049 * \returns StickyFault_Hardware Status Signal Object
2050 */
2052
2053 /**
2054 * \brief Device supply voltage dropped to near brownout levels
2055 *
2056 * - Default Value: False
2057 *
2058 * Default Rates:
2059 * - CAN: 4.0 Hz
2060 *
2061 * This refreshes and returns a cached StatusSignal object.
2062 *
2063 * \param refresh Whether to refresh the StatusSignal before returning it;
2064 * defaults to true
2065 * \returns Fault_Undervoltage Status Signal Object
2066 */
2068
2069 /**
2070 * \brief Device supply voltage dropped to near brownout levels
2071 *
2072 * - Default Value: False
2073 *
2074 * Default Rates:
2075 * - CAN: 4.0 Hz
2076 *
2077 * This refreshes and returns a cached StatusSignal object.
2078 *
2079 * \param refresh Whether to refresh the StatusSignal before returning it;
2080 * defaults to true
2081 * \returns StickyFault_Undervoltage Status Signal Object
2082 */
2084
2085 /**
2086 * \brief Device boot while detecting the enable signal
2087 *
2088 * - Default Value: False
2089 *
2090 * Default Rates:
2091 * - CAN: 4.0 Hz
2092 *
2093 * This refreshes and returns a cached StatusSignal object.
2094 *
2095 * \param refresh Whether to refresh the StatusSignal before returning it;
2096 * defaults to true
2097 * \returns Fault_BootDuringEnable Status Signal Object
2098 */
2100
2101 /**
2102 * \brief Device boot while detecting the enable signal
2103 *
2104 * - Default Value: False
2105 *
2106 * Default Rates:
2107 * - CAN: 4.0 Hz
2108 *
2109 * This refreshes and returns a cached StatusSignal object.
2110 *
2111 * \param refresh Whether to refresh the StatusSignal before returning it;
2112 * defaults to true
2113 * \returns StickyFault_BootDuringEnable Status Signal Object
2114 */
2116
2117 /**
2118 * \brief An unlicensed feature is in use, device may not behave as
2119 * expected.
2120 *
2121 * - Default Value: False
2122 *
2123 * Default Rates:
2124 * - CAN: 4.0 Hz
2125 *
2126 * This refreshes and returns a cached StatusSignal object.
2127 *
2128 * \param refresh Whether to refresh the StatusSignal before returning it;
2129 * defaults to true
2130 * \returns Fault_UnlicensedFeatureInUse Status Signal Object
2131 */
2133
2134 /**
2135 * \brief An unlicensed feature is in use, device may not behave as
2136 * expected.
2137 *
2138 * - Default Value: False
2139 *
2140 * Default Rates:
2141 * - CAN: 4.0 Hz
2142 *
2143 * This refreshes and returns a cached StatusSignal object.
2144 *
2145 * \param refresh Whether to refresh the StatusSignal before returning it;
2146 * defaults to true
2147 * \returns StickyFault_UnlicensedFeatureInUse Status Signal Object
2148 */
2150
2151 /**
2152 * \brief Bootup checks failed: Accelerometer
2153 *
2154 * - Default Value: False
2155 *
2156 * Default Rates:
2157 * - CAN: 4.0 Hz
2158 *
2159 * This refreshes and returns a cached StatusSignal object.
2160 *
2161 * \param refresh Whether to refresh the StatusSignal before returning it;
2162 * defaults to true
2163 * \returns Fault_BootupAccelerometer Status Signal Object
2164 */
2166
2167 /**
2168 * \brief Bootup checks failed: Accelerometer
2169 *
2170 * - Default Value: False
2171 *
2172 * Default Rates:
2173 * - CAN: 4.0 Hz
2174 *
2175 * This refreshes and returns a cached StatusSignal object.
2176 *
2177 * \param refresh Whether to refresh the StatusSignal before returning it;
2178 * defaults to true
2179 * \returns StickyFault_BootupAccelerometer Status Signal Object
2180 */
2182
2183 /**
2184 * \brief Bootup checks failed: Gyroscope
2185 *
2186 * - Default Value: False
2187 *
2188 * Default Rates:
2189 * - CAN: 4.0 Hz
2190 *
2191 * This refreshes and returns a cached StatusSignal object.
2192 *
2193 * \param refresh Whether to refresh the StatusSignal before returning it;
2194 * defaults to true
2195 * \returns Fault_BootupGyroscope Status Signal Object
2196 */
2198
2199 /**
2200 * \brief Bootup checks failed: Gyroscope
2201 *
2202 * - Default Value: False
2203 *
2204 * Default Rates:
2205 * - CAN: 4.0 Hz
2206 *
2207 * This refreshes and returns a cached StatusSignal object.
2208 *
2209 * \param refresh Whether to refresh the StatusSignal before returning it;
2210 * defaults to true
2211 * \returns StickyFault_BootupGyroscope Status Signal Object
2212 */
2214
2215 /**
2216 * \brief Bootup checks failed: Magnetometer
2217 *
2218 * - Default Value: False
2219 *
2220 * Default Rates:
2221 * - CAN: 4.0 Hz
2222 *
2223 * This refreshes and returns a cached StatusSignal object.
2224 *
2225 * \param refresh Whether to refresh the StatusSignal before returning it;
2226 * defaults to true
2227 * \returns Fault_BootupMagnetometer Status Signal Object
2228 */
2230
2231 /**
2232 * \brief Bootup checks failed: Magnetometer
2233 *
2234 * - Default Value: False
2235 *
2236 * Default Rates:
2237 * - CAN: 4.0 Hz
2238 *
2239 * This refreshes and returns a cached StatusSignal object.
2240 *
2241 * \param refresh Whether to refresh the StatusSignal before returning it;
2242 * defaults to true
2243 * \returns StickyFault_BootupMagnetometer Status Signal Object
2244 */
2246
2247 /**
2248 * \brief Motion Detected during bootup.
2249 *
2250 * - Default Value: False
2251 *
2252 * Default Rates:
2253 * - CAN: 4.0 Hz
2254 *
2255 * This refreshes and returns a cached StatusSignal object.
2256 *
2257 * \param refresh Whether to refresh the StatusSignal before returning it;
2258 * defaults to true
2259 * \returns Fault_BootIntoMotion Status Signal Object
2260 */
2262
2263 /**
2264 * \brief Motion Detected during bootup.
2265 *
2266 * - Default Value: False
2267 *
2268 * Default Rates:
2269 * - CAN: 4.0 Hz
2270 *
2271 * This refreshes and returns a cached StatusSignal object.
2272 *
2273 * \param refresh Whether to refresh the StatusSignal before returning it;
2274 * defaults to true
2275 * \returns StickyFault_BootIntoMotion Status Signal Object
2276 */
2278
2279 /**
2280 * \brief Motion stack data acquisition was slower than expected
2281 *
2282 * - Default Value: False
2283 *
2284 * Default Rates:
2285 * - CAN: 4.0 Hz
2286 *
2287 * This refreshes and returns a cached StatusSignal object.
2288 *
2289 * \param refresh Whether to refresh the StatusSignal before returning it;
2290 * defaults to true
2291 * \returns Fault_DataAcquiredLate Status Signal Object
2292 */
2294
2295 /**
2296 * \brief Motion stack data acquisition was slower than expected
2297 *
2298 * - Default Value: False
2299 *
2300 * Default Rates:
2301 * - CAN: 4.0 Hz
2302 *
2303 * This refreshes and returns a cached StatusSignal object.
2304 *
2305 * \param refresh Whether to refresh the StatusSignal before returning it;
2306 * defaults to true
2307 * \returns StickyFault_DataAcquiredLate Status Signal Object
2308 */
2310
2311 /**
2312 * \brief Motion stack loop time was slower than expected.
2313 *
2314 * - Default Value: False
2315 *
2316 * Default Rates:
2317 * - CAN: 4.0 Hz
2318 *
2319 * This refreshes and returns a cached StatusSignal object.
2320 *
2321 * \param refresh Whether to refresh the StatusSignal before returning it;
2322 * defaults to true
2323 * \returns Fault_LoopTimeSlow Status Signal Object
2324 */
2326
2327 /**
2328 * \brief Motion stack loop time was slower than expected.
2329 *
2330 * - Default Value: False
2331 *
2332 * Default Rates:
2333 * - CAN: 4.0 Hz
2334 *
2335 * This refreshes and returns a cached StatusSignal object.
2336 *
2337 * \param refresh Whether to refresh the StatusSignal before returning it;
2338 * defaults to true
2339 * \returns StickyFault_LoopTimeSlow Status Signal Object
2340 */
2342
2343 /**
2344 * \brief Magnetometer values are saturated
2345 *
2346 * - Default Value: False
2347 *
2348 * Default Rates:
2349 * - CAN: 4.0 Hz
2350 *
2351 * This refreshes and returns a cached StatusSignal object.
2352 *
2353 * \param refresh Whether to refresh the StatusSignal before returning it;
2354 * defaults to true
2355 * \returns Fault_SaturatedMagnetometer Status Signal Object
2356 */
2358
2359 /**
2360 * \brief Magnetometer values are saturated
2361 *
2362 * - Default Value: False
2363 *
2364 * Default Rates:
2365 * - CAN: 4.0 Hz
2366 *
2367 * This refreshes and returns a cached StatusSignal object.
2368 *
2369 * \param refresh Whether to refresh the StatusSignal before returning it;
2370 * defaults to true
2371 * \returns StickyFault_SaturatedMagnetometer Status Signal Object
2372 */
2374
2375 /**
2376 * \brief Accelerometer values are saturated
2377 *
2378 * - Default Value: False
2379 *
2380 * Default Rates:
2381 * - CAN: 4.0 Hz
2382 *
2383 * This refreshes and returns a cached StatusSignal object.
2384 *
2385 * \param refresh Whether to refresh the StatusSignal before returning it;
2386 * defaults to true
2387 * \returns Fault_SaturatedAccelerometer Status Signal Object
2388 */
2390
2391 /**
2392 * \brief Accelerometer values are saturated
2393 *
2394 * - Default Value: False
2395 *
2396 * Default Rates:
2397 * - CAN: 4.0 Hz
2398 *
2399 * This refreshes and returns a cached StatusSignal object.
2400 *
2401 * \param refresh Whether to refresh the StatusSignal before returning it;
2402 * defaults to true
2403 * \returns StickyFault_SaturatedAccelerometer Status Signal Object
2404 */
2406
2407 /**
2408 * \brief Gyroscope values are saturated
2409 *
2410 * - Default Value: False
2411 *
2412 * Default Rates:
2413 * - CAN: 4.0 Hz
2414 *
2415 * This refreshes and returns a cached StatusSignal object.
2416 *
2417 * \param refresh Whether to refresh the StatusSignal before returning it;
2418 * defaults to true
2419 * \returns Fault_SaturatedGyroscope Status Signal Object
2420 */
2422
2423 /**
2424 * \brief Gyroscope values are saturated
2425 *
2426 * - Default Value: False
2427 *
2428 * Default Rates:
2429 * - CAN: 4.0 Hz
2430 *
2431 * This refreshes and returns a cached StatusSignal object.
2432 *
2433 * \param refresh Whether to refresh the StatusSignal before returning it;
2434 * defaults to true
2435 * \returns StickyFault_SaturatedGyroscope Status Signal Object
2436 */
2438
2439
2440
2441
2442 /**
2443 * \brief The yaw to set the Pigeon2 to right now.
2444 *
2445 * \param newValue Value to set to. Units are in deg.
2446 * \param timeoutSeconds Maximum time to wait up to in seconds.
2447 * \returns StatusCode of the set command
2448 */
2449 ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue, wpi::units::second_t timeoutSeconds)
2450 {
2451 return GetConfigurator().SetYaw(newValue, timeoutSeconds);
2452 }
2453 /**
2454 * \brief The yaw to set the Pigeon2 to right now.
2455 *
2456 * This will wait up to 0.100 seconds (100ms) by default.
2457 *
2458 * \param newValue Value to set to. Units are in deg.
2459 * \returns StatusCode of the set command
2460 */
2461 ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue)
2462 {
2463 return SetYaw(newValue, 0.100_s);
2464 }
2465
2466 /**
2467 * \brief Clear the sticky faults in the device.
2468 *
2469 * \details This typically has no impact on the device functionality.
2470 * Instead, it just clears telemetry faults that are accessible via
2471 * API and Tuner Self-Test.
2472 *
2473 * \param timeoutSeconds Maximum time to wait up to in seconds.
2474 * \returns StatusCode of the set command
2475 */
2476 ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
2477 {
2478 return GetConfigurator().ClearStickyFaults(timeoutSeconds);
2479 }
2480 /**
2481 * \brief Clear the sticky faults in the device.
2482 *
2483 * \details This typically has no impact on the device functionality.
2484 * Instead, it just clears telemetry faults that are accessible via
2485 * API and Tuner Self-Test.
2486 *
2487 * This will wait up to 0.100 seconds (100ms) by default.
2488 *
2489 * \returns StatusCode of the set command
2490 */
2495
2496 /**
2497 * \brief Clear sticky fault: Hardware fault occurred
2498 *
2499 * \param timeoutSeconds Maximum time to wait up to in seconds.
2500 * \returns StatusCode of the set command
2501 */
2502 ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
2503 {
2504 return GetConfigurator().ClearStickyFault_Hardware(timeoutSeconds);
2505 }
2506 /**
2507 * \brief Clear sticky fault: Hardware fault occurred
2508 *
2509 * This will wait up to 0.100 seconds (100ms) by default.
2510 *
2511 * \returns StatusCode of the set command
2512 */
2517
2518 /**
2519 * \brief Clear sticky fault: Device supply voltage dropped to near
2520 * brownout levels
2521 *
2522 * \param timeoutSeconds Maximum time to wait up to in seconds.
2523 * \returns StatusCode of the set command
2524 */
2526 {
2527 return GetConfigurator().ClearStickyFault_Undervoltage(timeoutSeconds);
2528 }
2529 /**
2530 * \brief Clear sticky fault: Device supply voltage dropped to near
2531 * brownout levels
2532 *
2533 * This will wait up to 0.100 seconds (100ms) by default.
2534 *
2535 * \returns StatusCode of the set command
2536 */
2541
2542 /**
2543 * \brief Clear sticky fault: Device boot while detecting the enable
2544 * signal
2545 *
2546 * \param timeoutSeconds Maximum time to wait up to in seconds.
2547 * \returns StatusCode of the set command
2548 */
2550 {
2551 return GetConfigurator().ClearStickyFault_BootDuringEnable(timeoutSeconds);
2552 }
2553 /**
2554 * \brief Clear sticky fault: Device boot while detecting the enable
2555 * signal
2556 *
2557 * This will wait up to 0.100 seconds (100ms) by default.
2558 *
2559 * \returns StatusCode of the set command
2560 */
2565
2566 /**
2567 * \brief Clear sticky fault: An unlicensed feature is in use, device
2568 * may not behave as expected.
2569 *
2570 * \param timeoutSeconds Maximum time to wait up to in seconds.
2571 * \returns StatusCode of the set command
2572 */
2574 {
2575 return GetConfigurator().ClearStickyFault_UnlicensedFeatureInUse(timeoutSeconds);
2576 }
2577 /**
2578 * \brief Clear sticky fault: An unlicensed feature is in use, device
2579 * may not behave as expected.
2580 *
2581 * This will wait up to 0.100 seconds (100ms) by default.
2582 *
2583 * \returns StatusCode of the set command
2584 */
2589
2590 /**
2591 * \brief Clear sticky fault: Bootup checks failed: Accelerometer
2592 *
2593 * \param timeoutSeconds Maximum time to wait up to in seconds.
2594 * \returns StatusCode of the set command
2595 */
2597 {
2598 return GetConfigurator().ClearStickyFault_BootupAccelerometer(timeoutSeconds);
2599 }
2600 /**
2601 * \brief Clear sticky fault: Bootup checks failed: Accelerometer
2602 *
2603 * This will wait up to 0.100 seconds (100ms) by default.
2604 *
2605 * \returns StatusCode of the set command
2606 */
2611
2612 /**
2613 * \brief Clear sticky fault: Bootup checks failed: Gyroscope
2614 *
2615 * \param timeoutSeconds Maximum time to wait up to in seconds.
2616 * \returns StatusCode of the set command
2617 */
2619 {
2620 return GetConfigurator().ClearStickyFault_BootupGyroscope(timeoutSeconds);
2621 }
2622 /**
2623 * \brief Clear sticky fault: Bootup checks failed: Gyroscope
2624 *
2625 * This will wait up to 0.100 seconds (100ms) by default.
2626 *
2627 * \returns StatusCode of the set command
2628 */
2633
2634 /**
2635 * \brief Clear sticky fault: Bootup checks failed: Magnetometer
2636 *
2637 * \param timeoutSeconds Maximum time to wait up to in seconds.
2638 * \returns StatusCode of the set command
2639 */
2641 {
2642 return GetConfigurator().ClearStickyFault_BootupMagnetometer(timeoutSeconds);
2643 }
2644 /**
2645 * \brief Clear sticky fault: Bootup checks failed: Magnetometer
2646 *
2647 * This will wait up to 0.100 seconds (100ms) by default.
2648 *
2649 * \returns StatusCode of the set command
2650 */
2655
2656 /**
2657 * \brief Clear sticky fault: Motion Detected during bootup.
2658 *
2659 * \param timeoutSeconds Maximum time to wait up to in seconds.
2660 * \returns StatusCode of the set command
2661 */
2663 {
2664 return GetConfigurator().ClearStickyFault_BootIntoMotion(timeoutSeconds);
2665 }
2666 /**
2667 * \brief Clear sticky fault: Motion Detected during bootup.
2668 *
2669 * This will wait up to 0.100 seconds (100ms) by default.
2670 *
2671 * \returns StatusCode of the set command
2672 */
2677
2678 /**
2679 * \brief Clear sticky fault: Motion stack data acquisition was slower
2680 * than expected
2681 *
2682 * \param timeoutSeconds Maximum time to wait up to in seconds.
2683 * \returns StatusCode of the set command
2684 */
2686 {
2687 return GetConfigurator().ClearStickyFault_DataAcquiredLate(timeoutSeconds);
2688 }
2689 /**
2690 * \brief Clear sticky fault: Motion stack data acquisition was slower
2691 * than expected
2692 *
2693 * This will wait up to 0.100 seconds (100ms) by default.
2694 *
2695 * \returns StatusCode of the set command
2696 */
2701
2702 /**
2703 * \brief Clear sticky fault: Motion stack loop time was slower than
2704 * expected.
2705 *
2706 * \param timeoutSeconds Maximum time to wait up to in seconds.
2707 * \returns StatusCode of the set command
2708 */
2710 {
2711 return GetConfigurator().ClearStickyFault_LoopTimeSlow(timeoutSeconds);
2712 }
2713 /**
2714 * \brief Clear sticky fault: Motion stack loop time was slower than
2715 * expected.
2716 *
2717 * This will wait up to 0.100 seconds (100ms) by default.
2718 *
2719 * \returns StatusCode of the set command
2720 */
2725
2726 /**
2727 * \brief Clear sticky fault: Magnetometer values are saturated
2728 *
2729 * \param timeoutSeconds Maximum time to wait up to in seconds.
2730 * \returns StatusCode of the set command
2731 */
2733 {
2734 return GetConfigurator().ClearStickyFault_SaturatedMagnetometer(timeoutSeconds);
2735 }
2736 /**
2737 * \brief Clear sticky fault: Magnetometer values are saturated
2738 *
2739 * This will wait up to 0.100 seconds (100ms) by default.
2740 *
2741 * \returns StatusCode of the set command
2742 */
2747
2748 /**
2749 * \brief Clear sticky fault: Accelerometer values are saturated
2750 *
2751 * \param timeoutSeconds Maximum time to wait up to in seconds.
2752 * \returns StatusCode of the set command
2753 */
2755 {
2756 return GetConfigurator().ClearStickyFault_SaturatedAccelerometer(timeoutSeconds);
2757 }
2758 /**
2759 * \brief Clear sticky fault: Accelerometer values are saturated
2760 *
2761 * This will wait up to 0.100 seconds (100ms) by default.
2762 *
2763 * \returns StatusCode of the set command
2764 */
2769
2770 /**
2771 * \brief Clear sticky fault: Gyroscope values are saturated
2772 *
2773 * \param timeoutSeconds Maximum time to wait up to in seconds.
2774 * \returns StatusCode of the set command
2775 */
2777 {
2778 return GetConfigurator().ClearStickyFault_SaturatedGyroscope(timeoutSeconds);
2779 }
2780 /**
2781 * \brief Clear sticky fault: Gyroscope values are saturated
2782 *
2783 * This will wait up to 0.100 seconds (100ms) by default.
2784 *
2785 * \returns StatusCode of the set command
2786 */
2791
2792 void RegisterAlerts(AlertableCollection &collection) override;
2793};
2794
2795#if defined(_WIN32) || defined(_WIN64)
2796#pragma warning(pop)
2797#endif
2798
2799}
2800}
2801
2802}
2803}
2804
Collection of objects that can report alerts.
Definition Alertable.hpp:109
Class for getting information about an available CAN bus.
Definition CANBus.hpp:142
Represents a status signal with data of type T, and operations available to retrieve information abou...
Definition StatusSignal.hpp:523
Custom Params.
Definition CustomParamsConfigs.hpp:23
Configs to trim the Pigeon2's gyroscope.
Definition GyroTrimConfigs.hpp:27
Configs for Pigeon 2's Mount Pose configuration.
Definition MountPoseConfigs.hpp:25
Common interface for all configuration objects.
Definition Configuration.hpp:20
ctre::phoenix::StatusCode SetConfigsPrivate(std::string_view serializedString, wpi::units::second_t timeoutSeconds, bool futureProofConfigs, bool overrideIfDuplicate)
wpi::units::second_t DefaultTimeoutSeconds
The default maximum amount of time to wait for a config.
Definition Configurator.hpp:27
ParentConfigurator(hardware::DeviceIdentifier deviceIdentifier)
ctre::phoenix::StatusCode GetConfigsPrivate(std::string &serializedString, wpi::units::second_t timeoutSeconds) const
All configurations for the hardware::Pigeon2.
Definition CorePigeon2.hpp:44
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
Take a string and deserialize it to this configuration.
Pigeon2FeaturesConfigs Pigeon2Features
Configs to enable/disable various features of the Pigeon2.
Definition CorePigeon2.hpp:111
constexpr Pigeon2Configuration & WithGyroTrim(GyroTrimConfigs newGyroTrim)
Modifies this configuration's GyroTrim parameter and returns itself for method-chaining and easier to...
Definition CorePigeon2.hpp:174
CustomParamsConfigs CustomParams
Custom Params.
Definition CorePigeon2.hpp:124
GyroTrimConfigs GyroTrim
Configs to trim the Pigeon2's gyroscope.
Definition CorePigeon2.hpp:96
std::string ToString() const override
Get the string representation of this configuration.
bool FutureProofConfigs
True if we should factory default newer unsupported configs, false to leave newer unsupported configs...
Definition CorePigeon2.hpp:61
constexpr Pigeon2Configuration & WithMountPose(MountPoseConfigs newMountPose)
Modifies this configuration's MountPose parameter and returns itself for method-chaining and easier t...
Definition CorePigeon2.hpp:146
std::string Serialize() const final
Get the serialized form of this configuration.
MountPoseConfigs MountPose
Configs for Pigeon 2's Mount Pose configuration.
Definition CorePigeon2.hpp:78
constexpr Pigeon2Configuration & WithPigeon2Features(Pigeon2FeaturesConfigs newPigeon2Features)
Modifies this configuration's Pigeon2Features parameter and returns itself for method-chaining and ea...
Definition CorePigeon2.hpp:199
constexpr Pigeon2Configuration & WithCustomParams(CustomParamsConfigs newCustomParams)
Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easie...
Definition CorePigeon2.hpp:222
Handles applying and refreshing configurations for the hardware::Pigeon2.
Definition CorePigeon2.hpp:247
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CorePigeon2.hpp:708
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:549
ctre::phoenix::StatusCode Apply(const MountPoseConfigs &configs)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:295
ctre::phoenix::StatusCode Refresh(Pigeon2Configuration &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:425
ctre::phoenix::StatusCode ClearStickyFault_SaturatedAccelerometer()
Clear sticky fault: Accelerometer values are saturated.
Definition CorePigeon2.hpp:994
ctre::phoenix::StatusCode Apply(const Pigeon2Configuration &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:280
ctre::phoenix::StatusCode ClearStickyFault_LoopTimeSlow()
Clear sticky fault: Motion stack loop time was slower than expected.
Definition CorePigeon2.hpp:931
ctre::phoenix::StatusCode ClearStickyFault_BootupMagnetometer()
Clear sticky fault: Bootup checks failed: Magnetometer.
Definition CorePigeon2.hpp:835
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:382
ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CorePigeon2.hpp:741
ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue, wpi::units::second_t timeoutSeconds)
The yaw to set the Pigeon2 to right now.
ctre::phoenix::StatusCode Apply(const Pigeon2FeaturesConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:367
ctre::phoenix::StatusCode Refresh(Pigeon2FeaturesConfigs &configs) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:505
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CorePigeon2.hpp:675
ctre::phoenix::StatusCode ClearStickyFault_BootIntoMotion()
Clear sticky fault: Motion Detected during bootup.
Definition CorePigeon2.hpp:866
ctre::phoenix::StatusCode Refresh(GyroTrimConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:487
ctre::phoenix::StatusCode Apply(const Pigeon2Configuration &configs)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:266
ctre::phoenix::StatusCode Refresh(MountPoseConfigs &configs) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:443
ctre::phoenix::StatusCode Apply(const Pigeon2FeaturesConfigs &configs)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:353
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedMagnetometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Magnetometer values are saturated.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedMagnetometer()
Clear sticky fault: Magnetometer values are saturated.
Definition CorePigeon2.hpp:963
ctre::phoenix::StatusCode Apply(const GyroTrimConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:338
ctre::phoenix::StatusCode ClearStickyFault_BootupAccelerometer()
Clear sticky fault: Bootup checks failed: Accelerometer.
Definition CorePigeon2.hpp:773
ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue)
The yaw to set the Pigeon2 to right now.
Definition CorePigeon2.hpp:572
ctre::phoenix::StatusCode Refresh(Pigeon2FeaturesConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:518
ctre::phoenix::StatusCode Refresh(CustomParamsConfigs &configs) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:536
ctre::phoenix::StatusCode ClearStickyFault_DataAcquiredLate(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion stack data acquisition was slower than expected.
ctre::phoenix::StatusCode Apply(const MountPoseConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:309
ctre::phoenix::StatusCode ClearStickyFault_BootupAccelerometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Accelerometer.
ctre::phoenix::StatusCode Refresh(GyroTrimConfigs &configs) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:474
ctre::phoenix::StatusCode ClearStickyFault_SaturatedGyroscope()
Clear sticky fault: Gyroscope values are saturated.
Definition CorePigeon2.hpp:1025
ctre::phoenix::StatusCode Refresh(MountPoseConfigs &configs, wpi::units::second_t timeoutSeconds) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:456
ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
Clear the sticky faults in the device.
ctre::phoenix::StatusCode ClearStickyFault_LoopTimeSlow(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion stack loop time was slower than expected.
ctre::phoenix::StatusCode ClearStickyFault_BootupGyroscope()
Clear sticky fault: Bootup checks failed: Gyroscope.
Definition CorePigeon2.hpp:804
ctre::phoenix::StatusCode ClearStickyFault_SaturatedGyroscope(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Gyroscope values are saturated.
ctre::phoenix::StatusCode ClearStickyFault_BootupMagnetometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Magnetometer.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedAccelerometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Accelerometer values are saturated.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CorePigeon2.hpp:608
ctre::phoenix::StatusCode Apply(const CustomParamsConfigs &configs, wpi::units::second_t timeoutSeconds)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:396
ctre::phoenix::StatusCode ClearStickyFault_BootIntoMotion(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion Detected during bootup.
ctre::phoenix::StatusCode ClearStickyFault_BootupGyroscope(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Gyroscope.
ctre::phoenix::StatusCode Refresh(Pigeon2Configuration &configs) const
Refreshes the values of the specified config group.
Definition CorePigeon2.hpp:411
ctre::phoenix::StatusCode ClearStickyFault_DataAcquiredLate()
Clear sticky fault: Motion stack data acquisition was slower than expected.
Definition CorePigeon2.hpp:898
ctre::phoenix::StatusCode Apply(const GyroTrimConfigs &configs)
Applies the contents of the specified config to the device.
Definition CorePigeon2.hpp:324
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CorePigeon2.hpp:643
Configs to enable/disable various features of the Pigeon2.
Definition Pigeon2FeaturesConfigs.hpp:24
The unique identifier for a device.
Definition DeviceIdentifier.hpp:19
ParentDevice(int deviceID, std::string model, CANBus canbus)
Class for the Pigeon 2 IMU sensor that measures orientation.
Definition CorePigeon2.hpp:1058
StatusSignal< bool > & GetTemperatureCompensationDisabled(bool refresh=true)
Whether the temperature-compensation feature is disabled.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedGyroscope(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Gyroscope values are saturated.
Definition CorePigeon2.hpp:2776
static CorePigeon2 None()
Constructs a stubbed-out CorePigeon2, where all status signals, controls, configs,...
Definition CorePigeon2.hpp:1083
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage()
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CorePigeon2.hpp:2537
StatusSignal< wpi::units::scalar_t > & GetQuatX(bool refresh=true)
The X component of the reported Quaternion.
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityYWorld(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the Y axis with respect to the world frame.
StatusSignal< wpi::units::degree_t > & GetRoll(bool refresh=true)
Current reported roll of the Pigeon2.
ctre::phoenix::StatusCode ClearStickyFault_BootupAccelerometer()
Clear sticky fault: Bootup checks failed: Accelerometer.
Definition CorePigeon2.hpp:2607
ctre::phoenix::StatusCode ClearStickyFault_SaturatedAccelerometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Accelerometer values are saturated.
Definition CorePigeon2.hpp:2754
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityYDevice(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the device's Y axis.
void RegisterAlerts(AlertableCollection &collection) override
Registers all alerts for this type to the provided collection.
StatusSignal< wpi::units::scalar_t > & GetGravityVectorZ(bool refresh=true)
The Z component of the gravity vector.
StatusSignal< bool > & GetFault_SaturatedMagnetometer(bool refresh=true)
Magnetometer values are saturated.
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse()
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CorePigeon2.hpp:2585
StatusSignal< wpi::units::microtesla_t > & GetMagneticFieldY(bool refresh=true)
The biased magnitude of the magnetic field measured by the Pigeon 2 in the Y direction.
StatusSignal< bool > & GetStickyFault_BootupGyroscope(bool refresh=true)
Bootup checks failed: Gyroscope.
StatusSignal< wpi::units::microtesla_t > & GetRawMagneticFieldZ(bool refresh=true)
The raw magnitude of the magnetic field measured by the Pigeon 2 in the Z direction.
StatusSignal< wpi::units::scalar_t > & GetNoMotionCount(bool refresh=true)
The number of times a no-motion event occurred, wraps at 15.
StatusSignal< bool > & GetFault_LoopTimeSlow(bool refresh=true)
Motion stack loop time was slower than expected.
StatusSignal< bool > & GetFault_SaturatedAccelerometer(bool refresh=true)
Accelerometer values are saturated.
StatusSignal< bool > & GetStickyFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
ctre::phoenix::StatusCode ClearStickyFault_BootupGyroscope(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Gyroscope.
Definition CorePigeon2.hpp:2618
StatusSignal< int > & GetVersion(bool refresh=true)
Full Version of firmware in device.
StatusSignal< wpi::units::degree_t > & GetAccumGyroY(bool refresh=true)
The accumulated gyro about the Y axis without any sensor fusing.
ctre::phoenix::StatusCode ClearStickyFaults()
Clear the sticky faults in the device.
Definition CorePigeon2.hpp:2491
StatusSignal< wpi::units::degree_t > & GetAccumGyroX(bool refresh=true)
The accumulated gyro about the X axis without any sensor fusing.
StatusSignal< wpi::units::microtesla_t > & GetMagneticFieldX(bool refresh=true)
The biased magnitude of the magnetic field measured by the Pigeon 2 in the X direction.
ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue, wpi::units::second_t timeoutSeconds)
The yaw to set the Pigeon2 to right now.
Definition CorePigeon2.hpp:2449
ctre::phoenix::StatusCode ClearStickyFault_DataAcquiredLate()
Clear sticky fault: Motion stack data acquisition was slower than expected.
Definition CorePigeon2.hpp:2697
StatusSignal< bool > & GetStickyFault_SaturatedMagnetometer(bool refresh=true)
Magnetometer values are saturated.
StatusSignal< wpi::units::standard_gravity_t > & GetAccelerationY(bool refresh=true)
The acceleration measured by Pigeon2 in the Y direction.
StatusSignal< bool > & GetStickyFault_BootIntoMotion(bool refresh=true)
Motion Detected during bootup.
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityXWorld(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the X axis with respect to the world frame.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedAccelerometer()
Clear sticky fault: Accelerometer values are saturated.
Definition CorePigeon2.hpp:2765
StatusSignal< int > & GetStickyFaultField(bool refresh=true)
Integer representing all (persistent) sticky fault flags reported by the device.
StatusSignal< wpi::units::scalar_t > & GetQuatW(bool refresh=true)
The W component of the reported Quaternion.
StatusSignal< wpi::units::microtesla_t > & GetRawMagneticFieldY(bool refresh=true)
The raw magnitude of the magnetic field measured by the Pigeon 2 in the Y direction.
StatusSignal< bool > & GetNoMotionEnabled(bool refresh=true)
Whether the no-motion calibration feature is enabled.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedGyroscope()
Clear sticky fault: Gyroscope values are saturated.
Definition CorePigeon2.hpp:2787
configs::Pigeon2Configurator & GetConfigurator()
Gets the configurator for this Pigeon2.
Definition CorePigeon2.hpp:1094
StatusSignal< bool > & GetFault_SaturatedGyroscope(bool refresh=true)
Gyroscope values are saturated.
ctre::phoenix::StatusCode ClearStickyFault_Hardware()
Clear sticky fault: Hardware fault occurred.
Definition CorePigeon2.hpp:2513
ctre::phoenix::StatusCode ClearStickyFaults(wpi::units::second_t timeoutSeconds)
Clear the sticky faults in the device.
Definition CorePigeon2.hpp:2476
ctre::phoenix::StatusCode ClearStickyFault_Hardware(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Hardware fault occurred.
Definition CorePigeon2.hpp:2502
StatusSignal< bool > & GetStickyFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
configs::Pigeon2Configurator const & GetConfigurator() const
Gets the configurator for this Pigeon2.
Definition CorePigeon2.hpp:1106
StatusSignal< bool > & GetFault_BootupGyroscope(bool refresh=true)
Bootup checks failed: Gyroscope.
ctre::phoenix::StatusCode SetYaw(wpi::units::degree_t newValue)
The yaw to set the Pigeon2 to right now.
Definition CorePigeon2.hpp:2461
StatusSignal< wpi::units::scalar_t > & GetQuatY(bool refresh=true)
The Y component of the reported Quaternion.
ctre::phoenix::StatusCode ClearStickyFault_BootupMagnetometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Magnetometer.
Definition CorePigeon2.hpp:2640
StatusSignal< bool > & GetStickyFault_Hardware(bool refresh=true)
Hardware fault occurred.
StatusSignal< bool > & GetStickyFault_SaturatedAccelerometer(bool refresh=true)
Accelerometer values are saturated.
StatusSignal< wpi::units::volt_t > & GetSupplyVoltage(bool refresh=true)
Measured supply voltage to the Pigeon2.
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityZWorld(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the Z axis with respect to the world frame.
StatusSignal< wpi::units::second_t > & GetUpTime(bool refresh=true)
How long the Pigeon 2's been up in seconds, caps at 255 seconds.
ctre::phoenix::StatusCode ClearStickyFault_SaturatedMagnetometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Magnetometer values are saturated.
Definition CorePigeon2.hpp:2732
ctre::phoenix::StatusCode ClearStickyFault_BootupGyroscope()
Clear sticky fault: Bootup checks failed: Gyroscope.
Definition CorePigeon2.hpp:2629
StatusSignal< bool > & GetFault_Undervoltage(bool refresh=true)
Device supply voltage dropped to near brownout levels.
ctre::phoenix::StatusCode ClearStickyFault_BootIntoMotion()
Clear sticky fault: Motion Detected during bootup.
Definition CorePigeon2.hpp:2673
ctre::phoenix::StatusCode ClearStickyFault_SaturatedMagnetometer()
Clear sticky fault: Magnetometer values are saturated.
Definition CorePigeon2.hpp:2743
ctre::phoenix::StatusCode ClearStickyFault_UnlicensedFeatureInUse(wpi::units::second_t timeoutSeconds)
Clear sticky fault: An unlicensed feature is in use, device may not behave as expected.
Definition CorePigeon2.hpp:2573
StatusSignal< wpi::units::microtesla_t > & GetRawMagneticFieldX(bool refresh=true)
The raw magnitude of the magnetic field measured by the Pigeon 2 in the X direction.
StatusSignal< int > & GetVersionMajor(bool refresh=true)
App Major Version number.
StatusSignal< bool > & GetFault_BootIntoMotion(bool refresh=true)
Motion Detected during bootup.
StatusSignal< wpi::units::standard_gravity_t > & GetAccelerationX(bool refresh=true)
The acceleration measured by Pigeon2 in the X direction.
CorePigeon2(int deviceId, CANBus canbus)
Constructs a new Pigeon 2 sensor object.
ctre::phoenix::StatusCode ClearStickyFault_LoopTimeSlow()
Clear sticky fault: Motion stack loop time was slower than expected.
Definition CorePigeon2.hpp:2721
StatusSignal< wpi::units::degree_t > & GetYaw(bool refresh=true)
Current reported yaw of the Pigeon2.
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityZDevice(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the device's Z axis.
StatusSignal< bool > & GetStickyFault_SaturatedGyroscope(bool refresh=true)
Gyroscope values are saturated.
StatusSignal< wpi::units::degree_t > & GetAccumGyroZ(bool refresh=true)
The accumulated gyro about the Z axis without any sensor fusing.
StatusSignal< bool > & GetFault_BootupAccelerometer(bool refresh=true)
Bootup checks failed: Accelerometer.
StatusSignal< bool > & GetStickyFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
ctre::phoenix::StatusCode ClearStickyFault_BootIntoMotion(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion Detected during bootup.
Definition CorePigeon2.hpp:2662
StatusSignal< int > & GetFaultField(bool refresh=true)
Integer representing all fault flags reported by the device.
StatusSignal< bool > & GetFault_BootupMagnetometer(bool refresh=true)
Bootup checks failed: Magnetometer.
ctre::phoenix::StatusCode ClearStickyFault_LoopTimeSlow(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion stack loop time was slower than expected.
Definition CorePigeon2.hpp:2709
StatusSignal< wpi::units::standard_gravity_t > & GetAccelerationZ(bool refresh=true)
The acceleration measured by Pigeon2 in the Z direction.
StatusSignal< bool > & GetFault_UnlicensedFeatureInUse(bool refresh=true)
An unlicensed feature is in use, device may not behave as expected.
StatusSignal< int > & GetVersionBugfix(bool refresh=true)
App Bugfix Version number.
StatusSignal< wpi::units::microtesla_t > & GetMagneticFieldZ(bool refresh=true)
The biased magnitude of the magnetic field measured by the Pigeon 2 in the Z direction.
ctre::phoenix::StatusCode ClearStickyFault_DataAcquiredLate(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Motion stack data acquisition was slower than expected.
Definition CorePigeon2.hpp:2685
StatusSignal< wpi::units::scalar_t > & GetGravityVectorY(bool refresh=true)
The Y component of the gravity vector.
StatusSignal< wpi::units::scalar_t > & GetQuatZ(bool refresh=true)
The Z component of the reported Quaternion.
StatusSignal< bool > & GetFault_BootDuringEnable(bool refresh=true)
Device boot while detecting the enable signal.
StatusSignal< bool > & GetStickyFault_LoopTimeSlow(bool refresh=true)
Motion stack loop time was slower than expected.
ctre::phoenix::StatusCode ClearStickyFault_BootupAccelerometer(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Bootup checks failed: Accelerometer.
Definition CorePigeon2.hpp:2596
StatusSignal< bool > & GetFault_DataAcquiredLate(bool refresh=true)
Motion stack data acquisition was slower than expected.
StatusSignal< bool > & GetIsProLicensed(bool refresh=true)
Whether the device is Phoenix Pro licensed.
StatusSignal< wpi::units::degrees_per_second_t > & GetAngularVelocityXDevice(bool refresh=true)
The angular velocity (ω) of the Pigeon 2 about the device's X axis.
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable()
Clear sticky fault: Device boot while detecting the enable signal.
Definition CorePigeon2.hpp:2561
configs::Pigeon2Configuration Configuration
The configuration class for this device.
Definition CorePigeon2.hpp:1066
ctre::phoenix::StatusCode ClearStickyFault_BootDuringEnable(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device boot while detecting the enable signal.
Definition CorePigeon2.hpp:2549
StatusSignal< int > & GetVersionBuild(bool refresh=true)
App Build Version number.
StatusSignal< wpi::units::scalar_t > & GetGravityVectorX(bool refresh=true)
The X component of the gravity vector.
StatusSignal< wpi::units::celsius_t > & GetTemperature(bool refresh=true)
Temperature of the Pigeon 2.
StatusSignal< wpi::units::degree_t > & GetPitch(bool refresh=true)
Current reported pitch of the Pigeon2.
StatusSignal< bool > & GetStickyFault_BootupAccelerometer(bool refresh=true)
Bootup checks failed: Accelerometer.
StatusSignal< bool > & GetStickyFault_BootupMagnetometer(bool refresh=true)
Bootup checks failed: Magnetometer.
ctre::phoenix::StatusCode ClearStickyFault_BootupMagnetometer()
Clear sticky fault: Bootup checks failed: Magnetometer.
Definition CorePigeon2.hpp:2651
StatusSignal< bool > & GetStickyFault_DataAcquiredLate(bool refresh=true)
Motion stack data acquisition was slower than expected.
ctre::phoenix::StatusCode ClearStickyFault_Undervoltage(wpi::units::second_t timeoutSeconds)
Clear sticky fault: Device supply voltage dropped to near brownout levels.
Definition CorePigeon2.hpp:2525
StatusSignal< int > & GetVersionMinor(bool refresh=true)
App Minor Version number.
StatusSignal< bool > & GetFault_Hardware(bool refresh=true)
Hardware fault occurred.
sim::Pigeon2SimState & GetSimState()
Get the simulation state for this device.
Definition CorePigeon2.hpp:1124
Class to control the state of a simulated hardware::Pigeon2.
Definition Pigeon2SimState.hpp:31
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition ExternalFeedbackConfigs.hpp:21
Definition ExternalFeedbackConfigs.hpp:17
Definition ExternalFeedbackConfigs.hpp:17
Definition ExternalFeedbackConfigs.hpp:16
Definition StatusCodes.h:22
Definition motor_constants.h:14