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