Loading [MathJax]/extensions/tex2jax.js
CTRE Phoenix 6 C++ 23.10.0-alpha-8
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SpnEnums.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
10#include <sstream>
11#include <string>
12
13namespace ctre {
14namespace phoenix6 {
15namespace signals {
16
17
18/**
19 * \brief System state of the device
20 */
22{
23public:
24 int value;
25
26 static constexpr int Bootup_0 = 0;
27 static constexpr int Bootup_1 = 1;
28 static constexpr int Bootup_2 = 2;
29 static constexpr int Bootup_3 = 3;
30 static constexpr int Bootup_4 = 4;
31 static constexpr int Bootup_5 = 5;
32 static constexpr int Bootup_6 = 6;
33 static constexpr int Bootup_7 = 7;
34 static constexpr int BootBeep = 8;
35 static constexpr int ControlDisabled = 9;
36 static constexpr int ControlEnabled = 10;
37 static constexpr int ControlEnabled_11 = 11;
38 static constexpr int Fault = 12;
39 static constexpr int Recover = 13;
40 static constexpr int NotLicensed = 14;
41
44 {}
45
47 value{-1}
48 {}
49
50 /**
51 * \brief Gets the string representation of this enum
52 *
53 * \returns String representation of this enum
54 */
55 std::string ToString() const
56 {
57 switch(value)
58 {
59 case System_StateValue::Bootup_0: return "Bootup_0";
60 case System_StateValue::Bootup_1: return "Bootup_1";
61 case System_StateValue::Bootup_2: return "Bootup_2";
62 case System_StateValue::Bootup_3: return "Bootup_3";
63 case System_StateValue::Bootup_4: return "Bootup_4";
64 case System_StateValue::Bootup_5: return "Bootup_5";
65 case System_StateValue::Bootup_6: return "Bootup_6";
66 case System_StateValue::Bootup_7: return "Bootup_7";
67 case System_StateValue::BootBeep: return "BootBeep";
68 case System_StateValue::ControlDisabled: return "ControlDisabled";
69 case System_StateValue::ControlEnabled: return "ControlEnabled";
70 case System_StateValue::ControlEnabled_11: return "ControlEnabled_11";
71 case System_StateValue::Fault: return "Fault";
72 case System_StateValue::Recover: return "Recover";
73 case System_StateValue::NotLicensed: return "NotLicensed";
74 default: return "Invalid Value";
75 }
76 }
77
78 friend std::ostream& operator<<(std::ostream& os, const System_StateValue& data)
79 {
80 os << data.ToString();
81 return os;
82 }
83
84 std::string Serialize() const
85 {
86 std::stringstream ss;
87 ss << "u_" << this->value;
88 return ss.str();
89 }
90
91 bool operator==(const System_StateValue& data) const
92 {
93 return this->value == data.value;
94 }
95 bool operator==(int data) const
96 {
97 return this->value == data;
98 }
99 bool operator<(const System_StateValue& data) const
100 {
101 return this->value < data.value;
102 }
103 bool operator<(int data) const
104 {
105 return this->value < data;
106 }
107};
108
109/**
110 * \brief Whether the device is pro licensed or not
111 */
113{
114public:
115 int value;
116
117 static constexpr int NotLicensed = 0;
118 static constexpr int Licensed = 1;
119
121 value{value}
122 {}
123
125 value{-1}
126 {}
127
128 /**
129 * \brief Gets the string representation of this enum
130 *
131 * \returns String representation of this enum
132 */
133 std::string ToString() const
134 {
135 switch(value)
136 {
137 case IsPROLicensedValue::NotLicensed: return "Not Licensed";
138 case IsPROLicensedValue::Licensed: return "Licensed";
139 default: return "Invalid Value";
140 }
141 }
142
143 friend std::ostream& operator<<(std::ostream& os, const IsPROLicensedValue& data)
144 {
145 os << data.ToString();
146 return os;
147 }
148
149 std::string Serialize() const
150 {
151 std::stringstream ss;
152 ss << "u_" << this->value;
153 return ss.str();
154 }
155
156 bool operator==(const IsPROLicensedValue& data) const
157 {
158 return this->value == data.value;
159 }
160 bool operator==(int data) const
161 {
162 return this->value == data;
163 }
164 bool operator<(const IsPROLicensedValue& data) const
165 {
166 return this->value < data.value;
167 }
168 bool operator<(int data) const
169 {
170 return this->value < data;
171 }
172};
173
174/**
175 * \brief Direction of the sensor to determine positive facing the LED side of
176 * the CANcoder.
177 */
179{
180public:
181 int value;
182
183 static constexpr int CounterClockwise_Positive = 0;
184 static constexpr int Clockwise_Positive = 1;
185
187 value{value}
188 {}
189
191 value{-1}
192 {}
193
194 /**
195 * \brief Gets the string representation of this enum
196 *
197 * \returns String representation of this enum
198 */
199 std::string ToString() const
200 {
201 switch(value)
202 {
203 case SensorDirectionValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
204 case SensorDirectionValue::Clockwise_Positive: return "Clockwise_Positive";
205 default: return "Invalid Value";
206 }
207 }
208
209 friend std::ostream& operator<<(std::ostream& os, const SensorDirectionValue& data)
210 {
211 os << data.ToString();
212 return os;
213 }
214
215 std::string Serialize() const
216 {
217 std::stringstream ss;
218 ss << "u_" << this->value;
219 return ss.str();
220 }
221
222 bool operator==(const SensorDirectionValue& data) const
223 {
224 return this->value == data.value;
225 }
226 bool operator==(int data) const
227 {
228 return this->value == data;
229 }
230 bool operator<(const SensorDirectionValue& data) const
231 {
232 return this->value < data.value;
233 }
234 bool operator<(int data) const
235 {
236 return this->value < data;
237 }
238};
239
240/**
241 * \brief True if device is locked by FRC.
242 */
244{
245public:
246 int value;
247
248 static constexpr int Frc_Locked = 1;
249 static constexpr int Frc_Unlocked = 0;
250
252 value{value}
253 {}
254
256 value{-1}
257 {}
258
259 /**
260 * \brief Gets the string representation of this enum
261 *
262 * \returns String representation of this enum
263 */
264 std::string ToString() const
265 {
266 switch(value)
267 {
268 case FrcLockValue::Frc_Locked: return "Frc_Locked";
269 case FrcLockValue::Frc_Unlocked: return "Frc_Unlocked";
270 default: return "Invalid Value";
271 }
272 }
273
274 friend std::ostream& operator<<(std::ostream& os, const FrcLockValue& data)
275 {
276 os << data.ToString();
277 return os;
278 }
279
280 std::string Serialize() const
281 {
282 std::stringstream ss;
283 ss << "u_" << this->value;
284 return ss.str();
285 }
286
287 bool operator==(const FrcLockValue& data) const
288 {
289 return this->value == data.value;
290 }
291 bool operator==(int data) const
292 {
293 return this->value == data;
294 }
295 bool operator<(const FrcLockValue& data) const
296 {
297 return this->value < data.value;
298 }
299 bool operator<(int data) const
300 {
301 return this->value < data;
302 }
303};
304
305/**
306 * \brief True if the robot is enabled.
307 */
309{
310public:
311 int value;
312
313 static constexpr int Enabled = 1;
314 static constexpr int Disabled = 0;
315
317 value{value}
318 {}
319
321 value{-1}
322 {}
323
324 /**
325 * \brief Gets the string representation of this enum
326 *
327 * \returns String representation of this enum
328 */
329 std::string ToString() const
330 {
331 switch(value)
332 {
333 case RobotEnableValue::Enabled: return "Enabled";
334 case RobotEnableValue::Disabled: return "Disabled";
335 default: return "Invalid Value";
336 }
337 }
338
339 friend std::ostream& operator<<(std::ostream& os, const RobotEnableValue& data)
340 {
341 os << data.ToString();
342 return os;
343 }
344
345 std::string Serialize() const
346 {
347 std::stringstream ss;
348 ss << "u_" << this->value;
349 return ss.str();
350 }
351
352 bool operator==(const RobotEnableValue& data) const
353 {
354 return this->value == data.value;
355 }
356 bool operator==(int data) const
357 {
358 return this->value == data;
359 }
360 bool operator<(const RobotEnableValue& data) const
361 {
362 return this->value < data.value;
363 }
364 bool operator<(int data) const
365 {
366 return this->value < data;
367 }
368};
369
370/**
371 * \brief The Color of LED1 when it's "On".
372 */
374{
375public:
376 int value;
377
378 static constexpr int Off = 0;
379 static constexpr int Red = 1;
380 static constexpr int Green = 2;
381 static constexpr int Orange = 3;
382 static constexpr int Blue = 4;
383 static constexpr int Pink = 5;
384 static constexpr int Cyan = 6;
385 static constexpr int White = 7;
386
388 value{value}
389 {}
390
392 value{-1}
393 {}
394
395 /**
396 * \brief Gets the string representation of this enum
397 *
398 * \returns String representation of this enum
399 */
400 std::string ToString() const
401 {
402 switch(value)
403 {
404 case Led1OnColorValue::Off: return "Off";
405 case Led1OnColorValue::Red: return "Red";
406 case Led1OnColorValue::Green: return "Green";
407 case Led1OnColorValue::Orange: return "Orange";
408 case Led1OnColorValue::Blue: return "Blue";
409 case Led1OnColorValue::Pink: return "Pink";
410 case Led1OnColorValue::Cyan: return "Cyan";
411 case Led1OnColorValue::White: return "White";
412 default: return "Invalid Value";
413 }
414 }
415
416 friend std::ostream& operator<<(std::ostream& os, const Led1OnColorValue& data)
417 {
418 os << data.ToString();
419 return os;
420 }
421
422 std::string Serialize() const
423 {
424 std::stringstream ss;
425 ss << "u_" << this->value;
426 return ss.str();
427 }
428
429 bool operator==(const Led1OnColorValue& data) const
430 {
431 return this->value == data.value;
432 }
433 bool operator==(int data) const
434 {
435 return this->value == data;
436 }
437 bool operator<(const Led1OnColorValue& data) const
438 {
439 return this->value < data.value;
440 }
441 bool operator<(int data) const
442 {
443 return this->value < data;
444 }
445};
446
447/**
448 * \brief The Color of LED1 when it's "Off".
449 */
451{
452public:
453 int value;
454
455 static constexpr int Off = 0;
456 static constexpr int Red = 1;
457 static constexpr int Green = 2;
458 static constexpr int Orange = 3;
459 static constexpr int Blue = 4;
460 static constexpr int Pink = 5;
461 static constexpr int Cyan = 6;
462 static constexpr int White = 7;
463
465 value{value}
466 {}
467
469 value{-1}
470 {}
471
472 /**
473 * \brief Gets the string representation of this enum
474 *
475 * \returns String representation of this enum
476 */
477 std::string ToString() const
478 {
479 switch(value)
480 {
481 case Led1OffColorValue::Off: return "Off";
482 case Led1OffColorValue::Red: return "Red";
483 case Led1OffColorValue::Green: return "Green";
484 case Led1OffColorValue::Orange: return "Orange";
485 case Led1OffColorValue::Blue: return "Blue";
486 case Led1OffColorValue::Pink: return "Pink";
487 case Led1OffColorValue::Cyan: return "Cyan";
488 case Led1OffColorValue::White: return "White";
489 default: return "Invalid Value";
490 }
491 }
492
493 friend std::ostream& operator<<(std::ostream& os, const Led1OffColorValue& data)
494 {
495 os << data.ToString();
496 return os;
497 }
498
499 std::string Serialize() const
500 {
501 std::stringstream ss;
502 ss << "u_" << this->value;
503 return ss.str();
504 }
505
506 bool operator==(const Led1OffColorValue& data) const
507 {
508 return this->value == data.value;
509 }
510 bool operator==(int data) const
511 {
512 return this->value == data;
513 }
514 bool operator<(const Led1OffColorValue& data) const
515 {
516 return this->value < data.value;
517 }
518 bool operator<(int data) const
519 {
520 return this->value < data;
521 }
522};
523
524/**
525 * \brief The Color of LED2 when it's "On".
526 */
528{
529public:
530 int value;
531
532 static constexpr int Off = 0;
533 static constexpr int Red = 1;
534 static constexpr int Green = 2;
535 static constexpr int Orange = 3;
536 static constexpr int Blue = 4;
537 static constexpr int Pink = 5;
538 static constexpr int Cyan = 6;
539 static constexpr int White = 7;
540
542 value{value}
543 {}
544
546 value{-1}
547 {}
548
549 /**
550 * \brief Gets the string representation of this enum
551 *
552 * \returns String representation of this enum
553 */
554 std::string ToString() const
555 {
556 switch(value)
557 {
558 case Led2OnColorValue::Off: return "Off";
559 case Led2OnColorValue::Red: return "Red";
560 case Led2OnColorValue::Green: return "Green";
561 case Led2OnColorValue::Orange: return "Orange";
562 case Led2OnColorValue::Blue: return "Blue";
563 case Led2OnColorValue::Pink: return "Pink";
564 case Led2OnColorValue::Cyan: return "Cyan";
565 case Led2OnColorValue::White: return "White";
566 default: return "Invalid Value";
567 }
568 }
569
570 friend std::ostream& operator<<(std::ostream& os, const Led2OnColorValue& data)
571 {
572 os << data.ToString();
573 return os;
574 }
575
576 std::string Serialize() const
577 {
578 std::stringstream ss;
579 ss << "u_" << this->value;
580 return ss.str();
581 }
582
583 bool operator==(const Led2OnColorValue& data) const
584 {
585 return this->value == data.value;
586 }
587 bool operator==(int data) const
588 {
589 return this->value == data;
590 }
591 bool operator<(const Led2OnColorValue& data) const
592 {
593 return this->value < data.value;
594 }
595 bool operator<(int data) const
596 {
597 return this->value < data;
598 }
599};
600
601/**
602 * \brief The Color of LED2 when it's "Off".
603 */
605{
606public:
607 int value;
608
609 static constexpr int Off = 0;
610 static constexpr int Red = 1;
611 static constexpr int Green = 2;
612 static constexpr int Orange = 3;
613 static constexpr int Blue = 4;
614 static constexpr int Pink = 5;
615 static constexpr int Cyan = 6;
616 static constexpr int White = 7;
617
619 value{value}
620 {}
621
623 value{-1}
624 {}
625
626 /**
627 * \brief Gets the string representation of this enum
628 *
629 * \returns String representation of this enum
630 */
631 std::string ToString() const
632 {
633 switch(value)
634 {
635 case Led2OffColorValue::Off: return "Off";
636 case Led2OffColorValue::Red: return "Red";
637 case Led2OffColorValue::Green: return "Green";
638 case Led2OffColorValue::Orange: return "Orange";
639 case Led2OffColorValue::Blue: return "Blue";
640 case Led2OffColorValue::Pink: return "Pink";
641 case Led2OffColorValue::Cyan: return "Cyan";
642 case Led2OffColorValue::White: return "White";
643 default: return "Invalid Value";
644 }
645 }
646
647 friend std::ostream& operator<<(std::ostream& os, const Led2OffColorValue& data)
648 {
649 os << data.ToString();
650 return os;
651 }
652
653 std::string Serialize() const
654 {
655 std::stringstream ss;
656 ss << "u_" << this->value;
657 return ss.str();
658 }
659
660 bool operator==(const Led2OffColorValue& data) const
661 {
662 return this->value == data.value;
663 }
664 bool operator==(int data) const
665 {
666 return this->value == data;
667 }
668 bool operator<(const Led2OffColorValue& data) const
669 {
670 return this->value < data.value;
671 }
672 bool operator<(int data) const
673 {
674 return this->value < data;
675 }
676};
677
678/**
679 * \brief The range of the absolute sensor, either [0, 1) or [-0.5, 0.5).
680 */
682{
683public:
684 int value;
685
686 static constexpr int Unsigned_0To1 = 0;
687 static constexpr int Signed_PlusMinusHalf = 1;
688
690 value{value}
691 {}
692
694 value{-1}
695 {}
696
697 /**
698 * \brief Gets the string representation of this enum
699 *
700 * \returns String representation of this enum
701 */
702 std::string ToString() const
703 {
704 switch(value)
705 {
706 case AbsoluteSensorRangeValue::Unsigned_0To1: return "Unsigned_0To1";
707 case AbsoluteSensorRangeValue::Signed_PlusMinusHalf: return "Signed_PlusMinusHalf";
708 default: return "Invalid Value";
709 }
710 }
711
712 friend std::ostream& operator<<(std::ostream& os, const AbsoluteSensorRangeValue& data)
713 {
714 os << data.ToString();
715 return os;
716 }
717
718 std::string Serialize() const
719 {
720 std::stringstream ss;
721 ss << "u_" << this->value;
722 return ss.str();
723 }
724
725 bool operator==(const AbsoluteSensorRangeValue& data) const
726 {
727 return this->value == data.value;
728 }
729 bool operator==(int data) const
730 {
731 return this->value == data;
732 }
733 bool operator<(const AbsoluteSensorRangeValue& data) const
734 {
735 return this->value < data.value;
736 }
737 bool operator<(int data) const
738 {
739 return this->value < data;
740 }
741};
742
743/**
744 * \brief True if the device is enabled.
745 */
747{
748public:
749 int value;
750
751 static constexpr int Enabled = 1;
752 static constexpr int Disabled = 0;
753
755 value{value}
756 {}
757
759 value{-1}
760 {}
761
762 /**
763 * \brief Gets the string representation of this enum
764 *
765 * \returns String representation of this enum
766 */
767 std::string ToString() const
768 {
769 switch(value)
770 {
771 case DeviceEnableValue::Enabled: return "Enabled";
772 case DeviceEnableValue::Disabled: return "Disabled";
773 default: return "Invalid Value";
774 }
775 }
776
777 friend std::ostream& operator<<(std::ostream& os, const DeviceEnableValue& data)
778 {
779 os << data.ToString();
780 return os;
781 }
782
783 std::string Serialize() const
784 {
785 std::stringstream ss;
786 ss << "u_" << this->value;
787 return ss.str();
788 }
789
790 bool operator==(const DeviceEnableValue& data) const
791 {
792 return this->value == data.value;
793 }
794 bool operator==(int data) const
795 {
796 return this->value == data;
797 }
798 bool operator<(const DeviceEnableValue& data) const
799 {
800 return this->value < data.value;
801 }
802 bool operator<(int data) const
803 {
804 return this->value < data;
805 }
806};
807
808/**
809 * \brief Forward Limit Pin.
810 */
812{
813public:
814 int value;
815
816 static constexpr int ClosedToGround = 0;
817 static constexpr int Open = 1;
818
820 value{value}
821 {}
822
824 value{-1}
825 {}
826
827 /**
828 * \brief Gets the string representation of this enum
829 *
830 * \returns String representation of this enum
831 */
832 std::string ToString() const
833 {
834 switch(value)
835 {
836 case ForwardLimitValue::ClosedToGround: return "Closed To Ground";
837 case ForwardLimitValue::Open: return "Open";
838 default: return "Invalid Value";
839 }
840 }
841
842 friend std::ostream& operator<<(std::ostream& os, const ForwardLimitValue& data)
843 {
844 os << data.ToString();
845 return os;
846 }
847
848 std::string Serialize() const
849 {
850 std::stringstream ss;
851 ss << "u_" << this->value;
852 return ss.str();
853 }
854
855 bool operator==(const ForwardLimitValue& data) const
856 {
857 return this->value == data.value;
858 }
859 bool operator==(int data) const
860 {
861 return this->value == data;
862 }
863 bool operator<(const ForwardLimitValue& data) const
864 {
865 return this->value < data.value;
866 }
867 bool operator<(int data) const
868 {
869 return this->value < data;
870 }
871};
872
873/**
874 * \brief Reverse Limit Pin.
875 */
877{
878public:
879 int value;
880
881 static constexpr int ClosedToGround = 0;
882 static constexpr int Open = 1;
883
885 value{value}
886 {}
887
889 value{-1}
890 {}
891
892 /**
893 * \brief Gets the string representation of this enum
894 *
895 * \returns String representation of this enum
896 */
897 std::string ToString() const
898 {
899 switch(value)
900 {
901 case ReverseLimitValue::ClosedToGround: return "Closed To Ground";
902 case ReverseLimitValue::Open: return "Open";
903 default: return "Invalid Value";
904 }
905 }
906
907 friend std::ostream& operator<<(std::ostream& os, const ReverseLimitValue& data)
908 {
909 os << data.ToString();
910 return os;
911 }
912
913 std::string Serialize() const
914 {
915 std::stringstream ss;
916 ss << "u_" << this->value;
917 return ss.str();
918 }
919
920 bool operator==(const ReverseLimitValue& data) const
921 {
922 return this->value == data.value;
923 }
924 bool operator==(int data) const
925 {
926 return this->value == data;
927 }
928 bool operator<(const ReverseLimitValue& data) const
929 {
930 return this->value < data.value;
931 }
932 bool operator<(int data) const
933 {
934 return this->value < data;
935 }
936};
937
938/**
939 * \brief The applied rotor polarity. This typically is determined by the
940 * Inverted config, but can be overridden if using Follower features.
941 */
943{
944public:
945 int value;
946
947 static constexpr int PositiveIsCounterClockwise = 0;
948 static constexpr int PositiveIsClockwise = 1;
949
951 value{value}
952 {}
953
955 value{-1}
956 {}
957
958 /**
959 * \brief Gets the string representation of this enum
960 *
961 * \returns String representation of this enum
962 */
963 std::string ToString() const
964 {
965 switch(value)
966 {
967 case AppliedRotorPolarityValue::PositiveIsCounterClockwise: return "PositiveIsCounterClockwise";
968 case AppliedRotorPolarityValue::PositiveIsClockwise: return "PositiveIsClockwise";
969 default: return "Invalid Value";
970 }
971 }
972
973 friend std::ostream& operator<<(std::ostream& os, const AppliedRotorPolarityValue& data)
974 {
975 os << data.ToString();
976 return os;
977 }
978
979 std::string Serialize() const
980 {
981 std::stringstream ss;
982 ss << "u_" << this->value;
983 return ss.str();
984 }
985
986 bool operator==(const AppliedRotorPolarityValue& data) const
987 {
988 return this->value == data.value;
989 }
990 bool operator==(int data) const
991 {
992 return this->value == data;
993 }
994 bool operator<(const AppliedRotorPolarityValue& data) const
995 {
996 return this->value < data.value;
997 }
998 bool operator<(int data) const
999 {
1000 return this->value < data;
1001 }
1002};
1003
1004/**
1005 * \brief The active control mode of the motor controller
1006 */
1008{
1009public:
1011
1012 static constexpr int DisabledOutput = 0;
1013 static constexpr int NeutralOut = 1;
1014 static constexpr int StaticBrake = 2;
1015 static constexpr int DutyCycleOut = 3;
1016 static constexpr int PositionDutyCycle = 4;
1017 static constexpr int VelocityDutyCycle = 5;
1018 static constexpr int MotionMagicDutyCycle = 6;
1019 static constexpr int DutyCycleFOC = 7;
1020 static constexpr int PositionDutyCycleFOC = 8;
1021 static constexpr int VelocityDutyCycleFOC = 9;
1022 static constexpr int MotionMagicDutyCycleFOC = 10;
1023 static constexpr int VoltageOut = 11;
1024 static constexpr int PositionVoltage = 12;
1025 static constexpr int VelocityVoltage = 13;
1026 static constexpr int MotionMagicVoltage = 14;
1027 static constexpr int VoltageFOC = 15;
1028 static constexpr int PositionVoltageFOC = 16;
1029 static constexpr int VelocityVoltageFOC = 17;
1030 static constexpr int MotionMagicVoltageFOC = 18;
1031 static constexpr int TorqueCurrentFOC = 19;
1032 static constexpr int PositionTorqueCurrentFOC = 20;
1033 static constexpr int VelocityTorqueCurrentFOC = 21;
1034 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1035 static constexpr int Follower = 23;
1036 static constexpr int Reserved = 24;
1037 static constexpr int CoastOut = 25;
1038 static constexpr int UnauthorizedDevice = 26;
1039 static constexpr int MusicTone = 27;
1040 static constexpr int MotionMagicVelocityDutyCycle = 28;
1041 static constexpr int MotionMagicVelocityDutyCycleFOC = 29;
1042 static constexpr int MotionMagicVelocityVoltage = 30;
1043 static constexpr int MotionMagicVelocityVoltageFOC = 31;
1044 static constexpr int MotionMagicVelocityTorqueCurrentFOC = 32;
1045
1047 value{value}
1048 {}
1049
1051 value{-1}
1052 {}
1053
1054 /**
1055 * \brief Gets the string representation of this enum
1056 *
1057 * \returns String representation of this enum
1058 */
1059 std::string ToString() const
1060 {
1061 switch(value)
1062 {
1063 case ControlModeValue::DisabledOutput: return "DisabledOutput";
1064 case ControlModeValue::NeutralOut: return "NeutralOut";
1065 case ControlModeValue::StaticBrake: return "StaticBrake";
1066 case ControlModeValue::DutyCycleOut: return "DutyCycleOut";
1067 case ControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1068 case ControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1069 case ControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1070 case ControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1071 case ControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1072 case ControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1073 case ControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1074 case ControlModeValue::VoltageOut: return "VoltageOut";
1075 case ControlModeValue::PositionVoltage: return "PositionVoltage";
1076 case ControlModeValue::VelocityVoltage: return "VelocityVoltage";
1077 case ControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1078 case ControlModeValue::VoltageFOC: return "VoltageFOC";
1079 case ControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1080 case ControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1081 case ControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1082 case ControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1083 case ControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1084 case ControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1085 case ControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1086 case ControlModeValue::Follower: return "Follower";
1087 case ControlModeValue::Reserved: return "Reserved";
1088 case ControlModeValue::CoastOut: return "CoastOut";
1089 case ControlModeValue::UnauthorizedDevice: return "UnauthorizedDevice";
1090 case ControlModeValue::MusicTone: return "MusicTone";
1091 case ControlModeValue::MotionMagicVelocityDutyCycle: return "MotionMagicVelocityDutyCycle";
1092 case ControlModeValue::MotionMagicVelocityDutyCycleFOC: return "MotionMagicVelocityDutyCycleFOC";
1093 case ControlModeValue::MotionMagicVelocityVoltage: return "MotionMagicVelocityVoltage";
1094 case ControlModeValue::MotionMagicVelocityVoltageFOC: return "MotionMagicVelocityVoltageFOC";
1095 case ControlModeValue::MotionMagicVelocityTorqueCurrentFOC: return "MotionMagicVelocityTorqueCurrentFOC";
1096 default: return "Invalid Value";
1097 }
1098 }
1099
1100 friend std::ostream& operator<<(std::ostream& os, const ControlModeValue& data)
1101 {
1102 os << data.ToString();
1103 return os;
1104 }
1105
1106 std::string Serialize() const
1107 {
1108 std::stringstream ss;
1109 ss << "u_" << this->value;
1110 return ss.str();
1111 }
1112
1113 bool operator==(const ControlModeValue& data) const
1114 {
1115 return this->value == data.value;
1116 }
1117 bool operator==(int data) const
1118 {
1119 return this->value == data;
1120 }
1121 bool operator<(const ControlModeValue& data) const
1122 {
1123 return this->value < data.value;
1124 }
1125 bool operator<(int data) const
1126 {
1127 return this->value < data;
1128 }
1129};
1130
1131/**
1132 * \brief Check if Motion Magic® is running. This is equivalent to checking
1133 * that the reported control mode is a Motion Magic® based mode.
1134 */
1136{
1137public:
1139
1140 static constexpr int Enabled = 1;
1141 static constexpr int Disabled = 0;
1142
1144 value{value}
1145 {}
1146
1148 value{-1}
1149 {}
1150
1151 /**
1152 * \brief Gets the string representation of this enum
1153 *
1154 * \returns String representation of this enum
1155 */
1156 std::string ToString() const
1157 {
1158 switch(value)
1159 {
1160 case MotionMagicIsRunningValue::Enabled: return "Enabled";
1161 case MotionMagicIsRunningValue::Disabled: return "Disabled";
1162 default: return "Invalid Value";
1163 }
1164 }
1165
1166 friend std::ostream& operator<<(std::ostream& os, const MotionMagicIsRunningValue& data)
1167 {
1168 os << data.ToString();
1169 return os;
1170 }
1171
1172 std::string Serialize() const
1173 {
1174 std::stringstream ss;
1175 ss << "u_" << this->value;
1176 return ss.str();
1177 }
1178
1180 {
1181 return this->value == data.value;
1182 }
1183 bool operator==(int data) const
1184 {
1185 return this->value == data;
1186 }
1187 bool operator<(const MotionMagicIsRunningValue& data) const
1188 {
1189 return this->value < data.value;
1190 }
1191 bool operator<(int data) const
1192 {
1193 return this->value < data;
1194 }
1195};
1196
1197/**
1198 * \brief The active control mode of the differential controller
1199 */
1201{
1202public:
1204
1205 static constexpr int DisabledOutput = 0;
1206 static constexpr int NeutralOut = 1;
1207 static constexpr int StaticBrake = 2;
1208 static constexpr int DutyCycleOut = 3;
1209 static constexpr int PositionDutyCycle = 4;
1210 static constexpr int VelocityDutyCycle = 5;
1211 static constexpr int MotionMagicDutyCycle = 6;
1212 static constexpr int DutyCycleFOC = 7;
1213 static constexpr int PositionDutyCycleFOC = 8;
1214 static constexpr int VelocityDutyCycleFOC = 9;
1215 static constexpr int MotionMagicDutyCycleFOC = 10;
1216 static constexpr int VoltageOut = 11;
1217 static constexpr int PositionVoltage = 12;
1218 static constexpr int VelocityVoltage = 13;
1219 static constexpr int MotionMagicVoltage = 14;
1220 static constexpr int VoltageFOC = 15;
1221 static constexpr int PositionVoltageFOC = 16;
1222 static constexpr int VelocityVoltageFOC = 17;
1223 static constexpr int MotionMagicVoltageFOC = 18;
1224 static constexpr int TorqueCurrentFOC = 19;
1225 static constexpr int PositionTorqueCurrentFOC = 20;
1226 static constexpr int VelocityTorqueCurrentFOC = 21;
1227 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1228 static constexpr int Follower = 23;
1229 static constexpr int Reserved = 24;
1230 static constexpr int CoastOut = 25;
1231
1233 value{value}
1234 {}
1235
1237 value{-1}
1238 {}
1239
1240 /**
1241 * \brief Gets the string representation of this enum
1242 *
1243 * \returns String representation of this enum
1244 */
1245 std::string ToString() const
1246 {
1247 switch(value)
1248 {
1249 case DifferentialControlModeValue::DisabledOutput: return "DisabledOutput";
1250 case DifferentialControlModeValue::NeutralOut: return "NeutralOut";
1251 case DifferentialControlModeValue::StaticBrake: return "StaticBrake";
1252 case DifferentialControlModeValue::DutyCycleOut: return "DutyCycleOut";
1253 case DifferentialControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1254 case DifferentialControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1255 case DifferentialControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1256 case DifferentialControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1257 case DifferentialControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1258 case DifferentialControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1259 case DifferentialControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1260 case DifferentialControlModeValue::VoltageOut: return "VoltageOut";
1261 case DifferentialControlModeValue::PositionVoltage: return "PositionVoltage";
1262 case DifferentialControlModeValue::VelocityVoltage: return "VelocityVoltage";
1263 case DifferentialControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1264 case DifferentialControlModeValue::VoltageFOC: return "VoltageFOC";
1265 case DifferentialControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1266 case DifferentialControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1267 case DifferentialControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1268 case DifferentialControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1269 case DifferentialControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1270 case DifferentialControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1271 case DifferentialControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1272 case DifferentialControlModeValue::Follower: return "Follower";
1273 case DifferentialControlModeValue::Reserved: return "Reserved";
1274 case DifferentialControlModeValue::CoastOut: return "CoastOut";
1275 default: return "Invalid Value";
1276 }
1277 }
1278
1279 friend std::ostream& operator<<(std::ostream& os, const DifferentialControlModeValue& data)
1280 {
1281 os << data.ToString();
1282 return os;
1283 }
1284
1285 std::string Serialize() const
1286 {
1287 std::stringstream ss;
1288 ss << "u_" << this->value;
1289 return ss.str();
1290 }
1291
1293 {
1294 return this->value == data.value;
1295 }
1296 bool operator==(int data) const
1297 {
1298 return this->value == data;
1299 }
1301 {
1302 return this->value < data.value;
1303 }
1304 bool operator<(int data) const
1305 {
1306 return this->value < data;
1307 }
1308};
1309
1310/**
1311 * \brief Gravity Feedforward Type
1312 *
1313 * \details This determines the type of the gravity feedforward. Choose
1314 * Elevator_Static for systems where the gravity feedforward is
1315 * constant, such as an elevator. The gravity feedforward output will
1316 * always have the same sign. Choose Arm_Cosine for systems where the
1317 * gravity feedforward is dependent on the angular position of the
1318 * mechanism, such as an arm. The gravity feedforward output will vary
1319 * depending on the mechanism angular position. Note that the sensor
1320 * offset and ratios must be configured so that the sensor reports a
1321 * position of 0 when the mechanism is horizonal (parallel to the
1322 * ground), and the reported sensor position is 1:1 with the mechanism.
1323 */
1325{
1326public:
1328
1329 static constexpr int Elevator_Static = 0;
1330 static constexpr int Arm_Cosine = 1;
1331
1333 value{value}
1334 {}
1335
1337 value{-1}
1338 {}
1339
1340 /**
1341 * \brief Gets the string representation of this enum
1342 *
1343 * \returns String representation of this enum
1344 */
1345 std::string ToString() const
1346 {
1347 switch(value)
1348 {
1349 case GravityTypeValue::Elevator_Static: return "Elevator_Static";
1350 case GravityTypeValue::Arm_Cosine: return "Arm_Cosine";
1351 default: return "Invalid Value";
1352 }
1353 }
1354
1355 friend std::ostream& operator<<(std::ostream& os, const GravityTypeValue& data)
1356 {
1357 os << data.ToString();
1358 return os;
1359 }
1360
1361 std::string Serialize() const
1362 {
1363 std::stringstream ss;
1364 ss << "u_" << this->value;
1365 return ss.str();
1366 }
1367
1368 bool operator==(const GravityTypeValue& data) const
1369 {
1370 return this->value == data.value;
1371 }
1372 bool operator==(int data) const
1373 {
1374 return this->value == data;
1375 }
1376 bool operator<(const GravityTypeValue& data) const
1377 {
1378 return this->value < data.value;
1379 }
1380 bool operator<(int data) const
1381 {
1382 return this->value < data;
1383 }
1384};
1385
1386/**
1387 * \brief Invert state of the device
1388 */
1390{
1391public:
1393
1394 static constexpr int CounterClockwise_Positive = 0;
1395 static constexpr int Clockwise_Positive = 1;
1396
1398 value{value}
1399 {}
1400
1402 value{-1}
1403 {}
1404
1405 /**
1406 * \brief Gets the string representation of this enum
1407 *
1408 * \returns String representation of this enum
1409 */
1410 std::string ToString() const
1411 {
1412 switch(value)
1413 {
1414 case InvertedValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
1415 case InvertedValue::Clockwise_Positive: return "Clockwise_Positive";
1416 default: return "Invalid Value";
1417 }
1418 }
1419
1420 friend std::ostream& operator<<(std::ostream& os, const InvertedValue& data)
1421 {
1422 os << data.ToString();
1423 return os;
1424 }
1425
1426 std::string Serialize() const
1427 {
1428 std::stringstream ss;
1429 ss << "u_" << this->value;
1430 return ss.str();
1431 }
1432
1433 bool operator==(const InvertedValue& data) const
1434 {
1435 return this->value == data.value;
1436 }
1437 bool operator==(int data) const
1438 {
1439 return this->value == data;
1440 }
1441 bool operator<(const InvertedValue& data) const
1442 {
1443 return this->value < data.value;
1444 }
1445 bool operator<(int data) const
1446 {
1447 return this->value < data;
1448 }
1449};
1450
1451/**
1452 * \brief The state of the motor controller bridge when output is neutral or
1453 * disabled.
1454 */
1456{
1457public:
1459
1460 static constexpr int Coast = 0;
1461 static constexpr int Brake = 1;
1462
1464 value{value}
1465 {}
1466
1468 value{-1}
1469 {}
1470
1471 /**
1472 * \brief Gets the string representation of this enum
1473 *
1474 * \returns String representation of this enum
1475 */
1476 std::string ToString() const
1477 {
1478 switch(value)
1479 {
1480 case NeutralModeValue::Coast: return "Coast";
1481 case NeutralModeValue::Brake: return "Brake";
1482 default: return "Invalid Value";
1483 }
1484 }
1485
1486 friend std::ostream& operator<<(std::ostream& os, const NeutralModeValue& data)
1487 {
1488 os << data.ToString();
1489 return os;
1490 }
1491
1492 std::string Serialize() const
1493 {
1494 std::stringstream ss;
1495 ss << "u_" << this->value;
1496 return ss.str();
1497 }
1498
1499 bool operator==(const NeutralModeValue& data) const
1500 {
1501 return this->value == data.value;
1502 }
1503 bool operator==(int data) const
1504 {
1505 return this->value == data;
1506 }
1507 bool operator<(const NeutralModeValue& data) const
1508 {
1509 return this->value < data.value;
1510 }
1511 bool operator<(int data) const
1512 {
1513 return this->value < data;
1514 }
1515};
1516
1517/**
1518 * \brief Choose what sensor source is reported via API and used by closed-loop
1519 * and limit features. The default is RotorSensor, which uses the
1520 * internal rotor sensor in the Talon FX. Choose RemoteCANcoder to use
1521 * another CANcoder on the same CAN bus (this also requires setting
1522 * FeedbackRemoteSensorID). Talon FX will update its position and
1523 * velocity whenever CANcoder publishes its information on CAN bus.
1524 * Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse
1525 * another CANcoder's information with the internal rotor, which provides
1526 * the best possible position and velocity for accuracy and bandwidth
1527 * (note this requires setting FeedbackRemoteSensorID). FusedCANcoder
1528 * was developed for applications such as swerve-azimuth. Choose
1529 * SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its
1530 * internal rotor position against another CANcoder, then continue to use
1531 * the rotor sensor for closed loop control (note this requires setting
1532 * FeedbackRemoteSensorID). The TalonFX will report if its internal
1533 * position differs significantly from the reported CANcoder position.
1534 * SyncCANcoder was developed for mechanisms where there is a risk of the
1535 * CANcoder failing in such a way that it reports a position that does
1536 * not match the mechanism, such as the sensor mounting assembly breaking
1537 * off. Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and
1538 * RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this
1539 * also requires setting FeedbackRemoteSensorID). Talon FX will update
1540 * its position to match the selected value whenever Pigeon2 publishes
1541 * its information on CAN bus. Note that the Talon FX position will be in
1542 * rotations and not degrees.
1543 *
1544 * \details Note: When the Talon Source is changed to FusedCANcoder, the Talon
1545 * needs a period of time to fuse before sensor-based (soft-limit,
1546 * closed loop, etc.) features are used. This period of time is
1547 * determined by the update frequency of the CANcoder's Position
1548 * signal.
1549 */
1551{
1552public:
1554
1555 static constexpr int RotorSensor = 0;
1556 static constexpr int RemoteCANcoder = 1;
1557 static constexpr int RemotePigeon2_Yaw = 2;
1558 static constexpr int RemotePigeon2_Pitch = 3;
1559 static constexpr int RemotePigeon2_Roll = 4;
1560 static constexpr int FusedCANcoder = 5;
1561 static constexpr int SyncCANcoder = 6;
1562
1564 value{value}
1565 {}
1566
1568 value{-1}
1569 {}
1570
1571 /**
1572 * \brief Gets the string representation of this enum
1573 *
1574 * \returns String representation of this enum
1575 */
1576 std::string ToString() const
1577 {
1578 switch(value)
1579 {
1580 case FeedbackSensorSourceValue::RotorSensor: return "RotorSensor";
1581 case FeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
1582 case FeedbackSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
1583 case FeedbackSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
1584 case FeedbackSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
1585 case FeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
1586 case FeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
1587 default: return "Invalid Value";
1588 }
1589 }
1590
1591 friend std::ostream& operator<<(std::ostream& os, const FeedbackSensorSourceValue& data)
1592 {
1593 os << data.ToString();
1594 return os;
1595 }
1596
1597 std::string Serialize() const
1598 {
1599 std::stringstream ss;
1600 ss << "u_" << this->value;
1601 return ss.str();
1602 }
1603
1605 {
1606 return this->value == data.value;
1607 }
1608 bool operator==(int data) const
1609 {
1610 return this->value == data;
1611 }
1612 bool operator<(const FeedbackSensorSourceValue& data) const
1613 {
1614 return this->value < data.value;
1615 }
1616 bool operator<(int data) const
1617 {
1618 return this->value < data;
1619 }
1620};
1621
1622/**
1623 * \brief Determines if limit is normally-open (default) or normally-closed.
1624 */
1626{
1627public:
1629
1630 static constexpr int NormallyOpen = 0;
1631 static constexpr int NormallyClosed = 1;
1632
1634 value{value}
1635 {}
1636
1638 value{-1}
1639 {}
1640
1641 /**
1642 * \brief Gets the string representation of this enum
1643 *
1644 * \returns String representation of this enum
1645 */
1646 std::string ToString() const
1647 {
1648 switch(value)
1649 {
1650 case ForwardLimitTypeValue::NormallyOpen: return "NormallyOpen";
1651 case ForwardLimitTypeValue::NormallyClosed: return "NormallyClosed";
1652 default: return "Invalid Value";
1653 }
1654 }
1655
1656 friend std::ostream& operator<<(std::ostream& os, const ForwardLimitTypeValue& data)
1657 {
1658 os << data.ToString();
1659 return os;
1660 }
1661
1662 std::string Serialize() const
1663 {
1664 std::stringstream ss;
1665 ss << "u_" << this->value;
1666 return ss.str();
1667 }
1668
1669 bool operator==(const ForwardLimitTypeValue& data) const
1670 {
1671 return this->value == data.value;
1672 }
1673 bool operator==(int data) const
1674 {
1675 return this->value == data;
1676 }
1677 bool operator<(const ForwardLimitTypeValue& data) const
1678 {
1679 return this->value < data.value;
1680 }
1681 bool operator<(int data) const
1682 {
1683 return this->value < data;
1684 }
1685};
1686
1687/**
1688 * \brief Determines where to poll the forward limit switch. This defaults to
1689 * the limit switch pin on the limit switch connector.
1690 */
1692{
1693public:
1695
1696 static constexpr int LimitSwitchPin = 0;
1697 static constexpr int RemoteTalonFX = 1;
1698 static constexpr int RemoteCANifier = 2;
1699
1701 value{value}
1702 {}
1703
1705 value{-1}
1706 {}
1707
1708 /**
1709 * \brief Gets the string representation of this enum
1710 *
1711 * \returns String representation of this enum
1712 */
1713 std::string ToString() const
1714 {
1715 switch(value)
1716 {
1717 case ForwardLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
1718 case ForwardLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
1719 case ForwardLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
1720 default: return "Invalid Value";
1721 }
1722 }
1723
1724 friend std::ostream& operator<<(std::ostream& os, const ForwardLimitSourceValue& data)
1725 {
1726 os << data.ToString();
1727 return os;
1728 }
1729
1730 std::string Serialize() const
1731 {
1732 std::stringstream ss;
1733 ss << "u_" << this->value;
1734 return ss.str();
1735 }
1736
1737 bool operator==(const ForwardLimitSourceValue& data) const
1738 {
1739 return this->value == data.value;
1740 }
1741 bool operator==(int data) const
1742 {
1743 return this->value == data;
1744 }
1745 bool operator<(const ForwardLimitSourceValue& data) const
1746 {
1747 return this->value < data.value;
1748 }
1749 bool operator<(int data) const
1750 {
1751 return this->value < data;
1752 }
1753};
1754
1755/**
1756 * \brief Determines if limit is normally-open (default) or normally-closed.
1757 */
1759{
1760public:
1762
1763 static constexpr int NormallyOpen = 0;
1764 static constexpr int NormallyClosed = 1;
1765
1767 value{value}
1768 {}
1769
1771 value{-1}
1772 {}
1773
1774 /**
1775 * \brief Gets the string representation of this enum
1776 *
1777 * \returns String representation of this enum
1778 */
1779 std::string ToString() const
1780 {
1781 switch(value)
1782 {
1783 case ReverseLimitTypeValue::NormallyOpen: return "NormallyOpen";
1784 case ReverseLimitTypeValue::NormallyClosed: return "NormallyClosed";
1785 default: return "Invalid Value";
1786 }
1787 }
1788
1789 friend std::ostream& operator<<(std::ostream& os, const ReverseLimitTypeValue& data)
1790 {
1791 os << data.ToString();
1792 return os;
1793 }
1794
1795 std::string Serialize() const
1796 {
1797 std::stringstream ss;
1798 ss << "u_" << this->value;
1799 return ss.str();
1800 }
1801
1802 bool operator==(const ReverseLimitTypeValue& data) const
1803 {
1804 return this->value == data.value;
1805 }
1806 bool operator==(int data) const
1807 {
1808 return this->value == data;
1809 }
1810 bool operator<(const ReverseLimitTypeValue& data) const
1811 {
1812 return this->value < data.value;
1813 }
1814 bool operator<(int data) const
1815 {
1816 return this->value < data;
1817 }
1818};
1819
1820/**
1821 * \brief Determines where to poll the reverse limit switch. This defaults to
1822 * the limit switch pin on the limit switch connector.
1823 */
1825{
1826public:
1828
1829 static constexpr int LimitSwitchPin = 0;
1830 static constexpr int RemoteTalonFX = 1;
1831 static constexpr int RemoteCANifier = 2;
1832
1834 value{value}
1835 {}
1836
1838 value{-1}
1839 {}
1840
1841 /**
1842 * \brief Gets the string representation of this enum
1843 *
1844 * \returns String representation of this enum
1845 */
1846 std::string ToString() const
1847 {
1848 switch(value)
1849 {
1850 case ReverseLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
1851 case ReverseLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
1852 case ReverseLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
1853 default: return "Invalid Value";
1854 }
1855 }
1856
1857 friend std::ostream& operator<<(std::ostream& os, const ReverseLimitSourceValue& data)
1858 {
1859 os << data.ToString();
1860 return os;
1861 }
1862
1863 std::string Serialize() const
1864 {
1865 std::stringstream ss;
1866 ss << "u_" << this->value;
1867 return ss.str();
1868 }
1869
1870 bool operator==(const ReverseLimitSourceValue& data) const
1871 {
1872 return this->value == data.value;
1873 }
1874 bool operator==(int data) const
1875 {
1876 return this->value == data;
1877 }
1878 bool operator<(const ReverseLimitSourceValue& data) const
1879 {
1880 return this->value < data.value;
1881 }
1882 bool operator<(int data) const
1883 {
1884 return this->value < data;
1885 }
1886};
1887
1888/**
1889 * \brief Magnet health as measured by CANcoder.
1890 *
1891 * \details Magnet health as measured by CANcoder. Red indicates too close or
1892 * too far, Orange is adequate but with reduced accuracy, green is
1893 * ideal. Invalid means the accuracy cannot be determined.
1894 */
1896{
1897public:
1899
1900 static constexpr int Magnet_Red = 1;
1901 static constexpr int Magnet_Orange = 2;
1902 static constexpr int Magnet_Green = 3;
1903 static constexpr int Magnet_Invalid = 0;
1904
1906 value{value}
1907 {}
1908
1910 value{-1}
1911 {}
1912
1913 /**
1914 * \brief Gets the string representation of this enum
1915 *
1916 * \returns String representation of this enum
1917 */
1918 std::string ToString() const
1919 {
1920 switch(value)
1921 {
1922 case MagnetHealthValue::Magnet_Red: return "Magnet_Red";
1923 case MagnetHealthValue::Magnet_Orange: return "Magnet_Orange";
1924 case MagnetHealthValue::Magnet_Green: return "Magnet_Green";
1925 case MagnetHealthValue::Magnet_Invalid: return "Magnet_Invalid";
1926 default: return "Invalid Value";
1927 }
1928 }
1929
1930 friend std::ostream& operator<<(std::ostream& os, const MagnetHealthValue& data)
1931 {
1932 os << data.ToString();
1933 return os;
1934 }
1935
1936 std::string Serialize() const
1937 {
1938 std::stringstream ss;
1939 ss << "u_" << this->value;
1940 return ss.str();
1941 }
1942
1943 bool operator==(const MagnetHealthValue& data) const
1944 {
1945 return this->value == data.value;
1946 }
1947 bool operator==(int data) const
1948 {
1949 return this->value == data;
1950 }
1951 bool operator<(const MagnetHealthValue& data) const
1952 {
1953 return this->value < data.value;
1954 }
1955 bool operator<(int data) const
1956 {
1957 return this->value < data;
1958 }
1959};
1960
1961/**
1962 * \brief The applied output of the bridge.
1963 */
1965{
1966public:
1968
1969 static constexpr int BridgeReq_Coast = 0;
1970 static constexpr int BridgeReq_Brake = 1;
1971 static constexpr int BridgeReq_Trapez = 6;
1972 static constexpr int BridgeReq_FOCTorque = 7;
1973 static constexpr int BridgeReq_MusicTone = 8;
1974 static constexpr int BridgeReq_FOCEasy = 9;
1975 static constexpr int BridgeReq_FaultBrake = 12;
1976 static constexpr int BridgeReq_FaultCoast = 13;
1977
1979 value{value}
1980 {}
1981
1983 value{-1}
1984 {}
1985
1986 /**
1987 * \brief Gets the string representation of this enum
1988 *
1989 * \returns String representation of this enum
1990 */
1991 std::string ToString() const
1992 {
1993 switch(value)
1994 {
1995 case BridgeOutputValue::BridgeReq_Coast: return "BridgeReq_Coast";
1996 case BridgeOutputValue::BridgeReq_Brake: return "BridgeReq_Brake";
1997 case BridgeOutputValue::BridgeReq_Trapez: return "BridgeReq_Trapez";
1998 case BridgeOutputValue::BridgeReq_FOCTorque: return "BridgeReq_FOCTorque";
1999 case BridgeOutputValue::BridgeReq_MusicTone: return "BridgeReq_MusicTone";
2000 case BridgeOutputValue::BridgeReq_FOCEasy: return "BridgeReq_FOCEasy";
2001 case BridgeOutputValue::BridgeReq_FaultBrake: return "BridgeReq_FaultBrake";
2002 case BridgeOutputValue::BridgeReq_FaultCoast: return "BridgeReq_FaultCoast";
2003 default: return "Invalid Value";
2004 }
2005 }
2006
2007 friend std::ostream& operator<<(std::ostream& os, const BridgeOutputValue& data)
2008 {
2009 os << data.ToString();
2010 return os;
2011 }
2012
2013 std::string Serialize() const
2014 {
2015 std::stringstream ss;
2016 ss << "u_" << this->value;
2017 return ss.str();
2018 }
2019
2020 bool operator==(const BridgeOutputValue& data) const
2021 {
2022 return this->value == data.value;
2023 }
2024 bool operator==(int data) const
2025 {
2026 return this->value == data;
2027 }
2028 bool operator<(const BridgeOutputValue& data) const
2029 {
2030 return this->value < data.value;
2031 }
2032 bool operator<(int data) const
2033 {
2034 return this->value < data;
2035 }
2036};
2037
2038/**
2039 * \brief Choose what sensor source is used for differential control of a
2040 * mechanism. The default is Disabled. All other options require
2041 * setting the DifferentialTalonFXSensorID, as the average of this Talon
2042 * FX's sensor and the remote TalonFX's sensor is used for the
2043 * differential controller's primary targets. Choose RemoteTalonFX_Diff
2044 * to use another TalonFX on the same CAN bus. Talon FX will update its
2045 * differential position and velocity whenever the remote TalonFX
2046 * publishes its information on CAN bus. The differential controller
2047 * will use the difference between this TalonFX's sensor and the remote
2048 * Talon FX's sensor for the differential component of the output.
2049 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
2050 * to use another Pigeon2 on the same CAN bus (this also requires setting
2051 * DifferentialRemoteSensorID). Talon FX will update its differential
2052 * position to match the selected value whenever Pigeon2 publishes its
2053 * information on CAN bus. Note that the Talon FX differential position
2054 * will be in rotations and not degrees. Choose RemoteCANcoder to use
2055 * another CANcoder on the same CAN bus (this also requires setting
2056 * DifferentialRemoteSensorID). Talon FX will update its differential
2057 * position and velocity to match the CANcoder whenever CANcoder
2058 * publishes its information on CAN bus.
2059 */
2061{
2062public:
2064
2065 static constexpr int Disabled = 0;
2066 static constexpr int RemoteTalonFX_Diff = 1;
2067 static constexpr int RemotePigeon2_Yaw = 2;
2068 static constexpr int RemotePigeon2_Pitch = 3;
2069 static constexpr int RemotePigeon2_Roll = 4;
2070 static constexpr int RemoteCANcoder = 5;
2071
2073 value{value}
2074 {}
2075
2077 value{-1}
2078 {}
2079
2080 /**
2081 * \brief Gets the string representation of this enum
2082 *
2083 * \returns String representation of this enum
2084 */
2085 std::string ToString() const
2086 {
2087 switch(value)
2088 {
2089 case DifferentialSensorSourceValue::Disabled: return "Disabled";
2090 case DifferentialSensorSourceValue::RemoteTalonFX_Diff: return "RemoteTalonFX_Diff";
2091 case DifferentialSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
2092 case DifferentialSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
2093 case DifferentialSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
2094 case DifferentialSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2095 default: return "Invalid Value";
2096 }
2097 }
2098
2099 friend std::ostream& operator<<(std::ostream& os, const DifferentialSensorSourceValue& data)
2100 {
2101 os << data.ToString();
2102 return os;
2103 }
2104
2105 std::string Serialize() const
2106 {
2107 std::stringstream ss;
2108 ss << "u_" << this->value;
2109 return ss.str();
2110 }
2111
2113 {
2114 return this->value == data.value;
2115 }
2116 bool operator==(int data) const
2117 {
2118 return this->value == data;
2119 }
2121 {
2122 return this->value < data.value;
2123 }
2124 bool operator<(int data) const
2125 {
2126 return this->value < data;
2127 }
2128};
2129
2130
2131}
2132}
2133}
Definition: Serializable.hpp:15
The range of the absolute sensor, either [0, 1) or [-0.5, 0.5).
Definition: SpnEnums.hpp:682
bool operator<(const AbsoluteSensorRangeValue &data) const
Definition: SpnEnums.hpp:733
bool operator<(int data) const
Definition: SpnEnums.hpp:737
bool operator==(const AbsoluteSensorRangeValue &data) const
Definition: SpnEnums.hpp:725
AbsoluteSensorRangeValue(int value)
Definition: SpnEnums.hpp:689
bool operator==(int data) const
Definition: SpnEnums.hpp:729
std::string Serialize() const
Definition: SpnEnums.hpp:718
friend std::ostream & operator<<(std::ostream &os, const AbsoluteSensorRangeValue &data)
Definition: SpnEnums.hpp:712
static constexpr int Signed_PlusMinusHalf
Definition: SpnEnums.hpp:687
AbsoluteSensorRangeValue()
Definition: SpnEnums.hpp:693
static constexpr int Unsigned_0To1
Definition: SpnEnums.hpp:686
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:702
The applied rotor polarity.
Definition: SpnEnums.hpp:943
bool operator==(int data) const
Definition: SpnEnums.hpp:990
bool operator==(const AppliedRotorPolarityValue &data) const
Definition: SpnEnums.hpp:986
std::string Serialize() const
Definition: SpnEnums.hpp:979
AppliedRotorPolarityValue()
Definition: SpnEnums.hpp:954
AppliedRotorPolarityValue(int value)
Definition: SpnEnums.hpp:950
bool operator<(const AppliedRotorPolarityValue &data) const
Definition: SpnEnums.hpp:994
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:963
friend std::ostream & operator<<(std::ostream &os, const AppliedRotorPolarityValue &data)
Definition: SpnEnums.hpp:973
static constexpr int PositiveIsClockwise
Definition: SpnEnums.hpp:948
bool operator<(int data) const
Definition: SpnEnums.hpp:998
static constexpr int PositiveIsCounterClockwise
Definition: SpnEnums.hpp:947
The applied output of the bridge.
Definition: SpnEnums.hpp:1965
BridgeOutputValue()
Definition: SpnEnums.hpp:1982
bool operator<(int data) const
Definition: SpnEnums.hpp:2032
bool operator==(const BridgeOutputValue &data) const
Definition: SpnEnums.hpp:2020
static constexpr int BridgeReq_FaultCoast
Definition: SpnEnums.hpp:1976
static constexpr int BridgeReq_FOCEasy
Definition: SpnEnums.hpp:1974
std::string Serialize() const
Definition: SpnEnums.hpp:2013
static constexpr int BridgeReq_Trapez
Definition: SpnEnums.hpp:1971
bool operator==(int data) const
Definition: SpnEnums.hpp:2024
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1991
static constexpr int BridgeReq_MusicTone
Definition: SpnEnums.hpp:1973
bool operator<(const BridgeOutputValue &data) const
Definition: SpnEnums.hpp:2028
friend std::ostream & operator<<(std::ostream &os, const BridgeOutputValue &data)
Definition: SpnEnums.hpp:2007
BridgeOutputValue(int value)
Definition: SpnEnums.hpp:1978
static constexpr int BridgeReq_Brake
Definition: SpnEnums.hpp:1970
static constexpr int BridgeReq_FOCTorque
Definition: SpnEnums.hpp:1972
int value
Definition: SpnEnums.hpp:1967
static constexpr int BridgeReq_FaultBrake
Definition: SpnEnums.hpp:1975
static constexpr int BridgeReq_Coast
Definition: SpnEnums.hpp:1969
The active control mode of the motor controller.
Definition: SpnEnums.hpp:1008
static constexpr int MotionMagicVoltage
Definition: SpnEnums.hpp:1026
static constexpr int PositionDutyCycle
Definition: SpnEnums.hpp:1016
static constexpr int Follower
Definition: SpnEnums.hpp:1035
static constexpr int VelocityVoltage
Definition: SpnEnums.hpp:1025
bool operator==(const ControlModeValue &data) const
Definition: SpnEnums.hpp:1113
static constexpr int VoltageFOC
Definition: SpnEnums.hpp:1027
static constexpr int MotionMagicDutyCycleFOC
Definition: SpnEnums.hpp:1022
static constexpr int DutyCycleFOC
Definition: SpnEnums.hpp:1019
static constexpr int MusicTone
Definition: SpnEnums.hpp:1039
static constexpr int VelocityDutyCycleFOC
Definition: SpnEnums.hpp:1021
int value
Definition: SpnEnums.hpp:1010
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1059
static constexpr int MotionMagicVoltageFOC
Definition: SpnEnums.hpp:1030
static constexpr int CoastOut
Definition: SpnEnums.hpp:1037
static constexpr int DisabledOutput
Definition: SpnEnums.hpp:1012
static constexpr int NeutralOut
Definition: SpnEnums.hpp:1013
static constexpr int MotionMagicVelocityVoltageFOC
Definition: SpnEnums.hpp:1043
static constexpr int VoltageOut
Definition: SpnEnums.hpp:1023
static constexpr int VelocityTorqueCurrentFOC
Definition: SpnEnums.hpp:1033
bool operator<(const ControlModeValue &data) const
Definition: SpnEnums.hpp:1121
std::string Serialize() const
Definition: SpnEnums.hpp:1106
friend std::ostream & operator<<(std::ostream &os, const ControlModeValue &data)
Definition: SpnEnums.hpp:1100
static constexpr int MotionMagicVelocityVoltage
Definition: SpnEnums.hpp:1042
static constexpr int MotionMagicVelocityDutyCycle
Definition: SpnEnums.hpp:1040
ControlModeValue()
Definition: SpnEnums.hpp:1050
static constexpr int PositionVoltage
Definition: SpnEnums.hpp:1024
ControlModeValue(int value)
Definition: SpnEnums.hpp:1046
static constexpr int PositionTorqueCurrentFOC
Definition: SpnEnums.hpp:1032
static constexpr int VelocityVoltageFOC
Definition: SpnEnums.hpp:1029
static constexpr int Reserved
Definition: SpnEnums.hpp:1036
static constexpr int MotionMagicTorqueCurrentFOC
Definition: SpnEnums.hpp:1034
static constexpr int PositionVoltageFOC
Definition: SpnEnums.hpp:1028
static constexpr int MotionMagicDutyCycle
Definition: SpnEnums.hpp:1018
static constexpr int PositionDutyCycleFOC
Definition: SpnEnums.hpp:1020
bool operator==(int data) const
Definition: SpnEnums.hpp:1117
static constexpr int TorqueCurrentFOC
Definition: SpnEnums.hpp:1031
bool operator<(int data) const
Definition: SpnEnums.hpp:1125
static constexpr int UnauthorizedDevice
Definition: SpnEnums.hpp:1038
static constexpr int StaticBrake
Definition: SpnEnums.hpp:1014
static constexpr int MotionMagicVelocityTorqueCurrentFOC
Definition: SpnEnums.hpp:1044
static constexpr int VelocityDutyCycle
Definition: SpnEnums.hpp:1017
static constexpr int DutyCycleOut
Definition: SpnEnums.hpp:1015
static constexpr int MotionMagicVelocityDutyCycleFOC
Definition: SpnEnums.hpp:1041
True if the device is enabled.
Definition: SpnEnums.hpp:747
std::string Serialize() const
Definition: SpnEnums.hpp:783
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:767
DeviceEnableValue(int value)
Definition: SpnEnums.hpp:754
int value
Definition: SpnEnums.hpp:749
bool operator<(int data) const
Definition: SpnEnums.hpp:802
static constexpr int Enabled
Definition: SpnEnums.hpp:751
DeviceEnableValue()
Definition: SpnEnums.hpp:758
bool operator==(int data) const
Definition: SpnEnums.hpp:794
bool operator<(const DeviceEnableValue &data) const
Definition: SpnEnums.hpp:798
friend std::ostream & operator<<(std::ostream &os, const DeviceEnableValue &data)
Definition: SpnEnums.hpp:777
bool operator==(const DeviceEnableValue &data) const
Definition: SpnEnums.hpp:790
static constexpr int Disabled
Definition: SpnEnums.hpp:752
The active control mode of the differential controller.
Definition: SpnEnums.hpp:1201
static constexpr int MotionMagicVoltage
Definition: SpnEnums.hpp:1219
static constexpr int NeutralOut
Definition: SpnEnums.hpp:1206
static constexpr int PositionDutyCycle
Definition: SpnEnums.hpp:1209
DifferentialControlModeValue()
Definition: SpnEnums.hpp:1236
static constexpr int VelocityTorqueCurrentFOC
Definition: SpnEnums.hpp:1226
static constexpr int Reserved
Definition: SpnEnums.hpp:1229
friend std::ostream & operator<<(std::ostream &os, const DifferentialControlModeValue &data)
Definition: SpnEnums.hpp:1279
static constexpr int PositionVoltageFOC
Definition: SpnEnums.hpp:1221
static constexpr int MotionMagicTorqueCurrentFOC
Definition: SpnEnums.hpp:1227
static constexpr int VelocityDutyCycleFOC
Definition: SpnEnums.hpp:1214
bool operator==(const DifferentialControlModeValue &data) const
Definition: SpnEnums.hpp:1292
static constexpr int TorqueCurrentFOC
Definition: SpnEnums.hpp:1224
bool operator<(int data) const
Definition: SpnEnums.hpp:1304
static constexpr int VoltageOut
Definition: SpnEnums.hpp:1216
static constexpr int VelocityVoltageFOC
Definition: SpnEnums.hpp:1222
static constexpr int MotionMagicDutyCycleFOC
Definition: SpnEnums.hpp:1215
static constexpr int MotionMagicVoltageFOC
Definition: SpnEnums.hpp:1223
static constexpr int Follower
Definition: SpnEnums.hpp:1228
static constexpr int DisabledOutput
Definition: SpnEnums.hpp:1205
DifferentialControlModeValue(int value)
Definition: SpnEnums.hpp:1232
static constexpr int VoltageFOC
Definition: SpnEnums.hpp:1220
bool operator<(const DifferentialControlModeValue &data) const
Definition: SpnEnums.hpp:1300
static constexpr int DutyCycleOut
Definition: SpnEnums.hpp:1208
std::string Serialize() const
Definition: SpnEnums.hpp:1285
static constexpr int PositionVoltage
Definition: SpnEnums.hpp:1217
static constexpr int StaticBrake
Definition: SpnEnums.hpp:1207
static constexpr int PositionTorqueCurrentFOC
Definition: SpnEnums.hpp:1225
bool operator==(int data) const
Definition: SpnEnums.hpp:1296
static constexpr int MotionMagicDutyCycle
Definition: SpnEnums.hpp:1211
static constexpr int VelocityDutyCycle
Definition: SpnEnums.hpp:1210
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1245
static constexpr int PositionDutyCycleFOC
Definition: SpnEnums.hpp:1213
static constexpr int CoastOut
Definition: SpnEnums.hpp:1230
static constexpr int DutyCycleFOC
Definition: SpnEnums.hpp:1212
static constexpr int VelocityVoltage
Definition: SpnEnums.hpp:1218
Choose what sensor source is used for differential control of a mechanism.
Definition: SpnEnums.hpp:2061
static constexpr int Disabled
Definition: SpnEnums.hpp:2065
static constexpr int RemoteTalonFX_Diff
Definition: SpnEnums.hpp:2066
bool operator<(int data) const
Definition: SpnEnums.hpp:2124
friend std::ostream & operator<<(std::ostream &os, const DifferentialSensorSourceValue &data)
Definition: SpnEnums.hpp:2099
static constexpr int RemoteCANcoder
Definition: SpnEnums.hpp:2070
static constexpr int RemotePigeon2_Pitch
Definition: SpnEnums.hpp:2068
bool operator==(const DifferentialSensorSourceValue &data) const
Definition: SpnEnums.hpp:2112
static constexpr int RemotePigeon2_Roll
Definition: SpnEnums.hpp:2069
static constexpr int RemotePigeon2_Yaw
Definition: SpnEnums.hpp:2067
bool operator<(const DifferentialSensorSourceValue &data) const
Definition: SpnEnums.hpp:2120
DifferentialSensorSourceValue()
Definition: SpnEnums.hpp:2076
std::string Serialize() const
Definition: SpnEnums.hpp:2105
DifferentialSensorSourceValue(int value)
Definition: SpnEnums.hpp:2072
bool operator==(int data) const
Definition: SpnEnums.hpp:2116
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:2085
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition: SpnEnums.hpp:1551
FeedbackSensorSourceValue()
Definition: SpnEnums.hpp:1567
static constexpr int RemoteCANcoder
Definition: SpnEnums.hpp:1556
static constexpr int RemotePigeon2_Pitch
Definition: SpnEnums.hpp:1558
static constexpr int RemotePigeon2_Yaw
Definition: SpnEnums.hpp:1557
static constexpr int RemotePigeon2_Roll
Definition: SpnEnums.hpp:1559
int value
Definition: SpnEnums.hpp:1553
friend std::ostream & operator<<(std::ostream &os, const FeedbackSensorSourceValue &data)
Definition: SpnEnums.hpp:1591
static constexpr int SyncCANcoder
Definition: SpnEnums.hpp:1561
static constexpr int RotorSensor
Definition: SpnEnums.hpp:1555
bool operator==(int data) const
Definition: SpnEnums.hpp:1608
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1576
bool operator==(const FeedbackSensorSourceValue &data) const
Definition: SpnEnums.hpp:1604
std::string Serialize() const
Definition: SpnEnums.hpp:1597
static constexpr int FusedCANcoder
Definition: SpnEnums.hpp:1560
bool operator<(int data) const
Definition: SpnEnums.hpp:1616
FeedbackSensorSourceValue(int value)
Definition: SpnEnums.hpp:1563
bool operator<(const FeedbackSensorSourceValue &data) const
Definition: SpnEnums.hpp:1612
Determines where to poll the forward limit switch.
Definition: SpnEnums.hpp:1692
static constexpr int LimitSwitchPin
Definition: SpnEnums.hpp:1696
std::string Serialize() const
Definition: SpnEnums.hpp:1730
friend std::ostream & operator<<(std::ostream &os, const ForwardLimitSourceValue &data)
Definition: SpnEnums.hpp:1724
ForwardLimitSourceValue()
Definition: SpnEnums.hpp:1704
static constexpr int RemoteTalonFX
Definition: SpnEnums.hpp:1697
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1713
bool operator==(int data) const
Definition: SpnEnums.hpp:1741
static constexpr int RemoteCANifier
Definition: SpnEnums.hpp:1698
ForwardLimitSourceValue(int value)
Definition: SpnEnums.hpp:1700
bool operator<(int data) const
Definition: SpnEnums.hpp:1749
int value
Definition: SpnEnums.hpp:1694
bool operator<(const ForwardLimitSourceValue &data) const
Definition: SpnEnums.hpp:1745
bool operator==(const ForwardLimitSourceValue &data) const
Definition: SpnEnums.hpp:1737
Determines if limit is normally-open (default) or normally-closed.
Definition: SpnEnums.hpp:1626
bool operator==(int data) const
Definition: SpnEnums.hpp:1673
static constexpr int NormallyClosed
Definition: SpnEnums.hpp:1631
bool operator==(const ForwardLimitTypeValue &data) const
Definition: SpnEnums.hpp:1669
ForwardLimitTypeValue(int value)
Definition: SpnEnums.hpp:1633
bool operator<(const ForwardLimitTypeValue &data) const
Definition: SpnEnums.hpp:1677
bool operator<(int data) const
Definition: SpnEnums.hpp:1681
ForwardLimitTypeValue()
Definition: SpnEnums.hpp:1637
friend std::ostream & operator<<(std::ostream &os, const ForwardLimitTypeValue &data)
Definition: SpnEnums.hpp:1656
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1646
static constexpr int NormallyOpen
Definition: SpnEnums.hpp:1630
std::string Serialize() const
Definition: SpnEnums.hpp:1662
int value
Definition: SpnEnums.hpp:1628
Forward Limit Pin.
Definition: SpnEnums.hpp:812
friend std::ostream & operator<<(std::ostream &os, const ForwardLimitValue &data)
Definition: SpnEnums.hpp:842
bool operator==(const ForwardLimitValue &data) const
Definition: SpnEnums.hpp:855
bool operator<(const ForwardLimitValue &data) const
Definition: SpnEnums.hpp:863
static constexpr int ClosedToGround
Definition: SpnEnums.hpp:816
ForwardLimitValue()
Definition: SpnEnums.hpp:823
std::string Serialize() const
Definition: SpnEnums.hpp:848
int value
Definition: SpnEnums.hpp:814
ForwardLimitValue(int value)
Definition: SpnEnums.hpp:819
bool operator<(int data) const
Definition: SpnEnums.hpp:867
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:832
bool operator==(int data) const
Definition: SpnEnums.hpp:859
static constexpr int Open
Definition: SpnEnums.hpp:817
True if device is locked by FRC.
Definition: SpnEnums.hpp:244
bool operator<(int data) const
Definition: SpnEnums.hpp:299
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:264
static constexpr int Frc_Locked
Definition: SpnEnums.hpp:248
bool operator==(const FrcLockValue &data) const
Definition: SpnEnums.hpp:287
static constexpr int Frc_Unlocked
Definition: SpnEnums.hpp:249
int value
Definition: SpnEnums.hpp:246
FrcLockValue(int value)
Definition: SpnEnums.hpp:251
friend std::ostream & operator<<(std::ostream &os, const FrcLockValue &data)
Definition: SpnEnums.hpp:274
bool operator<(const FrcLockValue &data) const
Definition: SpnEnums.hpp:295
std::string Serialize() const
Definition: SpnEnums.hpp:280
bool operator==(int data) const
Definition: SpnEnums.hpp:291
FrcLockValue()
Definition: SpnEnums.hpp:255
Gravity Feedforward Type.
Definition: SpnEnums.hpp:1325
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1345
bool operator==(const GravityTypeValue &data) const
Definition: SpnEnums.hpp:1368
static constexpr int Elevator_Static
Definition: SpnEnums.hpp:1329
int value
Definition: SpnEnums.hpp:1327
friend std::ostream & operator<<(std::ostream &os, const GravityTypeValue &data)
Definition: SpnEnums.hpp:1355
std::string Serialize() const
Definition: SpnEnums.hpp:1361
GravityTypeValue(int value)
Definition: SpnEnums.hpp:1332
bool operator<(const GravityTypeValue &data) const
Definition: SpnEnums.hpp:1376
bool operator<(int data) const
Definition: SpnEnums.hpp:1380
static constexpr int Arm_Cosine
Definition: SpnEnums.hpp:1330
bool operator==(int data) const
Definition: SpnEnums.hpp:1372
GravityTypeValue()
Definition: SpnEnums.hpp:1336
Invert state of the device.
Definition: SpnEnums.hpp:1390
bool operator<(const InvertedValue &data) const
Definition: SpnEnums.hpp:1441
static constexpr int CounterClockwise_Positive
Definition: SpnEnums.hpp:1394
friend std::ostream & operator<<(std::ostream &os, const InvertedValue &data)
Definition: SpnEnums.hpp:1420
int value
Definition: SpnEnums.hpp:1392
static constexpr int Clockwise_Positive
Definition: SpnEnums.hpp:1395
std::string Serialize() const
Definition: SpnEnums.hpp:1426
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1410
InvertedValue()
Definition: SpnEnums.hpp:1401
InvertedValue(int value)
Definition: SpnEnums.hpp:1397
bool operator==(int data) const
Definition: SpnEnums.hpp:1437
bool operator<(int data) const
Definition: SpnEnums.hpp:1445
bool operator==(const InvertedValue &data) const
Definition: SpnEnums.hpp:1433
Whether the device is pro licensed or not.
Definition: SpnEnums.hpp:113
IsPROLicensedValue(int value)
Definition: SpnEnums.hpp:120
static constexpr int NotLicensed
Definition: SpnEnums.hpp:117
friend std::ostream & operator<<(std::ostream &os, const IsPROLicensedValue &data)
Definition: SpnEnums.hpp:143
bool operator==(int data) const
Definition: SpnEnums.hpp:160
int value
Definition: SpnEnums.hpp:115
bool operator<(const IsPROLicensedValue &data) const
Definition: SpnEnums.hpp:164
static constexpr int Licensed
Definition: SpnEnums.hpp:118
bool operator==(const IsPROLicensedValue &data) const
Definition: SpnEnums.hpp:156
std::string Serialize() const
Definition: SpnEnums.hpp:149
IsPROLicensedValue()
Definition: SpnEnums.hpp:124
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:133
bool operator<(int data) const
Definition: SpnEnums.hpp:168
The Color of LED1 when it's "Off".
Definition: SpnEnums.hpp:451
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:477
bool operator<(int data) const
Definition: SpnEnums.hpp:518
bool operator==(const Led1OffColorValue &data) const
Definition: SpnEnums.hpp:506
Led1OffColorValue(int value)
Definition: SpnEnums.hpp:464
bool operator<(const Led1OffColorValue &data) const
Definition: SpnEnums.hpp:514
static constexpr int Orange
Definition: SpnEnums.hpp:458
static constexpr int Red
Definition: SpnEnums.hpp:456
Led1OffColorValue()
Definition: SpnEnums.hpp:468
static constexpr int White
Definition: SpnEnums.hpp:462
static constexpr int Off
Definition: SpnEnums.hpp:455
static constexpr int Blue
Definition: SpnEnums.hpp:459
static constexpr int Cyan
Definition: SpnEnums.hpp:461
int value
Definition: SpnEnums.hpp:453
bool operator==(int data) const
Definition: SpnEnums.hpp:510
std::string Serialize() const
Definition: SpnEnums.hpp:499
friend std::ostream & operator<<(std::ostream &os, const Led1OffColorValue &data)
Definition: SpnEnums.hpp:493
static constexpr int Pink
Definition: SpnEnums.hpp:460
static constexpr int Green
Definition: SpnEnums.hpp:457
The Color of LED1 when it's "On".
Definition: SpnEnums.hpp:374
static constexpr int Cyan
Definition: SpnEnums.hpp:384
Led1OnColorValue()
Definition: SpnEnums.hpp:391
friend std::ostream & operator<<(std::ostream &os, const Led1OnColorValue &data)
Definition: SpnEnums.hpp:416
bool operator<(int data) const
Definition: SpnEnums.hpp:441
static constexpr int Pink
Definition: SpnEnums.hpp:383
Led1OnColorValue(int value)
Definition: SpnEnums.hpp:387
static constexpr int Blue
Definition: SpnEnums.hpp:382
bool operator<(const Led1OnColorValue &data) const
Definition: SpnEnums.hpp:437
static constexpr int White
Definition: SpnEnums.hpp:385
static constexpr int Green
Definition: SpnEnums.hpp:380
static constexpr int Red
Definition: SpnEnums.hpp:379
static constexpr int Off
Definition: SpnEnums.hpp:378
static constexpr int Orange
Definition: SpnEnums.hpp:381
bool operator==(const Led1OnColorValue &data) const
Definition: SpnEnums.hpp:429
bool operator==(int data) const
Definition: SpnEnums.hpp:433
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:400
int value
Definition: SpnEnums.hpp:376
std::string Serialize() const
Definition: SpnEnums.hpp:422
The Color of LED2 when it's "Off".
Definition: SpnEnums.hpp:605
static constexpr int Pink
Definition: SpnEnums.hpp:614
static constexpr int Red
Definition: SpnEnums.hpp:610
static constexpr int Blue
Definition: SpnEnums.hpp:613
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:631
bool operator==(const Led2OffColorValue &data) const
Definition: SpnEnums.hpp:660
bool operator<(int data) const
Definition: SpnEnums.hpp:672
static constexpr int Cyan
Definition: SpnEnums.hpp:615
int value
Definition: SpnEnums.hpp:607
static constexpr int Off
Definition: SpnEnums.hpp:609
bool operator==(int data) const
Definition: SpnEnums.hpp:664
std::string Serialize() const
Definition: SpnEnums.hpp:653
Led2OffColorValue()
Definition: SpnEnums.hpp:622
static constexpr int White
Definition: SpnEnums.hpp:616
Led2OffColorValue(int value)
Definition: SpnEnums.hpp:618
static constexpr int Orange
Definition: SpnEnums.hpp:612
bool operator<(const Led2OffColorValue &data) const
Definition: SpnEnums.hpp:668
static constexpr int Green
Definition: SpnEnums.hpp:611
friend std::ostream & operator<<(std::ostream &os, const Led2OffColorValue &data)
Definition: SpnEnums.hpp:647
The Color of LED2 when it's "On".
Definition: SpnEnums.hpp:528
static constexpr int Red
Definition: SpnEnums.hpp:533
std::string Serialize() const
Definition: SpnEnums.hpp:576
static constexpr int Green
Definition: SpnEnums.hpp:534
static constexpr int Pink
Definition: SpnEnums.hpp:537
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:554
Led2OnColorValue(int value)
Definition: SpnEnums.hpp:541
static constexpr int Cyan
Definition: SpnEnums.hpp:538
bool operator<(const Led2OnColorValue &data) const
Definition: SpnEnums.hpp:591
bool operator<(int data) const
Definition: SpnEnums.hpp:595
bool operator==(int data) const
Definition: SpnEnums.hpp:587
friend std::ostream & operator<<(std::ostream &os, const Led2OnColorValue &data)
Definition: SpnEnums.hpp:570
static constexpr int Blue
Definition: SpnEnums.hpp:536
static constexpr int Orange
Definition: SpnEnums.hpp:535
Led2OnColorValue()
Definition: SpnEnums.hpp:545
static constexpr int White
Definition: SpnEnums.hpp:539
static constexpr int Off
Definition: SpnEnums.hpp:532
int value
Definition: SpnEnums.hpp:530
bool operator==(const Led2OnColorValue &data) const
Definition: SpnEnums.hpp:583
Magnet health as measured by CANcoder.
Definition: SpnEnums.hpp:1896
static constexpr int Magnet_Orange
Definition: SpnEnums.hpp:1901
friend std::ostream & operator<<(std::ostream &os, const MagnetHealthValue &data)
Definition: SpnEnums.hpp:1930
bool operator==(const MagnetHealthValue &data) const
Definition: SpnEnums.hpp:1943
bool operator<(int data) const
Definition: SpnEnums.hpp:1955
MagnetHealthValue(int value)
Definition: SpnEnums.hpp:1905
bool operator==(int data) const
Definition: SpnEnums.hpp:1947
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1918
static constexpr int Magnet_Red
Definition: SpnEnums.hpp:1900
static constexpr int Magnet_Green
Definition: SpnEnums.hpp:1902
std::string Serialize() const
Definition: SpnEnums.hpp:1936
int value
Definition: SpnEnums.hpp:1898
bool operator<(const MagnetHealthValue &data) const
Definition: SpnEnums.hpp:1951
static constexpr int Magnet_Invalid
Definition: SpnEnums.hpp:1903
MagnetHealthValue()
Definition: SpnEnums.hpp:1909
Check if Motion Magic® is running.
Definition: SpnEnums.hpp:1136
int value
Definition: SpnEnums.hpp:1138
bool operator<(int data) const
Definition: SpnEnums.hpp:1191
bool operator<(const MotionMagicIsRunningValue &data) const
Definition: SpnEnums.hpp:1187
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1156
bool operator==(const MotionMagicIsRunningValue &data) const
Definition: SpnEnums.hpp:1179
std::string Serialize() const
Definition: SpnEnums.hpp:1172
static constexpr int Disabled
Definition: SpnEnums.hpp:1141
MotionMagicIsRunningValue(int value)
Definition: SpnEnums.hpp:1143
friend std::ostream & operator<<(std::ostream &os, const MotionMagicIsRunningValue &data)
Definition: SpnEnums.hpp:1166
bool operator==(int data) const
Definition: SpnEnums.hpp:1183
MotionMagicIsRunningValue()
Definition: SpnEnums.hpp:1147
static constexpr int Enabled
Definition: SpnEnums.hpp:1140
The state of the motor controller bridge when output is neutral or disabled.
Definition: SpnEnums.hpp:1456
friend std::ostream & operator<<(std::ostream &os, const NeutralModeValue &data)
Definition: SpnEnums.hpp:1486
bool operator==(int data) const
Definition: SpnEnums.hpp:1503
std::string Serialize() const
Definition: SpnEnums.hpp:1492
bool operator<(const NeutralModeValue &data) const
Definition: SpnEnums.hpp:1507
static constexpr int Brake
Definition: SpnEnums.hpp:1461
NeutralModeValue()
Definition: SpnEnums.hpp:1467
int value
Definition: SpnEnums.hpp:1458
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1476
static constexpr int Coast
Definition: SpnEnums.hpp:1460
NeutralModeValue(int value)
Definition: SpnEnums.hpp:1463
bool operator==(const NeutralModeValue &data) const
Definition: SpnEnums.hpp:1499
bool operator<(int data) const
Definition: SpnEnums.hpp:1511
Determines where to poll the reverse limit switch.
Definition: SpnEnums.hpp:1825
static constexpr int RemoteTalonFX
Definition: SpnEnums.hpp:1830
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1846
ReverseLimitSourceValue(int value)
Definition: SpnEnums.hpp:1833
std::string Serialize() const
Definition: SpnEnums.hpp:1863
int value
Definition: SpnEnums.hpp:1827
friend std::ostream & operator<<(std::ostream &os, const ReverseLimitSourceValue &data)
Definition: SpnEnums.hpp:1857
static constexpr int RemoteCANifier
Definition: SpnEnums.hpp:1831
static constexpr int LimitSwitchPin
Definition: SpnEnums.hpp:1829
ReverseLimitSourceValue()
Definition: SpnEnums.hpp:1837
bool operator<(const ReverseLimitSourceValue &data) const
Definition: SpnEnums.hpp:1878
bool operator<(int data) const
Definition: SpnEnums.hpp:1882
bool operator==(int data) const
Definition: SpnEnums.hpp:1874
bool operator==(const ReverseLimitSourceValue &data) const
Definition: SpnEnums.hpp:1870
Determines if limit is normally-open (default) or normally-closed.
Definition: SpnEnums.hpp:1759
static constexpr int NormallyClosed
Definition: SpnEnums.hpp:1764
bool operator==(const ReverseLimitTypeValue &data) const
Definition: SpnEnums.hpp:1802
friend std::ostream & operator<<(std::ostream &os, const ReverseLimitTypeValue &data)
Definition: SpnEnums.hpp:1789
bool operator<(int data) const
Definition: SpnEnums.hpp:1814
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:1779
ReverseLimitTypeValue()
Definition: SpnEnums.hpp:1770
bool operator<(const ReverseLimitTypeValue &data) const
Definition: SpnEnums.hpp:1810
bool operator==(int data) const
Definition: SpnEnums.hpp:1806
static constexpr int NormallyOpen
Definition: SpnEnums.hpp:1763
std::string Serialize() const
Definition: SpnEnums.hpp:1795
int value
Definition: SpnEnums.hpp:1761
ReverseLimitTypeValue(int value)
Definition: SpnEnums.hpp:1766
Reverse Limit Pin.
Definition: SpnEnums.hpp:877
friend std::ostream & operator<<(std::ostream &os, const ReverseLimitValue &data)
Definition: SpnEnums.hpp:907
static constexpr int Open
Definition: SpnEnums.hpp:882
int value
Definition: SpnEnums.hpp:879
std::string Serialize() const
Definition: SpnEnums.hpp:913
ReverseLimitValue()
Definition: SpnEnums.hpp:888
bool operator==(int data) const
Definition: SpnEnums.hpp:924
ReverseLimitValue(int value)
Definition: SpnEnums.hpp:884
bool operator==(const ReverseLimitValue &data) const
Definition: SpnEnums.hpp:920
static constexpr int ClosedToGround
Definition: SpnEnums.hpp:881
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:897
bool operator<(int data) const
Definition: SpnEnums.hpp:932
bool operator<(const ReverseLimitValue &data) const
Definition: SpnEnums.hpp:928
True if the robot is enabled.
Definition: SpnEnums.hpp:309
bool operator<(const RobotEnableValue &data) const
Definition: SpnEnums.hpp:360
bool operator<(int data) const
Definition: SpnEnums.hpp:364
RobotEnableValue(int value)
Definition: SpnEnums.hpp:316
static constexpr int Disabled
Definition: SpnEnums.hpp:314
bool operator==(const RobotEnableValue &data) const
Definition: SpnEnums.hpp:352
static constexpr int Enabled
Definition: SpnEnums.hpp:313
bool operator==(int data) const
Definition: SpnEnums.hpp:356
friend std::ostream & operator<<(std::ostream &os, const RobotEnableValue &data)
Definition: SpnEnums.hpp:339
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:329
std::string Serialize() const
Definition: SpnEnums.hpp:345
RobotEnableValue()
Definition: SpnEnums.hpp:320
int value
Definition: SpnEnums.hpp:311
Direction of the sensor to determine positive facing the LED side of the CANcoder.
Definition: SpnEnums.hpp:179
SensorDirectionValue()
Definition: SpnEnums.hpp:190
static constexpr int CounterClockwise_Positive
Definition: SpnEnums.hpp:183
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:199
bool operator==(const SensorDirectionValue &data) const
Definition: SpnEnums.hpp:222
static constexpr int Clockwise_Positive
Definition: SpnEnums.hpp:184
int value
Definition: SpnEnums.hpp:181
SensorDirectionValue(int value)
Definition: SpnEnums.hpp:186
std::string Serialize() const
Definition: SpnEnums.hpp:215
bool operator<(const SensorDirectionValue &data) const
Definition: SpnEnums.hpp:230
bool operator<(int data) const
Definition: SpnEnums.hpp:234
bool operator==(int data) const
Definition: SpnEnums.hpp:226
friend std::ostream & operator<<(std::ostream &os, const SensorDirectionValue &data)
Definition: SpnEnums.hpp:209
System state of the device.
Definition: SpnEnums.hpp:22
static constexpr int Bootup_3
Definition: SpnEnums.hpp:29
static constexpr int ControlEnabled
Definition: SpnEnums.hpp:36
bool operator==(int data) const
Definition: SpnEnums.hpp:95
static constexpr int Bootup_4
Definition: SpnEnums.hpp:30
std::string Serialize() const
Definition: SpnEnums.hpp:84
static constexpr int ControlDisabled
Definition: SpnEnums.hpp:35
static constexpr int NotLicensed
Definition: SpnEnums.hpp:40
bool operator<(const System_StateValue &data) const
Definition: SpnEnums.hpp:99
System_StateValue()
Definition: SpnEnums.hpp:46
std::string ToString() const
Gets the string representation of this enum.
Definition: SpnEnums.hpp:55
static constexpr int Recover
Definition: SpnEnums.hpp:39
static constexpr int Bootup_1
Definition: SpnEnums.hpp:27
static constexpr int Bootup_0
Definition: SpnEnums.hpp:26
System_StateValue(int value)
Definition: SpnEnums.hpp:42
static constexpr int BootBeep
Definition: SpnEnums.hpp:34
static constexpr int Bootup_6
Definition: SpnEnums.hpp:32
int value
Definition: SpnEnums.hpp:24
bool operator==(const System_StateValue &data) const
Definition: SpnEnums.hpp:91
static constexpr int Fault
Definition: SpnEnums.hpp:38
static constexpr int ControlEnabled_11
Definition: SpnEnums.hpp:37
bool operator<(int data) const
Definition: SpnEnums.hpp:103
static constexpr int Bootup_5
Definition: SpnEnums.hpp:31
friend std::ostream & operator<<(std::ostream &os, const System_StateValue &data)
Definition: SpnEnums.hpp:78
static constexpr int Bootup_7
Definition: SpnEnums.hpp:33
static constexpr int Bootup_2
Definition: SpnEnums.hpp:28
Definition: ManualEvent.hpp:12