CTRE Phoenix 6 C++ 25.0.0-beta-4
Loading...
Searching...
No Matches
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 static constexpr int Production = 15;
42
43 constexpr System_StateValue(int value) :
45 {}
46
47 constexpr System_StateValue() :
48 value{-1}
49 {}
50
51 constexpr bool operator==(System_StateValue data) const
52 {
53 return this->value == data.value;
54 }
55 constexpr bool operator==(int data) const
56 {
57 return this->value == data;
58 }
59 constexpr bool operator!=(System_StateValue data) const
60 {
61 return this->value != data.value;
62 }
63 constexpr bool operator!=(int data) const
64 {
65 return this->value != data;
66 }
67 constexpr bool operator<(System_StateValue data) const
68 {
69 return this->value < data.value;
70 }
71 constexpr bool operator<(int data) const
72 {
73 return this->value < data;
74 }
75
76 /**
77 * \brief Gets the string representation of this enum
78 *
79 * \returns String representation of this enum
80 */
81 std::string ToString() const
82 {
83 switch (value)
84 {
85 case System_StateValue::Bootup_0: return "Bootup_0";
86 case System_StateValue::Bootup_1: return "Bootup_1";
87 case System_StateValue::Bootup_2: return "Bootup_2";
88 case System_StateValue::Bootup_3: return "Bootup_3";
89 case System_StateValue::Bootup_4: return "Bootup_4";
90 case System_StateValue::Bootup_5: return "Bootup_5";
91 case System_StateValue::Bootup_6: return "Bootup_6";
92 case System_StateValue::Bootup_7: return "Bootup_7";
93 case System_StateValue::BootBeep: return "BootBeep";
94 case System_StateValue::ControlDisabled: return "ControlDisabled";
95 case System_StateValue::ControlEnabled: return "ControlEnabled";
96 case System_StateValue::ControlEnabled_11: return "ControlEnabled_11";
97 case System_StateValue::Fault: return "Fault";
98 case System_StateValue::Recover: return "Recover";
99 case System_StateValue::NotLicensed: return "NotLicensed";
100 case System_StateValue::Production: return "Production";
101 default: return "Invalid Value";
102 }
103 }
104
105 friend std::ostream &operator<<(std::ostream &os, System_StateValue data)
106 {
107 os << data.ToString();
108 return os;
109 }
110
111 std::string Serialize() const
112 {
113 std::stringstream ss;
114 ss << "u_" << this->value;
115 return ss.str();
116 }
117};
118
119/**
120 * \brief Whether the device is Pro licensed.
121 */
123{
124public:
125 int value;
126
127 static constexpr int NotLicensed = 0;
128 static constexpr int Licensed = 1;
129
130 constexpr IsPROLicensedValue(int value) :
131 value{value}
132 {}
133
134 constexpr IsPROLicensedValue() :
135 value{-1}
136 {}
137
138 constexpr bool operator==(IsPROLicensedValue data) const
139 {
140 return this->value == data.value;
141 }
142 constexpr bool operator==(int data) const
143 {
144 return this->value == data;
145 }
146 constexpr bool operator!=(IsPROLicensedValue data) const
147 {
148 return this->value != data.value;
149 }
150 constexpr bool operator!=(int data) const
151 {
152 return this->value != data;
153 }
154 constexpr bool operator<(IsPROLicensedValue data) const
155 {
156 return this->value < data.value;
157 }
158 constexpr bool operator<(int data) const
159 {
160 return this->value < data;
161 }
162
163 /**
164 * \brief Gets the string representation of this enum
165 *
166 * \returns String representation of this enum
167 */
168 std::string ToString() const
169 {
170 switch (value)
171 {
172 case IsPROLicensedValue::NotLicensed: return "Not Licensed";
173 case IsPROLicensedValue::Licensed: return "Licensed";
174 default: return "Invalid Value";
175 }
176 }
177
178 friend std::ostream &operator<<(std::ostream &os, IsPROLicensedValue data)
179 {
180 os << data.ToString();
181 return os;
182 }
183
184 std::string Serialize() const
185 {
186 std::stringstream ss;
187 ss << "u_" << this->value;
188 return ss.str();
189 }
190};
191
192/**
193 * \brief Whether the device is Season Pass licensed.
194 */
196{
197public:
198 int value;
199
200 static constexpr int NotLicensed = 0;
201 static constexpr int Licensed = 1;
202
204 value{value}
205 {}
206
208 value{-1}
209 {}
210
211 constexpr bool operator==(Licensing_IsSeasonPassedValue data) const
212 {
213 return this->value == data.value;
214 }
215 constexpr bool operator==(int data) const
216 {
217 return this->value == data;
218 }
219 constexpr bool operator!=(Licensing_IsSeasonPassedValue data) const
220 {
221 return this->value != data.value;
222 }
223 constexpr bool operator!=(int data) const
224 {
225 return this->value != data;
226 }
227 constexpr bool operator<(Licensing_IsSeasonPassedValue data) const
228 {
229 return this->value < data.value;
230 }
231 constexpr bool operator<(int data) const
232 {
233 return this->value < data;
234 }
235
236 /**
237 * \brief Gets the string representation of this enum
238 *
239 * \returns String representation of this enum
240 */
241 std::string ToString() const
242 {
243 switch (value)
244 {
245 case Licensing_IsSeasonPassedValue::NotLicensed: return "Not Licensed";
246 case Licensing_IsSeasonPassedValue::Licensed: return "Licensed";
247 default: return "Invalid Value";
248 }
249 }
250
251 friend std::ostream &operator<<(std::ostream &os, Licensing_IsSeasonPassedValue data)
252 {
253 os << data.ToString();
254 return os;
255 }
256
257 std::string Serialize() const
258 {
259 std::stringstream ss;
260 ss << "u_" << this->value;
261 return ss.str();
262 }
263};
264
265/**
266 * \brief Direction of the sensor to determine positive rotation, as seen facing
267 * the LED side of the CANcoder.
268 */
270{
271public:
272 int value;
273
274 /**
275 * \brief Counter-clockwise motion reports positive rotation.
276 */
277 static constexpr int CounterClockwise_Positive = 0;
278 /**
279 * \brief Clockwise motion reports positive rotation.
280 */
281 static constexpr int Clockwise_Positive = 1;
282
284 value{value}
285 {}
286
288 value{-1}
289 {}
290
291 constexpr bool operator==(SensorDirectionValue data) const
292 {
293 return this->value == data.value;
294 }
295 constexpr bool operator==(int data) const
296 {
297 return this->value == data;
298 }
299 constexpr bool operator!=(SensorDirectionValue data) const
300 {
301 return this->value != data.value;
302 }
303 constexpr bool operator!=(int data) const
304 {
305 return this->value != data;
306 }
307 constexpr bool operator<(SensorDirectionValue data) const
308 {
309 return this->value < data.value;
310 }
311 constexpr bool operator<(int data) const
312 {
313 return this->value < data;
314 }
315
316 /**
317 * \brief Gets the string representation of this enum
318 *
319 * \returns String representation of this enum
320 */
321 std::string ToString() const
322 {
323 switch (value)
324 {
325 case SensorDirectionValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
326 case SensorDirectionValue::Clockwise_Positive: return "Clockwise_Positive";
327 default: return "Invalid Value";
328 }
329 }
330
331 friend std::ostream &operator<<(std::ostream &os, SensorDirectionValue data)
332 {
333 os << data.ToString();
334 return os;
335 }
336
337 std::string Serialize() const
338 {
339 std::stringstream ss;
340 ss << "u_" << this->value;
341 return ss.str();
342 }
343};
344
345/**
346 * \brief Whether device is locked by FRC.
347 */
349{
350public:
351 int value;
352
353 static constexpr int Frc_Locked = 1;
354 static constexpr int Frc_Unlocked = 0;
355
356 constexpr FrcLockValue(int value) :
357 value{value}
358 {}
359
360 constexpr FrcLockValue() :
361 value{-1}
362 {}
363
364 constexpr bool operator==(FrcLockValue data) const
365 {
366 return this->value == data.value;
367 }
368 constexpr bool operator==(int data) const
369 {
370 return this->value == data;
371 }
372 constexpr bool operator!=(FrcLockValue data) const
373 {
374 return this->value != data.value;
375 }
376 constexpr bool operator!=(int data) const
377 {
378 return this->value != data;
379 }
380 constexpr bool operator<(FrcLockValue data) const
381 {
382 return this->value < data.value;
383 }
384 constexpr bool operator<(int data) const
385 {
386 return this->value < data;
387 }
388
389 /**
390 * \brief Gets the string representation of this enum
391 *
392 * \returns String representation of this enum
393 */
394 std::string ToString() const
395 {
396 switch (value)
397 {
398 case FrcLockValue::Frc_Locked: return "Frc_Locked";
399 case FrcLockValue::Frc_Unlocked: return "Frc_Unlocked";
400 default: return "Invalid Value";
401 }
402 }
403
404 friend std::ostream &operator<<(std::ostream &os, FrcLockValue data)
405 {
406 os << data.ToString();
407 return os;
408 }
409
410 std::string Serialize() const
411 {
412 std::stringstream ss;
413 ss << "u_" << this->value;
414 return ss.str();
415 }
416};
417
418/**
419 * \brief Whether the robot is enabled.
420 */
422{
423public:
424 int value;
425
426 static constexpr int Enabled = 1;
427 static constexpr int Disabled = 0;
428
429 constexpr RobotEnableValue(int value) :
430 value{value}
431 {}
432
433 constexpr RobotEnableValue() :
434 value{-1}
435 {}
436
437 constexpr bool operator==(RobotEnableValue data) const
438 {
439 return this->value == data.value;
440 }
441 constexpr bool operator==(int data) const
442 {
443 return this->value == data;
444 }
445 constexpr bool operator!=(RobotEnableValue data) const
446 {
447 return this->value != data.value;
448 }
449 constexpr bool operator!=(int data) const
450 {
451 return this->value != data;
452 }
453 constexpr bool operator<(RobotEnableValue data) const
454 {
455 return this->value < data.value;
456 }
457 constexpr bool operator<(int data) const
458 {
459 return this->value < data;
460 }
461
462 /**
463 * \brief Gets the string representation of this enum
464 *
465 * \returns String representation of this enum
466 */
467 std::string ToString() const
468 {
469 switch (value)
470 {
471 case RobotEnableValue::Enabled: return "Enabled";
472 case RobotEnableValue::Disabled: return "Disabled";
473 default: return "Invalid Value";
474 }
475 }
476
477 friend std::ostream &operator<<(std::ostream &os, RobotEnableValue data)
478 {
479 os << data.ToString();
480 return os;
481 }
482
483 std::string Serialize() const
484 {
485 std::stringstream ss;
486 ss << "u_" << this->value;
487 return ss.str();
488 }
489};
490
491/**
492 * \brief The Color of LED1 when it's "On".
493 */
495{
496public:
497 int value;
498
499 static constexpr int Off = 0;
500 static constexpr int Red = 1;
501 static constexpr int Green = 2;
502 static constexpr int Orange = 3;
503 static constexpr int Blue = 4;
504 static constexpr int Pink = 5;
505 static constexpr int Cyan = 6;
506 static constexpr int White = 7;
507
508 constexpr Led1OnColorValue(int value) :
509 value{value}
510 {}
511
512 constexpr Led1OnColorValue() :
513 value{-1}
514 {}
515
516 constexpr bool operator==(Led1OnColorValue data) const
517 {
518 return this->value == data.value;
519 }
520 constexpr bool operator==(int data) const
521 {
522 return this->value == data;
523 }
524 constexpr bool operator!=(Led1OnColorValue data) const
525 {
526 return this->value != data.value;
527 }
528 constexpr bool operator!=(int data) const
529 {
530 return this->value != data;
531 }
532 constexpr bool operator<(Led1OnColorValue data) const
533 {
534 return this->value < data.value;
535 }
536 constexpr bool operator<(int data) const
537 {
538 return this->value < data;
539 }
540
541 /**
542 * \brief Gets the string representation of this enum
543 *
544 * \returns String representation of this enum
545 */
546 std::string ToString() const
547 {
548 switch (value)
549 {
550 case Led1OnColorValue::Off: return "Off";
551 case Led1OnColorValue::Red: return "Red";
552 case Led1OnColorValue::Green: return "Green";
553 case Led1OnColorValue::Orange: return "Orange";
554 case Led1OnColorValue::Blue: return "Blue";
555 case Led1OnColorValue::Pink: return "Pink";
556 case Led1OnColorValue::Cyan: return "Cyan";
557 case Led1OnColorValue::White: return "White";
558 default: return "Invalid Value";
559 }
560 }
561
562 friend std::ostream &operator<<(std::ostream &os, Led1OnColorValue data)
563 {
564 os << data.ToString();
565 return os;
566 }
567
568 std::string Serialize() const
569 {
570 std::stringstream ss;
571 ss << "u_" << this->value;
572 return ss.str();
573 }
574};
575
576/**
577 * \brief The Color of LED1 when it's "Off".
578 */
580{
581public:
582 int value;
583
584 static constexpr int Off = 0;
585 static constexpr int Red = 1;
586 static constexpr int Green = 2;
587 static constexpr int Orange = 3;
588 static constexpr int Blue = 4;
589 static constexpr int Pink = 5;
590 static constexpr int Cyan = 6;
591 static constexpr int White = 7;
592
593 constexpr Led1OffColorValue(int value) :
594 value{value}
595 {}
596
597 constexpr Led1OffColorValue() :
598 value{-1}
599 {}
600
601 constexpr bool operator==(Led1OffColorValue data) const
602 {
603 return this->value == data.value;
604 }
605 constexpr bool operator==(int data) const
606 {
607 return this->value == data;
608 }
609 constexpr bool operator!=(Led1OffColorValue data) const
610 {
611 return this->value != data.value;
612 }
613 constexpr bool operator!=(int data) const
614 {
615 return this->value != data;
616 }
617 constexpr bool operator<(Led1OffColorValue data) const
618 {
619 return this->value < data.value;
620 }
621 constexpr bool operator<(int data) const
622 {
623 return this->value < data;
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 Led1OffColorValue::Off: return "Off";
636 case Led1OffColorValue::Red: return "Red";
637 case Led1OffColorValue::Green: return "Green";
638 case Led1OffColorValue::Orange: return "Orange";
639 case Led1OffColorValue::Blue: return "Blue";
640 case Led1OffColorValue::Pink: return "Pink";
641 case Led1OffColorValue::Cyan: return "Cyan";
642 case Led1OffColorValue::White: return "White";
643 default: return "Invalid Value";
644 }
645 }
646
647 friend std::ostream &operator<<(std::ostream &os, Led1OffColorValue 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
661/**
662 * \brief The Color of LED2 when it's "On".
663 */
665{
666public:
667 int value;
668
669 static constexpr int Off = 0;
670 static constexpr int Red = 1;
671 static constexpr int Green = 2;
672 static constexpr int Orange = 3;
673 static constexpr int Blue = 4;
674 static constexpr int Pink = 5;
675 static constexpr int Cyan = 6;
676 static constexpr int White = 7;
677
678 constexpr Led2OnColorValue(int value) :
679 value{value}
680 {}
681
682 constexpr Led2OnColorValue() :
683 value{-1}
684 {}
685
686 constexpr bool operator==(Led2OnColorValue data) const
687 {
688 return this->value == data.value;
689 }
690 constexpr bool operator==(int data) const
691 {
692 return this->value == data;
693 }
694 constexpr bool operator!=(Led2OnColorValue data) const
695 {
696 return this->value != data.value;
697 }
698 constexpr bool operator!=(int data) const
699 {
700 return this->value != data;
701 }
702 constexpr bool operator<(Led2OnColorValue data) const
703 {
704 return this->value < data.value;
705 }
706 constexpr bool operator<(int data) const
707 {
708 return this->value < data;
709 }
710
711 /**
712 * \brief Gets the string representation of this enum
713 *
714 * \returns String representation of this enum
715 */
716 std::string ToString() const
717 {
718 switch (value)
719 {
720 case Led2OnColorValue::Off: return "Off";
721 case Led2OnColorValue::Red: return "Red";
722 case Led2OnColorValue::Green: return "Green";
723 case Led2OnColorValue::Orange: return "Orange";
724 case Led2OnColorValue::Blue: return "Blue";
725 case Led2OnColorValue::Pink: return "Pink";
726 case Led2OnColorValue::Cyan: return "Cyan";
727 case Led2OnColorValue::White: return "White";
728 default: return "Invalid Value";
729 }
730 }
731
732 friend std::ostream &operator<<(std::ostream &os, Led2OnColorValue data)
733 {
734 os << data.ToString();
735 return os;
736 }
737
738 std::string Serialize() const
739 {
740 std::stringstream ss;
741 ss << "u_" << this->value;
742 return ss.str();
743 }
744};
745
746/**
747 * \brief The Color of LED2 when it's "Off".
748 */
750{
751public:
752 int value;
753
754 static constexpr int Off = 0;
755 static constexpr int Red = 1;
756 static constexpr int Green = 2;
757 static constexpr int Orange = 3;
758 static constexpr int Blue = 4;
759 static constexpr int Pink = 5;
760 static constexpr int Cyan = 6;
761 static constexpr int White = 7;
762
763 constexpr Led2OffColorValue(int value) :
764 value{value}
765 {}
766
767 constexpr Led2OffColorValue() :
768 value{-1}
769 {}
770
771 constexpr bool operator==(Led2OffColorValue data) const
772 {
773 return this->value == data.value;
774 }
775 constexpr bool operator==(int data) const
776 {
777 return this->value == data;
778 }
779 constexpr bool operator!=(Led2OffColorValue data) const
780 {
781 return this->value != data.value;
782 }
783 constexpr bool operator!=(int data) const
784 {
785 return this->value != data;
786 }
787 constexpr bool operator<(Led2OffColorValue data) const
788 {
789 return this->value < data.value;
790 }
791 constexpr bool operator<(int data) const
792 {
793 return this->value < data;
794 }
795
796 /**
797 * \brief Gets the string representation of this enum
798 *
799 * \returns String representation of this enum
800 */
801 std::string ToString() const
802 {
803 switch (value)
804 {
805 case Led2OffColorValue::Off: return "Off";
806 case Led2OffColorValue::Red: return "Red";
807 case Led2OffColorValue::Green: return "Green";
808 case Led2OffColorValue::Orange: return "Orange";
809 case Led2OffColorValue::Blue: return "Blue";
810 case Led2OffColorValue::Pink: return "Pink";
811 case Led2OffColorValue::Cyan: return "Cyan";
812 case Led2OffColorValue::White: return "White";
813 default: return "Invalid Value";
814 }
815 }
816
817 friend std::ostream &operator<<(std::ostream &os, Led2OffColorValue data)
818 {
819 os << data.ToString();
820 return os;
821 }
822
823 std::string Serialize() const
824 {
825 std::stringstream ss;
826 ss << "u_" << this->value;
827 return ss.str();
828 }
829};
830
831/**
832 * \brief Whether the device is enabled.
833 */
835{
836public:
837 int value;
838
839 static constexpr int Enabled = 1;
840 static constexpr int Disabled = 0;
841
842 constexpr DeviceEnableValue(int value) :
843 value{value}
844 {}
845
846 constexpr DeviceEnableValue() :
847 value{-1}
848 {}
849
850 constexpr bool operator==(DeviceEnableValue data) const
851 {
852 return this->value == data.value;
853 }
854 constexpr bool operator==(int data) const
855 {
856 return this->value == data;
857 }
858 constexpr bool operator!=(DeviceEnableValue data) const
859 {
860 return this->value != data.value;
861 }
862 constexpr bool operator!=(int data) const
863 {
864 return this->value != data;
865 }
866 constexpr bool operator<(DeviceEnableValue data) const
867 {
868 return this->value < data.value;
869 }
870 constexpr bool operator<(int data) const
871 {
872 return this->value < data;
873 }
874
875 /**
876 * \brief Gets the string representation of this enum
877 *
878 * \returns String representation of this enum
879 */
880 std::string ToString() const
881 {
882 switch (value)
883 {
884 case DeviceEnableValue::Enabled: return "Enabled";
885 case DeviceEnableValue::Disabled: return "Disabled";
886 default: return "Invalid Value";
887 }
888 }
889
890 friend std::ostream &operator<<(std::ostream &os, DeviceEnableValue data)
891 {
892 os << data.ToString();
893 return os;
894 }
895
896 std::string Serialize() const
897 {
898 std::stringstream ss;
899 ss << "u_" << this->value;
900 return ss.str();
901 }
902};
903
904/**
905 * \brief Forward Limit Pin.
906 */
908{
909public:
910 int value;
911
912 static constexpr int ClosedToGround = 0;
913 static constexpr int Open = 1;
914
915 constexpr ForwardLimitValue(int value) :
916 value{value}
917 {}
918
919 constexpr ForwardLimitValue() :
920 value{-1}
921 {}
922
923 constexpr bool operator==(ForwardLimitValue data) const
924 {
925 return this->value == data.value;
926 }
927 constexpr bool operator==(int data) const
928 {
929 return this->value == data;
930 }
931 constexpr bool operator!=(ForwardLimitValue data) const
932 {
933 return this->value != data.value;
934 }
935 constexpr bool operator!=(int data) const
936 {
937 return this->value != data;
938 }
939 constexpr bool operator<(ForwardLimitValue data) const
940 {
941 return this->value < data.value;
942 }
943 constexpr bool operator<(int data) const
944 {
945 return this->value < data;
946 }
947
948 /**
949 * \brief Gets the string representation of this enum
950 *
951 * \returns String representation of this enum
952 */
953 std::string ToString() const
954 {
955 switch (value)
956 {
957 case ForwardLimitValue::ClosedToGround: return "Closed To Ground";
958 case ForwardLimitValue::Open: return "Open";
959 default: return "Invalid Value";
960 }
961 }
962
963 friend std::ostream &operator<<(std::ostream &os, ForwardLimitValue data)
964 {
965 os << data.ToString();
966 return os;
967 }
968
969 std::string Serialize() const
970 {
971 std::stringstream ss;
972 ss << "u_" << this->value;
973 return ss.str();
974 }
975};
976
977/**
978 * \brief Reverse Limit Pin.
979 */
981{
982public:
983 int value;
984
985 static constexpr int ClosedToGround = 0;
986 static constexpr int Open = 1;
987
988 constexpr ReverseLimitValue(int value) :
989 value{value}
990 {}
991
992 constexpr ReverseLimitValue() :
993 value{-1}
994 {}
995
996 constexpr bool operator==(ReverseLimitValue data) const
997 {
998 return this->value == data.value;
999 }
1000 constexpr bool operator==(int data) const
1001 {
1002 return this->value == data;
1003 }
1004 constexpr bool operator!=(ReverseLimitValue data) const
1005 {
1006 return this->value != data.value;
1007 }
1008 constexpr bool operator!=(int data) const
1009 {
1010 return this->value != data;
1011 }
1012 constexpr bool operator<(ReverseLimitValue data) const
1013 {
1014 return this->value < data.value;
1015 }
1016 constexpr bool operator<(int data) const
1017 {
1018 return this->value < data;
1019 }
1020
1021 /**
1022 * \brief Gets the string representation of this enum
1023 *
1024 * \returns String representation of this enum
1025 */
1026 std::string ToString() const
1027 {
1028 switch (value)
1029 {
1030 case ReverseLimitValue::ClosedToGround: return "Closed To Ground";
1031 case ReverseLimitValue::Open: return "Open";
1032 default: return "Invalid Value";
1033 }
1034 }
1035
1036 friend std::ostream &operator<<(std::ostream &os, ReverseLimitValue data)
1037 {
1038 os << data.ToString();
1039 return os;
1040 }
1041
1042 std::string Serialize() const
1043 {
1044 std::stringstream ss;
1045 ss << "u_" << this->value;
1046 return ss.str();
1047 }
1048};
1049
1050/**
1051 * \brief The applied rotor polarity as seen from the front of the motor. This
1052 * typically is determined by the Inverted config, but can be overridden
1053 * if using Follower features.
1054 */
1056{
1057public:
1059
1060 /**
1061 * \brief Positive motor output results in counter-clockwise motion.
1062 */
1063 static constexpr int PositiveIsCounterClockwise = 0;
1064 /**
1065 * \brief Positive motor output results in clockwise motion.
1066 */
1067 static constexpr int PositiveIsClockwise = 1;
1068
1070 value{value}
1071 {}
1072
1074 value{-1}
1075 {}
1076
1077 constexpr bool operator==(AppliedRotorPolarityValue data) const
1078 {
1079 return this->value == data.value;
1080 }
1081 constexpr bool operator==(int data) const
1082 {
1083 return this->value == data;
1084 }
1085 constexpr bool operator!=(AppliedRotorPolarityValue data) const
1086 {
1087 return this->value != data.value;
1088 }
1089 constexpr bool operator!=(int data) const
1090 {
1091 return this->value != data;
1092 }
1093 constexpr bool operator<(AppliedRotorPolarityValue data) const
1094 {
1095 return this->value < data.value;
1096 }
1097 constexpr bool operator<(int data) const
1098 {
1099 return this->value < data;
1100 }
1101
1102 /**
1103 * \brief Gets the string representation of this enum
1104 *
1105 * \returns String representation of this enum
1106 */
1107 std::string ToString() const
1108 {
1109 switch (value)
1110 {
1111 case AppliedRotorPolarityValue::PositiveIsCounterClockwise: return "PositiveIsCounterClockwise";
1112 case AppliedRotorPolarityValue::PositiveIsClockwise: return "PositiveIsClockwise";
1113 default: return "Invalid Value";
1114 }
1115 }
1116
1117 friend std::ostream &operator<<(std::ostream &os, AppliedRotorPolarityValue data)
1118 {
1119 os << data.ToString();
1120 return os;
1121 }
1122
1123 std::string Serialize() const
1124 {
1125 std::stringstream ss;
1126 ss << "u_" << this->value;
1127 return ss.str();
1128 }
1129};
1130
1131/**
1132 * \brief The active control mode of the motor controller.
1133 */
1135{
1136public:
1138
1139 static constexpr int DisabledOutput = 0;
1140 static constexpr int NeutralOut = 1;
1141 static constexpr int StaticBrake = 2;
1142 static constexpr int DutyCycleOut = 3;
1143 static constexpr int PositionDutyCycle = 4;
1144 static constexpr int VelocityDutyCycle = 5;
1145 static constexpr int MotionMagicDutyCycle = 6;
1146 static constexpr int DutyCycleFOC = 7;
1147 static constexpr int PositionDutyCycleFOC = 8;
1148 static constexpr int VelocityDutyCycleFOC = 9;
1149 static constexpr int MotionMagicDutyCycleFOC = 10;
1150 static constexpr int VoltageOut = 11;
1151 static constexpr int PositionVoltage = 12;
1152 static constexpr int VelocityVoltage = 13;
1153 static constexpr int MotionMagicVoltage = 14;
1154 static constexpr int VoltageFOC = 15;
1155 static constexpr int PositionVoltageFOC = 16;
1156 static constexpr int VelocityVoltageFOC = 17;
1157 static constexpr int MotionMagicVoltageFOC = 18;
1158 static constexpr int TorqueCurrentFOC = 19;
1159 static constexpr int PositionTorqueCurrentFOC = 20;
1160 static constexpr int VelocityTorqueCurrentFOC = 21;
1161 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1162 static constexpr int Follower = 23;
1163 static constexpr int Reserved = 24;
1164 static constexpr int CoastOut = 25;
1165 static constexpr int UnauthorizedDevice = 26;
1166 static constexpr int MusicTone = 27;
1167 static constexpr int MotionMagicVelocityDutyCycle = 28;
1168 static constexpr int MotionMagicVelocityDutyCycleFOC = 29;
1169 static constexpr int MotionMagicVelocityVoltage = 30;
1170 static constexpr int MotionMagicVelocityVoltageFOC = 31;
1171 static constexpr int MotionMagicVelocityTorqueCurrentFOC = 32;
1172 static constexpr int MotionMagicExpoDutyCycle = 33;
1173 static constexpr int MotionMagicExpoDutyCycleFOC = 34;
1174 static constexpr int MotionMagicExpoVoltage = 35;
1175 static constexpr int MotionMagicExpoVoltageFOC = 36;
1176 static constexpr int MotionMagicExpoTorqueCurrentFOC = 37;
1177
1178 constexpr ControlModeValue(int value) :
1179 value{value}
1180 {}
1181
1182 constexpr ControlModeValue() :
1183 value{-1}
1184 {}
1185
1186 constexpr bool operator==(ControlModeValue data) const
1187 {
1188 return this->value == data.value;
1189 }
1190 constexpr bool operator==(int data) const
1191 {
1192 return this->value == data;
1193 }
1194 constexpr bool operator!=(ControlModeValue data) const
1195 {
1196 return this->value != data.value;
1197 }
1198 constexpr bool operator!=(int data) const
1199 {
1200 return this->value != data;
1201 }
1202 constexpr bool operator<(ControlModeValue data) const
1203 {
1204 return this->value < data.value;
1205 }
1206 constexpr bool operator<(int data) const
1207 {
1208 return this->value < data;
1209 }
1210
1211 /**
1212 * \brief Gets the string representation of this enum
1213 *
1214 * \returns String representation of this enum
1215 */
1216 std::string ToString() const
1217 {
1218 switch (value)
1219 {
1220 case ControlModeValue::DisabledOutput: return "DisabledOutput";
1221 case ControlModeValue::NeutralOut: return "NeutralOut";
1222 case ControlModeValue::StaticBrake: return "StaticBrake";
1223 case ControlModeValue::DutyCycleOut: return "DutyCycleOut";
1224 case ControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1225 case ControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1226 case ControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1227 case ControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1228 case ControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1229 case ControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1230 case ControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1231 case ControlModeValue::VoltageOut: return "VoltageOut";
1232 case ControlModeValue::PositionVoltage: return "PositionVoltage";
1233 case ControlModeValue::VelocityVoltage: return "VelocityVoltage";
1234 case ControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1235 case ControlModeValue::VoltageFOC: return "VoltageFOC";
1236 case ControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1237 case ControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1238 case ControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1239 case ControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1240 case ControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1241 case ControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1242 case ControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1243 case ControlModeValue::Follower: return "Follower";
1244 case ControlModeValue::Reserved: return "Reserved";
1245 case ControlModeValue::CoastOut: return "CoastOut";
1246 case ControlModeValue::UnauthorizedDevice: return "UnauthorizedDevice";
1247 case ControlModeValue::MusicTone: return "MusicTone";
1248 case ControlModeValue::MotionMagicVelocityDutyCycle: return "MotionMagicVelocityDutyCycle";
1249 case ControlModeValue::MotionMagicVelocityDutyCycleFOC: return "MotionMagicVelocityDutyCycleFOC";
1250 case ControlModeValue::MotionMagicVelocityVoltage: return "MotionMagicVelocityVoltage";
1251 case ControlModeValue::MotionMagicVelocityVoltageFOC: return "MotionMagicVelocityVoltageFOC";
1252 case ControlModeValue::MotionMagicVelocityTorqueCurrentFOC: return "MotionMagicVelocityTorqueCurrentFOC";
1253 case ControlModeValue::MotionMagicExpoDutyCycle: return "MotionMagicExpoDutyCycle";
1254 case ControlModeValue::MotionMagicExpoDutyCycleFOC: return "MotionMagicExpoDutyCycleFOC";
1255 case ControlModeValue::MotionMagicExpoVoltage: return "MotionMagicExpoVoltage";
1256 case ControlModeValue::MotionMagicExpoVoltageFOC: return "MotionMagicExpoVoltageFOC";
1257 case ControlModeValue::MotionMagicExpoTorqueCurrentFOC: return "MotionMagicExpoTorqueCurrentFOC";
1258 default: return "Invalid Value";
1259 }
1260 }
1261
1262 friend std::ostream &operator<<(std::ostream &os, ControlModeValue data)
1263 {
1264 os << data.ToString();
1265 return os;
1266 }
1267
1268 std::string Serialize() const
1269 {
1270 std::stringstream ss;
1271 ss << "u_" << this->value;
1272 return ss.str();
1273 }
1274};
1275
1276/**
1277 * \brief Check if Motion Magic® is running. This is equivalent to checking
1278 * that the reported control mode is a Motion Magic® based mode.
1279 */
1281{
1282public:
1284
1285 static constexpr int Enabled = 1;
1286 static constexpr int Disabled = 0;
1287
1289 value{value}
1290 {}
1291
1293 value{-1}
1294 {}
1295
1296 constexpr bool operator==(MotionMagicIsRunningValue data) const
1297 {
1298 return this->value == data.value;
1299 }
1300 constexpr bool operator==(int data) const
1301 {
1302 return this->value == data;
1303 }
1304 constexpr bool operator!=(MotionMagicIsRunningValue data) const
1305 {
1306 return this->value != data.value;
1307 }
1308 constexpr bool operator!=(int data) const
1309 {
1310 return this->value != data;
1311 }
1312 constexpr bool operator<(MotionMagicIsRunningValue data) const
1313 {
1314 return this->value < data.value;
1315 }
1316 constexpr bool operator<(int data) const
1317 {
1318 return this->value < data;
1319 }
1320
1321 /**
1322 * \brief Gets the string representation of this enum
1323 *
1324 * \returns String representation of this enum
1325 */
1326 std::string ToString() const
1327 {
1328 switch (value)
1329 {
1330 case MotionMagicIsRunningValue::Enabled: return "Enabled";
1331 case MotionMagicIsRunningValue::Disabled: return "Disabled";
1332 default: return "Invalid Value";
1333 }
1334 }
1335
1336 friend std::ostream &operator<<(std::ostream &os, MotionMagicIsRunningValue data)
1337 {
1338 os << data.ToString();
1339 return os;
1340 }
1341
1342 std::string Serialize() const
1343 {
1344 std::stringstream ss;
1345 ss << "u_" << this->value;
1346 return ss.str();
1347 }
1348};
1349
1350/**
1351 * \brief Whether the closed-loop is running on position or velocity.
1352 */
1354{
1355public:
1357
1358 static constexpr int Position = 0;
1359 static constexpr int Velocity = 1;
1360
1362 value{value}
1363 {}
1364
1366 value{-1}
1367 {}
1368
1370 {
1371 return this->value == data.value;
1372 }
1373 constexpr bool operator==(int data) const
1374 {
1375 return this->value == data;
1376 }
1378 {
1379 return this->value != data.value;
1380 }
1381 constexpr bool operator!=(int data) const
1382 {
1383 return this->value != data;
1384 }
1386 {
1387 return this->value < data.value;
1388 }
1389 constexpr bool operator<(int data) const
1390 {
1391 return this->value < data;
1392 }
1393
1394 /**
1395 * \brief Gets the string representation of this enum
1396 *
1397 * \returns String representation of this enum
1398 */
1399 std::string ToString() const
1400 {
1401 switch (value)
1402 {
1403 case PIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1404 case PIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1405 default: return "Invalid Value";
1406 }
1407 }
1408
1409 friend std::ostream &operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data)
1410 {
1411 os << data.ToString();
1412 return os;
1413 }
1414
1415 std::string Serialize() const
1416 {
1417 std::stringstream ss;
1418 ss << "u_" << this->value;
1419 return ss.str();
1420 }
1421};
1422
1423/**
1424 * \brief The output mode of the PID controller.
1425 */
1427{
1428public:
1430
1431 static constexpr int DutyCycle = 0;
1432 static constexpr int Voltage = 1;
1433 static constexpr int TorqueCurrentFOC = 2;
1434
1436 value{value}
1437 {}
1438
1440 value{-1}
1441 {}
1442
1443 constexpr bool operator==(PIDOutput_PIDOutputModeValue data) const
1444 {
1445 return this->value == data.value;
1446 }
1447 constexpr bool operator==(int data) const
1448 {
1449 return this->value == data;
1450 }
1451 constexpr bool operator!=(PIDOutput_PIDOutputModeValue data) const
1452 {
1453 return this->value != data.value;
1454 }
1455 constexpr bool operator!=(int data) const
1456 {
1457 return this->value != data;
1458 }
1459 constexpr bool operator<(PIDOutput_PIDOutputModeValue data) const
1460 {
1461 return this->value < data.value;
1462 }
1463 constexpr bool operator<(int data) const
1464 {
1465 return this->value < data;
1466 }
1467
1468 /**
1469 * \brief Gets the string representation of this enum
1470 *
1471 * \returns String representation of this enum
1472 */
1473 std::string ToString() const
1474 {
1475 switch (value)
1476 {
1477 case PIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
1478 case PIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
1479 case PIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1480 default: return "Invalid Value";
1481 }
1482 }
1483
1484 friend std::ostream &operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data)
1485 {
1486 os << data.ToString();
1487 return os;
1488 }
1489
1490 std::string Serialize() const
1491 {
1492 std::stringstream ss;
1493 ss << "u_" << this->value;
1494 return ss.str();
1495 }
1496};
1497
1498/**
1499 * \brief Whether the closed-loop is running on position or velocity.
1500 */
1502{
1503public:
1505
1506 static constexpr int Position = 0;
1507 static constexpr int Velocity = 1;
1508
1512
1514 value{-1}
1515 {}
1516
1518 {
1519 return this->value == data.value;
1520 }
1521 constexpr bool operator==(int data) const
1522 {
1523 return this->value == data;
1524 }
1526 {
1527 return this->value != data.value;
1528 }
1529 constexpr bool operator!=(int data) const
1530 {
1531 return this->value != data;
1532 }
1534 {
1535 return this->value < data.value;
1536 }
1537 constexpr bool operator<(int data) const
1538 {
1539 return this->value < data;
1540 }
1541
1542 /**
1543 * \brief Gets the string representation of this enum
1544 *
1545 * \returns String representation of this enum
1546 */
1547 std::string ToString() const
1548 {
1549 switch (value)
1550 {
1553 default: return "Invalid Value";
1554 }
1555 }
1556
1557 friend std::ostream &operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data)
1558 {
1559 os << data.ToString();
1560 return os;
1561 }
1562
1563 std::string Serialize() const
1564 {
1565 std::stringstream ss;
1566 ss << "u_" << this->value;
1567 return ss.str();
1568 }
1569};
1570
1571/**
1572 * \brief Assess the status of the motor output with respect to load and supply.
1573 *
1574 * \details This routine can be used to determine the general status of motor
1575 * commutation.
1576 */
1578{
1579public:
1581
1582 /**
1583 * \brief The status of motor output could not be determined.
1584 */
1585 static constexpr int Unknown = 0;
1586 /**
1587 * \brief Motor output is disabled.
1588 */
1589 static constexpr int Off = 1;
1590 /**
1591 * \brief The motor is in neutral-brake.
1592 */
1593 static constexpr int StaticBraking = 2;
1594 /**
1595 * \brief The motor is loaded in a typical fashion, drawing current from the
1596 * supply, and successfully turning the rotor in the direction of applied
1597 * voltage.
1598 */
1599 static constexpr int Motoring = 3;
1600 /**
1601 * \brief The same as Motoring, except the rotor is being backdriven as the
1602 * motor output is not enough to defeat load forces.
1603 */
1604 static constexpr int DiscordantMotoring = 4;
1605 /**
1606 * \brief The motor is braking in such a way where motor current is traveling
1607 * back to the supply (typically a battery).
1608 */
1609 static constexpr int RegenBraking = 5;
1610
1612 value{value}
1613 {}
1614
1616 value{-1}
1617 {}
1618
1619 constexpr bool operator==(MotorOutputStatusValue data) const
1620 {
1621 return this->value == data.value;
1622 }
1623 constexpr bool operator==(int data) const
1624 {
1625 return this->value == data;
1626 }
1627 constexpr bool operator!=(MotorOutputStatusValue data) const
1628 {
1629 return this->value != data.value;
1630 }
1631 constexpr bool operator!=(int data) const
1632 {
1633 return this->value != data;
1634 }
1635 constexpr bool operator<(MotorOutputStatusValue data) const
1636 {
1637 return this->value < data.value;
1638 }
1639 constexpr bool operator<(int data) const
1640 {
1641 return this->value < data;
1642 }
1643
1644 /**
1645 * \brief Gets the string representation of this enum
1646 *
1647 * \returns String representation of this enum
1648 */
1649 std::string ToString() const
1650 {
1651 switch (value)
1652 {
1653 case MotorOutputStatusValue::Unknown: return "Unknown";
1654 case MotorOutputStatusValue::Off: return "Off";
1655 case MotorOutputStatusValue::StaticBraking: return "StaticBraking";
1656 case MotorOutputStatusValue::Motoring: return "Motoring";
1657 case MotorOutputStatusValue::DiscordantMotoring: return "DiscordantMotoring";
1658 case MotorOutputStatusValue::RegenBraking: return "RegenBraking";
1659 default: return "Invalid Value";
1660 }
1661 }
1662
1663 friend std::ostream &operator<<(std::ostream &os, MotorOutputStatusValue data)
1664 {
1665 os << data.ToString();
1666 return os;
1667 }
1668
1669 std::string Serialize() const
1670 {
1671 std::stringstream ss;
1672 ss << "u_" << this->value;
1673 return ss.str();
1674 }
1675};
1676
1677/**
1678 * \brief The active control mode of the differential controller.
1679 */
1681{
1682public:
1684
1685 static constexpr int DisabledOutput = 0;
1686 static constexpr int NeutralOut = 1;
1687 static constexpr int StaticBrake = 2;
1688 static constexpr int DutyCycleOut = 3;
1689 static constexpr int PositionDutyCycle = 4;
1690 static constexpr int VelocityDutyCycle = 5;
1691 static constexpr int MotionMagicDutyCycle = 6;
1692 static constexpr int DutyCycleFOC = 7;
1693 static constexpr int PositionDutyCycleFOC = 8;
1694 static constexpr int VelocityDutyCycleFOC = 9;
1695 static constexpr int MotionMagicDutyCycleFOC = 10;
1696 static constexpr int VoltageOut = 11;
1697 static constexpr int PositionVoltage = 12;
1698 static constexpr int VelocityVoltage = 13;
1699 static constexpr int MotionMagicVoltage = 14;
1700 static constexpr int VoltageFOC = 15;
1701 static constexpr int PositionVoltageFOC = 16;
1702 static constexpr int VelocityVoltageFOC = 17;
1703 static constexpr int MotionMagicVoltageFOC = 18;
1704 static constexpr int TorqueCurrentFOC = 19;
1705 static constexpr int PositionTorqueCurrentFOC = 20;
1706 static constexpr int VelocityTorqueCurrentFOC = 21;
1707 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1708 static constexpr int Follower = 23;
1709 static constexpr int Reserved = 24;
1710 static constexpr int CoastOut = 25;
1711
1713 value{value}
1714 {}
1715
1717 value{-1}
1718 {}
1719
1720 constexpr bool operator==(DifferentialControlModeValue data) const
1721 {
1722 return this->value == data.value;
1723 }
1724 constexpr bool operator==(int data) const
1725 {
1726 return this->value == data;
1727 }
1728 constexpr bool operator!=(DifferentialControlModeValue data) const
1729 {
1730 return this->value != data.value;
1731 }
1732 constexpr bool operator!=(int data) const
1733 {
1734 return this->value != data;
1735 }
1736 constexpr bool operator<(DifferentialControlModeValue data) const
1737 {
1738 return this->value < data.value;
1739 }
1740 constexpr bool operator<(int data) const
1741 {
1742 return this->value < data;
1743 }
1744
1745 /**
1746 * \brief Gets the string representation of this enum
1747 *
1748 * \returns String representation of this enum
1749 */
1750 std::string ToString() const
1751 {
1752 switch (value)
1753 {
1754 case DifferentialControlModeValue::DisabledOutput: return "DisabledOutput";
1755 case DifferentialControlModeValue::NeutralOut: return "NeutralOut";
1756 case DifferentialControlModeValue::StaticBrake: return "StaticBrake";
1757 case DifferentialControlModeValue::DutyCycleOut: return "DutyCycleOut";
1758 case DifferentialControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1759 case DifferentialControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1760 case DifferentialControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1761 case DifferentialControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1762 case DifferentialControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1763 case DifferentialControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1764 case DifferentialControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1765 case DifferentialControlModeValue::VoltageOut: return "VoltageOut";
1766 case DifferentialControlModeValue::PositionVoltage: return "PositionVoltage";
1767 case DifferentialControlModeValue::VelocityVoltage: return "VelocityVoltage";
1768 case DifferentialControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1769 case DifferentialControlModeValue::VoltageFOC: return "VoltageFOC";
1770 case DifferentialControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1771 case DifferentialControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1772 case DifferentialControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1773 case DifferentialControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1774 case DifferentialControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1775 case DifferentialControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1776 case DifferentialControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1777 case DifferentialControlModeValue::Follower: return "Follower";
1778 case DifferentialControlModeValue::Reserved: return "Reserved";
1779 case DifferentialControlModeValue::CoastOut: return "CoastOut";
1780 default: return "Invalid Value";
1781 }
1782 }
1783
1784 friend std::ostream &operator<<(std::ostream &os, DifferentialControlModeValue data)
1785 {
1786 os << data.ToString();
1787 return os;
1788 }
1789
1790 std::string Serialize() const
1791 {
1792 std::stringstream ss;
1793 ss << "u_" << this->value;
1794 return ss.str();
1795 }
1796};
1797
1798/**
1799 * \brief Whether the closed-loop is running on position or velocity.
1800 */
1802{
1803public:
1805
1806 static constexpr int Position = 0;
1807 static constexpr int Velocity = 1;
1808
1812
1814 value{-1}
1815 {}
1816
1818 {
1819 return this->value == data.value;
1820 }
1821 constexpr bool operator==(int data) const
1822 {
1823 return this->value == data;
1824 }
1826 {
1827 return this->value != data.value;
1828 }
1829 constexpr bool operator!=(int data) const
1830 {
1831 return this->value != data;
1832 }
1834 {
1835 return this->value < data.value;
1836 }
1837 constexpr bool operator<(int data) const
1838 {
1839 return this->value < data;
1840 }
1841
1842 /**
1843 * \brief Gets the string representation of this enum
1844 *
1845 * \returns String representation of this enum
1846 */
1847 std::string ToString() const
1848 {
1849 switch (value)
1850 {
1851 case DiffPIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1852 case DiffPIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1853 default: return "Invalid Value";
1854 }
1855 }
1856
1857 friend std::ostream &operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue 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
1871/**
1872 * \brief The output mode of the differential PID controller.
1873 */
1875{
1876public:
1878
1879 static constexpr int DutyCycle = 0;
1880 static constexpr int Voltage = 1;
1881 static constexpr int TorqueCurrentFOC = 2;
1882
1884 value{value}
1885 {}
1886
1888 value{-1}
1889 {}
1890
1892 {
1893 return this->value == data.value;
1894 }
1895 constexpr bool operator==(int data) const
1896 {
1897 return this->value == data;
1898 }
1900 {
1901 return this->value != data.value;
1902 }
1903 constexpr bool operator!=(int data) const
1904 {
1905 return this->value != data;
1906 }
1908 {
1909 return this->value < data.value;
1910 }
1911 constexpr bool operator<(int data) const
1912 {
1913 return this->value < data;
1914 }
1915
1916 /**
1917 * \brief Gets the string representation of this enum
1918 *
1919 * \returns String representation of this enum
1920 */
1921 std::string ToString() const
1922 {
1923 switch (value)
1924 {
1925 case DiffPIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
1926 case DiffPIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
1927 case DiffPIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1928 default: return "Invalid Value";
1929 }
1930 }
1931
1932 friend std::ostream &operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data)
1933 {
1934 os << data.ToString();
1935 return os;
1936 }
1937
1938 std::string Serialize() const
1939 {
1940 std::stringstream ss;
1941 ss << "u_" << this->value;
1942 return ss.str();
1943 }
1944};
1945
1946/**
1947 * \brief Whether the closed-loop is running on position or velocity.
1948 */
1950{
1951public:
1953
1954 static constexpr int Position = 0;
1955 static constexpr int Velocity = 1;
1956
1960
1964
1966 {
1967 return this->value == data.value;
1968 }
1969 constexpr bool operator==(int data) const
1970 {
1971 return this->value == data;
1972 }
1974 {
1975 return this->value != data.value;
1976 }
1977 constexpr bool operator!=(int data) const
1978 {
1979 return this->value != data;
1980 }
1982 {
1983 return this->value < data.value;
1984 }
1985 constexpr bool operator<(int data) const
1986 {
1987 return this->value < data;
1988 }
1989
1990 /**
1991 * \brief Gets the string representation of this enum
1992 *
1993 * \returns String representation of this enum
1994 */
1995 std::string ToString() const
1996 {
1997 switch (value)
1998 {
2001 default: return "Invalid Value";
2002 }
2003 }
2004
2005 friend std::ostream &operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data)
2006 {
2007 os << data.ToString();
2008 return os;
2009 }
2010
2011 std::string Serialize() const
2012 {
2013 std::stringstream ss;
2014 ss << "u_" << this->value;
2015 return ss.str();
2016 }
2017};
2018
2019/**
2020 * \brief Gravity Feedforward/Feedback Type.
2021 *
2022 * This determines the type of the gravity feedforward/feedback.
2023 *
2024 * Choose Elevator_Static for systems where the gravity feedforward is
2025 * constant, such as an elevator. The gravity feedforward output will
2026 * always have the same sign.
2027 *
2028 * Choose Arm_Cosine for systems where the gravity feedback is dependent
2029 * on the angular position of the mechanism, such as an arm. The gravity
2030 * feedback output will vary depending on the mechanism angular position.
2031 * Note that the sensor offset and ratios must be configured so that the
2032 * sensor reports a position of 0 when the mechanism is horizonal
2033 * (parallel to the ground), and the reported sensor position is 1:1 with
2034 * the mechanism.
2035 */
2037{
2038public:
2040
2041 /**
2042 * \brief The system's gravity feedforward is constant, such as an elevator. The
2043 * gravity feedforward output will always have the same sign.
2044 */
2045 static constexpr int Elevator_Static = 0;
2046 /**
2047 * \brief The system's gravity feedback is dependent on the angular position of
2048 * the mechanism, such as an arm. The gravity feedback output will vary
2049 * depending on the mechanism angular position. Note that the sensor
2050 * offset and ratios must be configured so that the sensor reports a
2051 * position of 0 when the mechanism is horizonal (parallel to the
2052 * ground), and the reported sensor position is 1:1 with the mechanism.
2053 */
2054 static constexpr int Arm_Cosine = 1;
2055
2056 constexpr GravityTypeValue(int value) :
2057 value{value}
2058 {}
2059
2060 constexpr GravityTypeValue() :
2061 value{-1}
2062 {}
2063
2064 constexpr bool operator==(GravityTypeValue data) const
2065 {
2066 return this->value == data.value;
2067 }
2068 constexpr bool operator==(int data) const
2069 {
2070 return this->value == data;
2071 }
2072 constexpr bool operator!=(GravityTypeValue data) const
2073 {
2074 return this->value != data.value;
2075 }
2076 constexpr bool operator!=(int data) const
2077 {
2078 return this->value != data;
2079 }
2080 constexpr bool operator<(GravityTypeValue data) const
2081 {
2082 return this->value < data.value;
2083 }
2084 constexpr bool operator<(int data) const
2085 {
2086 return this->value < data;
2087 }
2088
2089 /**
2090 * \brief Gets the string representation of this enum
2091 *
2092 * \returns String representation of this enum
2093 */
2094 std::string ToString() const
2095 {
2096 switch (value)
2097 {
2098 case GravityTypeValue::Elevator_Static: return "Elevator_Static";
2099 case GravityTypeValue::Arm_Cosine: return "Arm_Cosine";
2100 default: return "Invalid Value";
2101 }
2102 }
2103
2104 friend std::ostream &operator<<(std::ostream &os, GravityTypeValue data)
2105 {
2106 os << data.ToString();
2107 return os;
2108 }
2109
2110 std::string Serialize() const
2111 {
2112 std::stringstream ss;
2113 ss << "u_" << this->value;
2114 return ss.str();
2115 }
2116};
2117
2118/**
2119 * \brief Invert state of the device as seen from the front of the motor.
2120 */
2122{
2123public:
2125
2126 /**
2127 * \brief Positive motor output results in clockwise motion.
2128 */
2129 static constexpr int CounterClockwise_Positive = 0;
2130 /**
2131 * \brief Positive motor output results in counter-clockwise motion.
2132 */
2133 static constexpr int Clockwise_Positive = 1;
2134
2135 constexpr InvertedValue(int value) :
2136 value{value}
2137 {}
2138
2139 constexpr InvertedValue() :
2140 value{-1}
2141 {}
2142
2143 constexpr bool operator==(InvertedValue data) const
2144 {
2145 return this->value == data.value;
2146 }
2147 constexpr bool operator==(int data) const
2148 {
2149 return this->value == data;
2150 }
2151 constexpr bool operator!=(InvertedValue data) const
2152 {
2153 return this->value != data.value;
2154 }
2155 constexpr bool operator!=(int data) const
2156 {
2157 return this->value != data;
2158 }
2159 constexpr bool operator<(InvertedValue data) const
2160 {
2161 return this->value < data.value;
2162 }
2163 constexpr bool operator<(int data) const
2164 {
2165 return this->value < data;
2166 }
2167
2168 /**
2169 * \brief Gets the string representation of this enum
2170 *
2171 * \returns String representation of this enum
2172 */
2173 std::string ToString() const
2174 {
2175 switch (value)
2176 {
2177 case InvertedValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
2178 case InvertedValue::Clockwise_Positive: return "Clockwise_Positive";
2179 default: return "Invalid Value";
2180 }
2181 }
2182
2183 friend std::ostream &operator<<(std::ostream &os, InvertedValue data)
2184 {
2185 os << data.ToString();
2186 return os;
2187 }
2188
2189 std::string Serialize() const
2190 {
2191 std::stringstream ss;
2192 ss << "u_" << this->value;
2193 return ss.str();
2194 }
2195};
2196
2197/**
2198 * \brief The state of the motor controller bridge when output is neutral or
2199 * disabled.
2200 */
2202{
2203public:
2205
2206 static constexpr int Coast = 0;
2207 static constexpr int Brake = 1;
2208
2209 constexpr NeutralModeValue(int value) :
2210 value{value}
2211 {}
2212
2213 constexpr NeutralModeValue() :
2214 value{-1}
2215 {}
2216
2217 constexpr bool operator==(NeutralModeValue data) const
2218 {
2219 return this->value == data.value;
2220 }
2221 constexpr bool operator==(int data) const
2222 {
2223 return this->value == data;
2224 }
2225 constexpr bool operator!=(NeutralModeValue data) const
2226 {
2227 return this->value != data.value;
2228 }
2229 constexpr bool operator!=(int data) const
2230 {
2231 return this->value != data;
2232 }
2233 constexpr bool operator<(NeutralModeValue data) const
2234 {
2235 return this->value < data.value;
2236 }
2237 constexpr bool operator<(int data) const
2238 {
2239 return this->value < data;
2240 }
2241
2242 /**
2243 * \brief Gets the string representation of this enum
2244 *
2245 * \returns String representation of this enum
2246 */
2247 std::string ToString() const
2248 {
2249 switch (value)
2250 {
2251 case NeutralModeValue::Coast: return "Coast";
2252 case NeutralModeValue::Brake: return "Brake";
2253 default: return "Invalid Value";
2254 }
2255 }
2256
2257 friend std::ostream &operator<<(std::ostream &os, NeutralModeValue data)
2258 {
2259 os << data.ToString();
2260 return os;
2261 }
2262
2263 std::string Serialize() const
2264 {
2265 std::stringstream ss;
2266 ss << "u_" << this->value;
2267 return ss.str();
2268 }
2269};
2270
2271/**
2272 * \brief Choose what sensor source is reported via API and used by closed-loop
2273 * and limit features. The default is RotorSensor, which uses the
2274 * internal rotor sensor in the Talon.
2275 *
2276 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2277 * (this also requires setting FeedbackRemoteSensorID). Talon will
2278 * update its position and velocity whenever CANcoder publishes its
2279 * information on CAN bus, and the Talon internal rotor will not be used.
2280 *
2281 * Choose FusedCANcoder (requires Phoenix Pro) and Talon will fuse
2282 * another CANcoder's information with the internal rotor, which provides
2283 * the best possible position and velocity for accuracy and bandwidth
2284 * (this also requires setting FeedbackRemoteSensorID). FusedCANcoder
2285 * was developed for applications such as swerve-azimuth.
2286 *
2287 * Choose SyncCANcoder (requires Phoenix Pro) and Talon will synchronize
2288 * its internal rotor position against another CANcoder, then continue to
2289 * use the rotor sensor for closed loop control (this also requires
2290 * setting FeedbackRemoteSensorID). The Talon will report if its
2291 * internal position differs significantly from the reported CANcoder
2292 * position. SyncCANcoder was developed for mechanisms where there is a
2293 * risk of the CANcoder failing in such a way that it reports a position
2294 * that does not match the mechanism, such as the sensor mounting
2295 * assembly breaking off.
2296 *
2297 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
2298 * to use another Pigeon2 on the same CAN bus (this also requires setting
2299 * FeedbackRemoteSensorID). Talon will update its position to match the
2300 * selected value whenever Pigeon2 publishes its information on CAN bus.
2301 * Note that the Talon position will be in rotations and not degrees.
2302 *
2303 * \details Note: When the feedback source is changed to FusedCANcoder or
2304 * SyncCANcoder, the Talon needs a period of time to fuse before
2305 * sensor-based (soft-limit, closed loop, etc.) features are used. This
2306 * period of time is determined by the update frequency of the
2307 * CANcoder's Position signal.
2308 */
2310{
2311public:
2313
2314 /**
2315 * \brief Use the internal rotor sensor in the Talon.
2316 */
2317 static constexpr int RotorSensor = 0;
2318 /**
2319 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2320 * FeedbackRemoteSensorID). Talon will update its position and velocity
2321 * whenever CANcoder publishes its information on CAN bus, and the Talon
2322 * internal rotor will not be used.
2323 */
2324 static constexpr int RemoteCANcoder = 1;
2325 /**
2326 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2327 * FeedbackRemoteSensorID). Talon will update its position to match the
2328 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
2329 * Note that the Talon position will be in rotations and not degrees.
2330 */
2331 static constexpr int RemotePigeon2_Yaw = 2;
2332 /**
2333 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2334 * FeedbackRemoteSensorID). Talon will update its position to match the
2335 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
2336 * Note that the Talon position will be in rotations and not degrees.
2337 */
2338 static constexpr int RemotePigeon2_Pitch = 3;
2339 /**
2340 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2341 * FeedbackRemoteSensorID). Talon will update its position to match the
2342 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
2343 * Note that the Talon position will be in rotations and not degrees.
2344 */
2345 static constexpr int RemotePigeon2_Roll = 4;
2346 /**
2347 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
2348 * with the internal rotor, which provides the best possible position and
2349 * velocity for accuracy and bandwidth (this also requires setting
2350 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
2351 * such as swerve-azimuth.
2352 */
2353 static constexpr int FusedCANcoder = 5;
2354 /**
2355 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
2356 * position against another CANcoder, then continue to use the rotor
2357 * sensor for closed loop control (this also requires setting
2358 * FeedbackRemoteSensorID). The Talon will report if its internal
2359 * position differs significantly from the reported CANcoder position.
2360 * SyncCANcoder was developed for mechanisms where there is a risk of the
2361 * CANcoder failing in such a way that it reports a position that does
2362 * not match the mechanism, such as the sensor mounting assembly breaking
2363 * off.
2364 */
2365 static constexpr int SyncCANcoder = 6;
2366
2368 value{value}
2369 {}
2370
2372 value{-1}
2373 {}
2374
2375 constexpr bool operator==(FeedbackSensorSourceValue data) const
2376 {
2377 return this->value == data.value;
2378 }
2379 constexpr bool operator==(int data) const
2380 {
2381 return this->value == data;
2382 }
2383 constexpr bool operator!=(FeedbackSensorSourceValue data) const
2384 {
2385 return this->value != data.value;
2386 }
2387 constexpr bool operator!=(int data) const
2388 {
2389 return this->value != data;
2390 }
2391 constexpr bool operator<(FeedbackSensorSourceValue data) const
2392 {
2393 return this->value < data.value;
2394 }
2395 constexpr bool operator<(int data) const
2396 {
2397 return this->value < data;
2398 }
2399
2400 /**
2401 * \brief Gets the string representation of this enum
2402 *
2403 * \returns String representation of this enum
2404 */
2405 std::string ToString() const
2406 {
2407 switch (value)
2408 {
2409 case FeedbackSensorSourceValue::RotorSensor: return "RotorSensor";
2410 case FeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2411 case FeedbackSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
2412 case FeedbackSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
2413 case FeedbackSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
2414 case FeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
2415 case FeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
2416 default: return "Invalid Value";
2417 }
2418 }
2419
2420 friend std::ostream &operator<<(std::ostream &os, FeedbackSensorSourceValue data)
2421 {
2422 os << data.ToString();
2423 return os;
2424 }
2425
2426 std::string Serialize() const
2427 {
2428 std::stringstream ss;
2429 ss << "u_" << this->value;
2430 return ss.str();
2431 }
2432};
2433
2434/**
2435 * \brief Determines if the forward limit switch is normally-open (default) or
2436 * normally-closed.
2437 */
2439{
2440public:
2442
2443 static constexpr int NormallyOpen = 0;
2444 static constexpr int NormallyClosed = 1;
2445
2447 value{value}
2448 {}
2449
2451 value{-1}
2452 {}
2453
2454 constexpr bool operator==(ForwardLimitTypeValue data) const
2455 {
2456 return this->value == data.value;
2457 }
2458 constexpr bool operator==(int data) const
2459 {
2460 return this->value == data;
2461 }
2462 constexpr bool operator!=(ForwardLimitTypeValue data) const
2463 {
2464 return this->value != data.value;
2465 }
2466 constexpr bool operator!=(int data) const
2467 {
2468 return this->value != data;
2469 }
2470 constexpr bool operator<(ForwardLimitTypeValue data) const
2471 {
2472 return this->value < data.value;
2473 }
2474 constexpr bool operator<(int data) const
2475 {
2476 return this->value < data;
2477 }
2478
2479 /**
2480 * \brief Gets the string representation of this enum
2481 *
2482 * \returns String representation of this enum
2483 */
2484 std::string ToString() const
2485 {
2486 switch (value)
2487 {
2488 case ForwardLimitTypeValue::NormallyOpen: return "NormallyOpen";
2489 case ForwardLimitTypeValue::NormallyClosed: return "NormallyClosed";
2490 default: return "Invalid Value";
2491 }
2492 }
2493
2494 friend std::ostream &operator<<(std::ostream &os, ForwardLimitTypeValue data)
2495 {
2496 os << data.ToString();
2497 return os;
2498 }
2499
2500 std::string Serialize() const
2501 {
2502 std::stringstream ss;
2503 ss << "u_" << this->value;
2504 return ss.str();
2505 }
2506};
2507
2508/**
2509 * \brief Determines where to poll the forward limit switch. This defaults to
2510 * the forward limit switch pin on the limit switch connector.
2511 *
2512 * Choose RemoteTalonFX to use the forward limit switch attached to
2513 * another Talon FX on the same CAN bus (this also requires setting
2514 * ForwardLimitRemoteSensorID).
2515 *
2516 * Choose RemoteCANifier to use the forward limit switch attached to
2517 * another CANifier on the same CAN bus (this also requires setting
2518 * ForwardLimitRemoteSensorID).
2519 *
2520 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2521 * (this also requires setting ForwardLimitRemoteSensorID). The forward
2522 * limit will assert when the CANcoder magnet strength changes from BAD
2523 * (red) to ADEQUATE (orange) or GOOD (green).
2524 */
2526{
2527public:
2529
2530 /**
2531 * \brief Use the forward limit switch pin on the limit switch connector.
2532 */
2533 static constexpr int LimitSwitchPin = 0;
2534 /**
2535 * \brief Use the forward limit switch attached to another Talon FX on the same
2536 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
2537 */
2538 static constexpr int RemoteTalonFX = 1;
2539 /**
2540 * \brief Use the forward limit switch attached to another CANifier on the same
2541 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
2542 */
2543 static constexpr int RemoteCANifier = 2;
2544 /**
2545 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2546 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2547 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2548 * or GOOD (green).
2549 */
2550 static constexpr int RemoteCANcoder = 4;
2551 /**
2552 * \brief Use another CANrange on the same CAN bus (this also requires setting
2553 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2554 * CANrange proximity detect is tripped.
2555 */
2556 static constexpr int RemoteCANrange = 6;
2557 /**
2558 * \brief Disable the forward limit switch.
2559 */
2560 static constexpr int Disabled = 3;
2561
2563 value{value}
2564 {}
2565
2567 value{-1}
2568 {}
2569
2570 constexpr bool operator==(ForwardLimitSourceValue data) const
2571 {
2572 return this->value == data.value;
2573 }
2574 constexpr bool operator==(int data) const
2575 {
2576 return this->value == data;
2577 }
2578 constexpr bool operator!=(ForwardLimitSourceValue data) const
2579 {
2580 return this->value != data.value;
2581 }
2582 constexpr bool operator!=(int data) const
2583 {
2584 return this->value != data;
2585 }
2586 constexpr bool operator<(ForwardLimitSourceValue data) const
2587 {
2588 return this->value < data.value;
2589 }
2590 constexpr bool operator<(int data) const
2591 {
2592 return this->value < data;
2593 }
2594
2595 /**
2596 * \brief Gets the string representation of this enum
2597 *
2598 * \returns String representation of this enum
2599 */
2600 std::string ToString() const
2601 {
2602 switch (value)
2603 {
2604 case ForwardLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2605 case ForwardLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2606 case ForwardLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2607 case ForwardLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2608 case ForwardLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2609 case ForwardLimitSourceValue::Disabled: return "Disabled";
2610 default: return "Invalid Value";
2611 }
2612 }
2613
2614 friend std::ostream &operator<<(std::ostream &os, ForwardLimitSourceValue data)
2615 {
2616 os << data.ToString();
2617 return os;
2618 }
2619
2620 std::string Serialize() const
2621 {
2622 std::stringstream ss;
2623 ss << "u_" << this->value;
2624 return ss.str();
2625 }
2626};
2627
2628/**
2629 * \brief Determines if the reverse limit switch is normally-open (default) or
2630 * normally-closed.
2631 */
2633{
2634public:
2636
2637 static constexpr int NormallyOpen = 0;
2638 static constexpr int NormallyClosed = 1;
2639
2641 value{value}
2642 {}
2643
2645 value{-1}
2646 {}
2647
2648 constexpr bool operator==(ReverseLimitTypeValue data) const
2649 {
2650 return this->value == data.value;
2651 }
2652 constexpr bool operator==(int data) const
2653 {
2654 return this->value == data;
2655 }
2656 constexpr bool operator!=(ReverseLimitTypeValue data) const
2657 {
2658 return this->value != data.value;
2659 }
2660 constexpr bool operator!=(int data) const
2661 {
2662 return this->value != data;
2663 }
2664 constexpr bool operator<(ReverseLimitTypeValue data) const
2665 {
2666 return this->value < data.value;
2667 }
2668 constexpr bool operator<(int data) const
2669 {
2670 return this->value < data;
2671 }
2672
2673 /**
2674 * \brief Gets the string representation of this enum
2675 *
2676 * \returns String representation of this enum
2677 */
2678 std::string ToString() const
2679 {
2680 switch (value)
2681 {
2682 case ReverseLimitTypeValue::NormallyOpen: return "NormallyOpen";
2683 case ReverseLimitTypeValue::NormallyClosed: return "NormallyClosed";
2684 default: return "Invalid Value";
2685 }
2686 }
2687
2688 friend std::ostream &operator<<(std::ostream &os, ReverseLimitTypeValue data)
2689 {
2690 os << data.ToString();
2691 return os;
2692 }
2693
2694 std::string Serialize() const
2695 {
2696 std::stringstream ss;
2697 ss << "u_" << this->value;
2698 return ss.str();
2699 }
2700};
2701
2702/**
2703 * \brief Determines where to poll the reverse limit switch. This defaults to
2704 * the reverse limit switch pin on the limit switch connector.
2705 *
2706 * Choose RemoteTalonFX to use the reverse limit switch attached to
2707 * another Talon FX on the same CAN bus (this also requires setting
2708 * ReverseLimitRemoteSensorID).
2709 *
2710 * Choose RemoteCANifier to use the reverse limit switch attached to
2711 * another CANifier on the same CAN bus (this also requires setting
2712 * ReverseLimitRemoteSensorID).
2713 *
2714 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2715 * (this also requires setting ReverseLimitRemoteSensorID). The reverse
2716 * limit will assert when the CANcoder magnet strength changes from BAD
2717 * (red) to ADEQUATE (orange) or GOOD (green).
2718 */
2720{
2721public:
2723
2724 /**
2725 * \brief Use the reverse limit switch pin on the limit switch connector.
2726 */
2727 static constexpr int LimitSwitchPin = 0;
2728 /**
2729 * \brief Use the reverse limit switch attached to another Talon FX on the same
2730 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2731 */
2732 static constexpr int RemoteTalonFX = 1;
2733 /**
2734 * \brief Use the reverse limit switch attached to another CANifier on the same
2735 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2736 */
2737 static constexpr int RemoteCANifier = 2;
2738 /**
2739 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2740 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2741 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2742 * or GOOD (green).
2743 */
2744 static constexpr int RemoteCANcoder = 4;
2745 /**
2746 * \brief Use another CANrange on the same CAN bus (this also requires setting
2747 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2748 * CANrange proximity detect is tripped.
2749 */
2750 static constexpr int RemoteCANrange = 6;
2751 /**
2752 * \brief Disable the reverse limit switch.
2753 */
2754 static constexpr int Disabled = 3;
2755
2757 value{value}
2758 {}
2759
2761 value{-1}
2762 {}
2763
2764 constexpr bool operator==(ReverseLimitSourceValue data) const
2765 {
2766 return this->value == data.value;
2767 }
2768 constexpr bool operator==(int data) const
2769 {
2770 return this->value == data;
2771 }
2772 constexpr bool operator!=(ReverseLimitSourceValue data) const
2773 {
2774 return this->value != data.value;
2775 }
2776 constexpr bool operator!=(int data) const
2777 {
2778 return this->value != data;
2779 }
2780 constexpr bool operator<(ReverseLimitSourceValue data) const
2781 {
2782 return this->value < data.value;
2783 }
2784 constexpr bool operator<(int data) const
2785 {
2786 return this->value < data;
2787 }
2788
2789 /**
2790 * \brief Gets the string representation of this enum
2791 *
2792 * \returns String representation of this enum
2793 */
2794 std::string ToString() const
2795 {
2796 switch (value)
2797 {
2798 case ReverseLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2799 case ReverseLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2800 case ReverseLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2801 case ReverseLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2802 case ReverseLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2803 case ReverseLimitSourceValue::Disabled: return "Disabled";
2804 default: return "Invalid Value";
2805 }
2806 }
2807
2808 friend std::ostream &operator<<(std::ostream &os, ReverseLimitSourceValue data)
2809 {
2810 os << data.ToString();
2811 return os;
2812 }
2813
2814 std::string Serialize() const
2815 {
2816 std::stringstream ss;
2817 ss << "u_" << this->value;
2818 return ss.str();
2819 }
2820};
2821
2822/**
2823 * \brief Magnet health as measured by CANcoder.
2824 *
2825 * Red indicates too close or too far, Orange is adequate but with
2826 * reduced accuracy, green is ideal. Invalid means the accuracy cannot be
2827 * determined.
2828 */
2830{
2831public:
2833
2834 /**
2835 * \brief The magnet is too close or too far from the CANcoder.
2836 */
2837 static constexpr int Magnet_Red = 1;
2838 /**
2839 * \brief Magnet health is adequate but with reduced accuracy.
2840 */
2841 static constexpr int Magnet_Orange = 2;
2842 /**
2843 * \brief Magnet health is ideal.
2844 */
2845 static constexpr int Magnet_Green = 3;
2846 /**
2847 * \brief The accuracy cannot be determined.
2848 */
2849 static constexpr int Magnet_Invalid = 0;
2850
2851 constexpr MagnetHealthValue(int value) :
2852 value{value}
2853 {}
2854
2855 constexpr MagnetHealthValue() :
2856 value{-1}
2857 {}
2858
2859 constexpr bool operator==(MagnetHealthValue data) const
2860 {
2861 return this->value == data.value;
2862 }
2863 constexpr bool operator==(int data) const
2864 {
2865 return this->value == data;
2866 }
2867 constexpr bool operator!=(MagnetHealthValue data) const
2868 {
2869 return this->value != data.value;
2870 }
2871 constexpr bool operator!=(int data) const
2872 {
2873 return this->value != data;
2874 }
2875 constexpr bool operator<(MagnetHealthValue data) const
2876 {
2877 return this->value < data.value;
2878 }
2879 constexpr bool operator<(int data) const
2880 {
2881 return this->value < data;
2882 }
2883
2884 /**
2885 * \brief Gets the string representation of this enum
2886 *
2887 * \returns String representation of this enum
2888 */
2889 std::string ToString() const
2890 {
2891 switch (value)
2892 {
2893 case MagnetHealthValue::Magnet_Red: return "Magnet_Red";
2894 case MagnetHealthValue::Magnet_Orange: return "Magnet_Orange";
2895 case MagnetHealthValue::Magnet_Green: return "Magnet_Green";
2896 case MagnetHealthValue::Magnet_Invalid: return "Magnet_Invalid";
2897 default: return "Invalid Value";
2898 }
2899 }
2900
2901 friend std::ostream &operator<<(std::ostream &os, MagnetHealthValue data)
2902 {
2903 os << data.ToString();
2904 return os;
2905 }
2906
2907 std::string Serialize() const
2908 {
2909 std::stringstream ss;
2910 ss << "u_" << this->value;
2911 return ss.str();
2912 }
2913};
2914
2915/**
2916 * \brief The applied output of the bridge.
2917 */
2919{
2920public:
2922
2923 static constexpr int BridgeReq_Coast = 0;
2924 static constexpr int BridgeReq_Brake = 1;
2925 static constexpr int BridgeReq_Trapez = 6;
2926 static constexpr int BridgeReq_FOCTorque = 7;
2927 static constexpr int BridgeReq_MusicTone = 8;
2928 static constexpr int BridgeReq_FOCEasy = 9;
2929 static constexpr int BridgeReq_FaultBrake = 12;
2930 static constexpr int BridgeReq_FaultCoast = 13;
2931 static constexpr int BridgeReq_ActiveBrake = 14;
2932
2933 constexpr BridgeOutputValue(int value) :
2934 value{value}
2935 {}
2936
2937 constexpr BridgeOutputValue() :
2938 value{-1}
2939 {}
2940
2941 constexpr bool operator==(BridgeOutputValue data) const
2942 {
2943 return this->value == data.value;
2944 }
2945 constexpr bool operator==(int data) const
2946 {
2947 return this->value == data;
2948 }
2949 constexpr bool operator!=(BridgeOutputValue data) const
2950 {
2951 return this->value != data.value;
2952 }
2953 constexpr bool operator!=(int data) const
2954 {
2955 return this->value != data;
2956 }
2957 constexpr bool operator<(BridgeOutputValue data) const
2958 {
2959 return this->value < data.value;
2960 }
2961 constexpr bool operator<(int data) const
2962 {
2963 return this->value < data;
2964 }
2965
2966 /**
2967 * \brief Gets the string representation of this enum
2968 *
2969 * \returns String representation of this enum
2970 */
2971 std::string ToString() const
2972 {
2973 switch (value)
2974 {
2975 case BridgeOutputValue::BridgeReq_Coast: return "BridgeReq_Coast";
2976 case BridgeOutputValue::BridgeReq_Brake: return "BridgeReq_Brake";
2977 case BridgeOutputValue::BridgeReq_Trapez: return "BridgeReq_Trapez";
2978 case BridgeOutputValue::BridgeReq_FOCTorque: return "BridgeReq_FOCTorque";
2979 case BridgeOutputValue::BridgeReq_MusicTone: return "BridgeReq_MusicTone";
2980 case BridgeOutputValue::BridgeReq_FOCEasy: return "BridgeReq_FOCEasy";
2981 case BridgeOutputValue::BridgeReq_FaultBrake: return "BridgeReq_FaultBrake";
2982 case BridgeOutputValue::BridgeReq_FaultCoast: return "BridgeReq_FaultCoast";
2983 case BridgeOutputValue::BridgeReq_ActiveBrake: return "BridgeReq_ActiveBrake";
2984 default: return "Invalid Value";
2985 }
2986 }
2987
2988 friend std::ostream &operator<<(std::ostream &os, BridgeOutputValue data)
2989 {
2990 os << data.ToString();
2991 return os;
2992 }
2993
2994 std::string Serialize() const
2995 {
2996 std::stringstream ss;
2997 ss << "u_" << this->value;
2998 return ss.str();
2999 }
3000};
3001
3002/**
3003 * \brief Choose what sensor source is used for differential control of a
3004 * mechanism. The default is Disabled. All other options require
3005 * setting the DifferentialTalonFXSensorID, as the average of this Talon
3006 * FX's sensor and the remote TalonFX's sensor is used for the
3007 * differential controller's primary targets.
3008 *
3009 * Choose RemoteTalonFX_Diff to use another TalonFX on the same CAN bus.
3010 * Talon FX will update its differential position and velocity whenever
3011 * the remote TalonFX publishes its information on CAN bus. The
3012 * differential controller will use the difference between this TalonFX's
3013 * sensor and the remote Talon FX's sensor for the differential component
3014 * of the output.
3015 *
3016 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
3017 * to use another Pigeon2 on the same CAN bus (this also requires setting
3018 * DifferentialRemoteSensorID). Talon FX will update its differential
3019 * position to match the selected value whenever Pigeon2 publishes its
3020 * information on CAN bus. Note that the Talon FX differential position
3021 * will be in rotations and not degrees.
3022 *
3023 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
3024 * (this also requires setting DifferentialRemoteSensorID). Talon FX
3025 * will update its differential position and velocity to match the
3026 * CANcoder whenever CANcoder publishes its information on CAN bus.
3027 */
3029{
3030public:
3032
3033 /**
3034 * \brief Disable differential control.
3035 */
3036 static constexpr int Disabled = 0;
3037 /**
3038 * \brief Use another TalonFX on the same CAN bus. Talon FX will update its
3039 * differential position and velocity whenever the remote TalonFX
3040 * publishes its information on CAN bus. The differential controller
3041 * will use the difference between this TalonFX's sensor and the remote
3042 * Talon FX's sensor for the differential component of the output.
3043 */
3044 static constexpr int RemoteTalonFX_Diff = 1;
3045 /**
3046 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3047 * DifferentialRemoteSensorID). Talon FX will update its differential
3048 * position to match the Pigeon2 yaw whenever Pigeon2 publishes its
3049 * information on CAN bus. Note that the Talon FX differential position
3050 * will be in rotations and not degrees.
3051 */
3052 static constexpr int RemotePigeon2_Yaw = 2;
3053 /**
3054 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3055 * DifferentialRemoteSensorID). Talon FX will update its differential
3056 * position to match the Pigeon2 pitch whenever Pigeon2 publishes its
3057 * information on CAN bus. Note that the Talon FX differential position
3058 * will be in rotations and not degrees.
3059 */
3060 static constexpr int RemotePigeon2_Pitch = 3;
3061 /**
3062 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3063 * DifferentialRemoteSensorID). Talon FX will update its differential
3064 * position to match the Pigeon2 roll whenever Pigeon2 publishes its
3065 * information on CAN bus. Note that the Talon FX differential position
3066 * will be in rotations and not degrees.
3067 */
3068 static constexpr int RemotePigeon2_Roll = 4;
3069 /**
3070 * \brief Use another CANcoder on the same CAN bus (this also requires setting
3071 * DifferentialRemoteSensorID). Talon FX will update its differential
3072 * position and velocity to match the CANcoder whenever CANcoder
3073 * publishes its information on CAN bus.
3074 */
3075 static constexpr int RemoteCANcoder = 5;
3076
3078 value{value}
3079 {}
3080
3082 value{-1}
3083 {}
3084
3086 {
3087 return this->value == data.value;
3088 }
3089 constexpr bool operator==(int data) const
3090 {
3091 return this->value == data;
3092 }
3094 {
3095 return this->value != data.value;
3096 }
3097 constexpr bool operator!=(int data) const
3098 {
3099 return this->value != data;
3100 }
3101 constexpr bool operator<(DifferentialSensorSourceValue data) const
3102 {
3103 return this->value < data.value;
3104 }
3105 constexpr bool operator<(int data) const
3106 {
3107 return this->value < data;
3108 }
3109
3110 /**
3111 * \brief Gets the string representation of this enum
3112 *
3113 * \returns String representation of this enum
3114 */
3115 std::string ToString() const
3116 {
3117 switch (value)
3118 {
3119 case DifferentialSensorSourceValue::Disabled: return "Disabled";
3120 case DifferentialSensorSourceValue::RemoteTalonFX_Diff: return "RemoteTalonFX_Diff";
3121 case DifferentialSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
3122 case DifferentialSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
3123 case DifferentialSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
3124 case DifferentialSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3125 default: return "Invalid Value";
3126 }
3127 }
3128
3129 friend std::ostream &operator<<(std::ostream &os, DifferentialSensorSourceValue data)
3130 {
3131 os << data.ToString();
3132 return os;
3133 }
3134
3135 std::string Serialize() const
3136 {
3137 std::stringstream ss;
3138 ss << "u_" << this->value;
3139 return ss.str();
3140 }
3141};
3142
3143/**
3144 * \brief Static Feedforward Sign during position closed loop.
3145 *
3146 * This determines the sign of the applied kS during position closed-loop
3147 * modes. The default behavior uses the velocity reference sign. This
3148 * works well with velocity closed loop, Motion Magic® controls, and
3149 * position closed loop when velocity reference is specified (motion
3150 * profiling).
3151 *
3152 * However, when using position closed loop with zero velocity reference
3153 * (no motion profiling), the application may want to apply static
3154 * feedforward based on the sign of closed loop error instead. When doing
3155 * so, we recommend using the minimal amount of kS, otherwise the motor
3156 * output may dither when closed loop error is near zero.
3157 */
3159{
3160public:
3162
3163 /**
3164 * \brief Use the velocity reference sign. This works well with velocity closed
3165 * loop, Motion Magic® controls, and position closed loop when velocity
3166 * reference is specified (motion profiling).
3167 */
3168 static constexpr int UseVelocitySign = 0;
3169 /**
3170 * \brief Use the sign of closed loop error. This is useful when using position
3171 * closed loop with zero velocity reference (no motion profiling). We
3172 * recommend the minimal amount of kS, otherwise the motor output may
3173 * dither when closed loop error is near zero.
3174 */
3175 static constexpr int UseClosedLoopSign = 1;
3176
3178 value{value}
3179 {}
3180
3182 value{-1}
3183 {}
3184
3185 constexpr bool operator==(StaticFeedforwardSignValue data) const
3186 {
3187 return this->value == data.value;
3188 }
3189 constexpr bool operator==(int data) const
3190 {
3191 return this->value == data;
3192 }
3193 constexpr bool operator!=(StaticFeedforwardSignValue data) const
3194 {
3195 return this->value != data.value;
3196 }
3197 constexpr bool operator!=(int data) const
3198 {
3199 return this->value != data;
3200 }
3201 constexpr bool operator<(StaticFeedforwardSignValue data) const
3202 {
3203 return this->value < data.value;
3204 }
3205 constexpr bool operator<(int data) const
3206 {
3207 return this->value < data;
3208 }
3209
3210 /**
3211 * \brief Gets the string representation of this enum
3212 *
3213 * \returns String representation of this enum
3214 */
3215 std::string ToString() const
3216 {
3217 switch (value)
3218 {
3219 case StaticFeedforwardSignValue::UseVelocitySign: return "UseVelocitySign";
3220 case StaticFeedforwardSignValue::UseClosedLoopSign: return "UseClosedLoopSign";
3221 default: return "Invalid Value";
3222 }
3223 }
3224
3225 friend std::ostream &operator<<(std::ostream &os, StaticFeedforwardSignValue data)
3226 {
3227 os << data.ToString();
3228 return os;
3229 }
3230
3231 std::string Serialize() const
3232 {
3233 std::stringstream ss;
3234 ss << "u_" << this->value;
3235 return ss.str();
3236 }
3237};
3238
3239/**
3240 * \brief The type of motor attached to the Talon.
3241 *
3242 * \details This can be used to determine what motor is attached to the Talon
3243 * FX. Return will be "Unknown" if firmware is too old or device is
3244 * not present.
3245 */
3247{
3248public:
3250
3251 /**
3252 * \brief Talon could not determine the type of motor attached.
3253 */
3254 static constexpr int Unknown = 0;
3255 /**
3256 * \brief Talon is attached to an integrated Falcon motor.
3257 */
3258 static constexpr int Falcon500_Integrated = 1;
3259 /**
3260 * \brief Talon is attached to an integrated Kraken X60 motor.
3261 */
3262 static constexpr int KrakenX60_Integrated = 2;
3263 /**
3264 * \brief Talon is attached to an integrated Kraken X44 motor.
3265 */
3266 static constexpr int KrakenX44_Integrated = 3;
3267 /**
3268 * \brief Talon is connected to a CTR Electronics Minion® brushless three phase
3269 * motor.
3270 */
3271 static constexpr int Minion_JST = 4;
3272 /**
3273 * \brief Talon is connected to a third party brushed DC motor with leads A and
3274 * B.
3275 */
3276 static constexpr int Brushed_AB = 5;
3277 /**
3278 * \brief Talon is connected to a third party brushed DC motor with leads A and
3279 * C.
3280 */
3281 static constexpr int Brushed_AC = 6;
3282 /**
3283 * \brief Talon is connected to a third party brushed DC motor with leads B and
3284 * C.
3285 */
3286 static constexpr int Brushed_BC = 7;
3287 /**
3288 * \brief Talon is connected to a third party NEO brushless three phase motor.
3289 */
3290 static constexpr int NEO_JST = 8;
3291 /**
3292 * \brief Talon is connected to a third party NEO550 brushless three phase
3293 * motor.
3294 */
3295 static constexpr int NEO550_JST = 9;
3296 /**
3297 * \brief Talon is connected to a third party VORTEX brushless three phase
3298 * motor.
3299 */
3300 static constexpr int VORTEX_JST = 10;
3301
3303 value{value}
3304 {}
3305
3307 value{-1}
3308 {}
3309
3310 constexpr bool operator==(ConnectedMotorValue data) const
3311 {
3312 return this->value == data.value;
3313 }
3314 constexpr bool operator==(int data) const
3315 {
3316 return this->value == data;
3317 }
3318 constexpr bool operator!=(ConnectedMotorValue data) const
3319 {
3320 return this->value != data.value;
3321 }
3322 constexpr bool operator!=(int data) const
3323 {
3324 return this->value != data;
3325 }
3326 constexpr bool operator<(ConnectedMotorValue data) const
3327 {
3328 return this->value < data.value;
3329 }
3330 constexpr bool operator<(int data) const
3331 {
3332 return this->value < data;
3333 }
3334
3335 /**
3336 * \brief Gets the string representation of this enum
3337 *
3338 * \returns String representation of this enum
3339 */
3340 std::string ToString() const
3341 {
3342 switch (value)
3343 {
3344 case ConnectedMotorValue::Unknown: return "Unknown";
3345 case ConnectedMotorValue::Falcon500_Integrated: return "Falcon500_Integrated";
3346 case ConnectedMotorValue::KrakenX60_Integrated: return "KrakenX60_Integrated";
3347 case ConnectedMotorValue::KrakenX44_Integrated: return "KrakenX44_Integrated";
3348 case ConnectedMotorValue::Minion_JST: return "Minion_JST";
3349 case ConnectedMotorValue::Brushed_AB: return "Brushed_AB";
3350 case ConnectedMotorValue::Brushed_AC: return "Brushed_AC";
3351 case ConnectedMotorValue::Brushed_BC: return "Brushed_BC";
3352 case ConnectedMotorValue::NEO_JST: return "NEO_JST";
3353 case ConnectedMotorValue::NEO550_JST: return "NEO550_JST";
3354 case ConnectedMotorValue::VORTEX_JST: return "VORTEX_JST";
3355 default: return "Invalid Value";
3356 }
3357 }
3358
3359 friend std::ostream &operator<<(std::ostream &os, ConnectedMotorValue data)
3360 {
3361 os << data.ToString();
3362 return os;
3363 }
3364
3365 std::string Serialize() const
3366 {
3367 std::stringstream ss;
3368 ss << "u_" << this->value;
3369 return ss.str();
3370 }
3371};
3372
3373/**
3374 * \brief Health of the distance measurement.
3375 */
3377{
3378public:
3380
3381 /**
3382 * \brief Measurement is good.
3383 */
3384 static constexpr int Good = 0;
3385 /**
3386 * \brief Measurement is likely okay, but the target is either very far away or
3387 * moving very quickly.
3388 */
3389 static constexpr int Limited = 1;
3390 /**
3391 * \brief Measurement is compromised.
3392 */
3393 static constexpr int Bad = 2;
3394
3396 value{value}
3397 {}
3398
3400 value{-1}
3401 {}
3402
3403 constexpr bool operator==(MeasurementHealthValue data) const
3404 {
3405 return this->value == data.value;
3406 }
3407 constexpr bool operator==(int data) const
3408 {
3409 return this->value == data;
3410 }
3411 constexpr bool operator!=(MeasurementHealthValue data) const
3412 {
3413 return this->value != data.value;
3414 }
3415 constexpr bool operator!=(int data) const
3416 {
3417 return this->value != data;
3418 }
3419 constexpr bool operator<(MeasurementHealthValue data) const
3420 {
3421 return this->value < data.value;
3422 }
3423 constexpr bool operator<(int data) const
3424 {
3425 return this->value < data;
3426 }
3427
3428 /**
3429 * \brief Gets the string representation of this enum
3430 *
3431 * \returns String representation of this enum
3432 */
3433 std::string ToString() const
3434 {
3435 switch (value)
3436 {
3437 case MeasurementHealthValue::Good: return "Good";
3438 case MeasurementHealthValue::Limited: return "Limited";
3439 case MeasurementHealthValue::Bad: return "Bad";
3440 default: return "Invalid Value";
3441 }
3442 }
3443
3444 friend std::ostream &operator<<(std::ostream &os, MeasurementHealthValue data)
3445 {
3446 os << data.ToString();
3447 return os;
3448 }
3449
3450 std::string Serialize() const
3451 {
3452 std::stringstream ss;
3453 ss << "u_" << this->value;
3454 return ss.str();
3455 }
3456};
3457
3458/**
3459 * \brief Update mode of the CANrange. The CANrange supports short-range and
3460 * long-range detection at various update frequencies.
3461 */
3463{
3464public:
3466
3467 /**
3468 * \brief Updates distance/proximity at 100hz using short-range detection mode.
3469 */
3470 static constexpr int ShortRange100Hz = 0;
3471 /**
3472 * \brief Uses short-range detection mode for improved detection under high
3473 * ambient infrared light conditions. Uses user-specified update
3474 * frequency.
3475 */
3476 static constexpr int ShortRangeUserFreq = 1;
3477 /**
3478 * \brief Uses long-range detection mode and user-specified update frequency.
3479 */
3480 static constexpr int LongRangeUserFreq = 2;
3481
3482 constexpr UpdateModeValue(int value) :
3483 value{value}
3484 {}
3485
3486 constexpr UpdateModeValue() :
3487 value{-1}
3488 {}
3489
3490 constexpr bool operator==(UpdateModeValue data) const
3491 {
3492 return this->value == data.value;
3493 }
3494 constexpr bool operator==(int data) const
3495 {
3496 return this->value == data;
3497 }
3498 constexpr bool operator!=(UpdateModeValue data) const
3499 {
3500 return this->value != data.value;
3501 }
3502 constexpr bool operator!=(int data) const
3503 {
3504 return this->value != data;
3505 }
3506 constexpr bool operator<(UpdateModeValue data) const
3507 {
3508 return this->value < data.value;
3509 }
3510 constexpr bool operator<(int data) const
3511 {
3512 return this->value < data;
3513 }
3514
3515 /**
3516 * \brief Gets the string representation of this enum
3517 *
3518 * \returns String representation of this enum
3519 */
3520 std::string ToString() const
3521 {
3522 switch (value)
3523 {
3524 case UpdateModeValue::ShortRange100Hz: return "ShortRange100Hz";
3525 case UpdateModeValue::ShortRangeUserFreq: return "ShortRangeUserFreq";
3526 case UpdateModeValue::LongRangeUserFreq: return "LongRangeUserFreq";
3527 default: return "Invalid Value";
3528 }
3529 }
3530
3531 friend std::ostream &operator<<(std::ostream &os, UpdateModeValue data)
3532 {
3533 os << data.ToString();
3534 return os;
3535 }
3536
3537 std::string Serialize() const
3538 {
3539 std::stringstream ss;
3540 ss << "u_" << this->value;
3541 return ss.str();
3542 }
3543};
3544
3545
3546}
3547}
3548}
Definition Serializable.hpp:15
The applied rotor polarity as seen from the front of the motor.
Definition SpnEnums.hpp:1056
constexpr AppliedRotorPolarityValue(int value)
Definition SpnEnums.hpp:1069
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1081
std::string Serialize() const
Definition SpnEnums.hpp:1123
constexpr bool operator!=(AppliedRotorPolarityValue data) const
Definition SpnEnums.hpp:1085
friend std::ostream & operator<<(std::ostream &os, AppliedRotorPolarityValue data)
Definition SpnEnums.hpp:1117
constexpr bool operator==(AppliedRotorPolarityValue data) const
Definition SpnEnums.hpp:1077
constexpr AppliedRotorPolarityValue()
Definition SpnEnums.hpp:1073
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1107
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1097
static constexpr int PositiveIsClockwise
Positive motor output results in clockwise motion.
Definition SpnEnums.hpp:1067
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1089
static constexpr int PositiveIsCounterClockwise
Positive motor output results in counter-clockwise motion.
Definition SpnEnums.hpp:1063
constexpr bool operator<(AppliedRotorPolarityValue data) const
Definition SpnEnums.hpp:1093
The applied output of the bridge.
Definition SpnEnums.hpp:2919
constexpr bool operator<(BridgeOutputValue data) const
Definition SpnEnums.hpp:2957
constexpr bool operator==(BridgeOutputValue data) const
Definition SpnEnums.hpp:2941
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2961
constexpr bool operator!=(BridgeOutputValue data) const
Definition SpnEnums.hpp:2949
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2945
friend std::ostream & operator<<(std::ostream &os, BridgeOutputValue data)
Definition SpnEnums.hpp:2988
static constexpr int BridgeReq_FaultCoast
Definition SpnEnums.hpp:2930
static constexpr int BridgeReq_FOCEasy
Definition SpnEnums.hpp:2928
std::string Serialize() const
Definition SpnEnums.hpp:2994
static constexpr int BridgeReq_Trapez
Definition SpnEnums.hpp:2925
static constexpr int BridgeReq_ActiveBrake
Definition SpnEnums.hpp:2931
constexpr BridgeOutputValue(int value)
Definition SpnEnums.hpp:2933
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2971
static constexpr int BridgeReq_MusicTone
Definition SpnEnums.hpp:2927
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2953
static constexpr int BridgeReq_Brake
Definition SpnEnums.hpp:2924
static constexpr int BridgeReq_FOCTorque
Definition SpnEnums.hpp:2926
constexpr BridgeOutputValue()
Definition SpnEnums.hpp:2937
int value
Definition SpnEnums.hpp:2921
static constexpr int BridgeReq_FaultBrake
Definition SpnEnums.hpp:2929
static constexpr int BridgeReq_Coast
Definition SpnEnums.hpp:2923
The type of motor attached to the Talon.
Definition SpnEnums.hpp:3247
int value
Definition SpnEnums.hpp:3249
static constexpr int Falcon500_Integrated
Talon is attached to an integrated Falcon motor.
Definition SpnEnums.hpp:3258
static constexpr int NEO550_JST
Talon is connected to a third party NEO550 brushless three phase motor.
Definition SpnEnums.hpp:3295
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3330
static constexpr int KrakenX44_Integrated
Talon is attached to an integrated Kraken X44 motor.
Definition SpnEnums.hpp:3266
std::string Serialize() const
Definition SpnEnums.hpp:3365
static constexpr int Brushed_AC
Talon is connected to a third party brushed DC motor with leads A and C.
Definition SpnEnums.hpp:3281
constexpr bool operator!=(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3318
static constexpr int NEO_JST
Talon is connected to a third party NEO brushless three phase motor.
Definition SpnEnums.hpp:3290
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3322
static constexpr int Brushed_AB
Talon is connected to a third party brushed DC motor with leads A and B.
Definition SpnEnums.hpp:3276
static constexpr int Brushed_BC
Talon is connected to a third party brushed DC motor with leads B and C.
Definition SpnEnums.hpp:3286
constexpr ConnectedMotorValue(int value)
Definition SpnEnums.hpp:3302
static constexpr int Minion_JST
Talon is connected to a CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:3271
constexpr bool operator<(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3326
constexpr bool operator==(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3310
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3340
static constexpr int KrakenX60_Integrated
Talon is attached to an integrated Kraken X60 motor.
Definition SpnEnums.hpp:3262
friend std::ostream & operator<<(std::ostream &os, ConnectedMotorValue data)
Definition SpnEnums.hpp:3359
constexpr ConnectedMotorValue()
Definition SpnEnums.hpp:3306
static constexpr int VORTEX_JST
Talon is connected to a third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:3300
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3314
static constexpr int Unknown
Talon could not determine the type of motor attached.
Definition SpnEnums.hpp:3254
The active control mode of the motor controller.
Definition SpnEnums.hpp:1135
static constexpr int MotionMagicVoltage
Definition SpnEnums.hpp:1153
static constexpr int PositionDutyCycle
Definition SpnEnums.hpp:1143
static constexpr int Follower
Definition SpnEnums.hpp:1162
static constexpr int MotionMagicExpoDutyCycleFOC
Definition SpnEnums.hpp:1173
static constexpr int VelocityVoltage
Definition SpnEnums.hpp:1152
static constexpr int VoltageFOC
Definition SpnEnums.hpp:1154
static constexpr int MotionMagicDutyCycleFOC
Definition SpnEnums.hpp:1149
static constexpr int DutyCycleFOC
Definition SpnEnums.hpp:1146
static constexpr int MusicTone
Definition SpnEnums.hpp:1166
static constexpr int VelocityDutyCycleFOC
Definition SpnEnums.hpp:1148
int value
Definition SpnEnums.hpp:1137
static constexpr int MotionMagicExpoDutyCycle
Definition SpnEnums.hpp:1172
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1216
static constexpr int MotionMagicVoltageFOC
Definition SpnEnums.hpp:1157
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1190
static constexpr int CoastOut
Definition SpnEnums.hpp:1164
static constexpr int DisabledOutput
Definition SpnEnums.hpp:1139
constexpr bool operator==(ControlModeValue data) const
Definition SpnEnums.hpp:1186
static constexpr int NeutralOut
Definition SpnEnums.hpp:1140
static constexpr int MotionMagicVelocityVoltageFOC
Definition SpnEnums.hpp:1170
static constexpr int MotionMagicExpoVoltage
Definition SpnEnums.hpp:1174
static constexpr int VoltageOut
Definition SpnEnums.hpp:1150
static constexpr int MotionMagicExpoTorqueCurrentFOC
Definition SpnEnums.hpp:1176
static constexpr int VelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1160
static constexpr int MotionMagicExpoVoltageFOC
Definition SpnEnums.hpp:1175
constexpr ControlModeValue()
Definition SpnEnums.hpp:1182
std::string Serialize() const
Definition SpnEnums.hpp:1268
constexpr bool operator<(ControlModeValue data) const
Definition SpnEnums.hpp:1202
static constexpr int MotionMagicVelocityVoltage
Definition SpnEnums.hpp:1169
static constexpr int MotionMagicVelocityDutyCycle
Definition SpnEnums.hpp:1167
constexpr bool operator!=(ControlModeValue data) const
Definition SpnEnums.hpp:1194
friend std::ostream & operator<<(std::ostream &os, ControlModeValue data)
Definition SpnEnums.hpp:1262
static constexpr int PositionVoltage
Definition SpnEnums.hpp:1151
static constexpr int PositionTorqueCurrentFOC
Definition SpnEnums.hpp:1159
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1198
static constexpr int VelocityVoltageFOC
Definition SpnEnums.hpp:1156
static constexpr int Reserved
Definition SpnEnums.hpp:1163
static constexpr int MotionMagicTorqueCurrentFOC
Definition SpnEnums.hpp:1161
static constexpr int PositionVoltageFOC
Definition SpnEnums.hpp:1155
static constexpr int MotionMagicDutyCycle
Definition SpnEnums.hpp:1145
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1206
static constexpr int PositionDutyCycleFOC
Definition SpnEnums.hpp:1147
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1158
static constexpr int UnauthorizedDevice
Definition SpnEnums.hpp:1165
static constexpr int StaticBrake
Definition SpnEnums.hpp:1141
static constexpr int MotionMagicVelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1171
static constexpr int VelocityDutyCycle
Definition SpnEnums.hpp:1144
static constexpr int DutyCycleOut
Definition SpnEnums.hpp:1142
constexpr ControlModeValue(int value)
Definition SpnEnums.hpp:1178
static constexpr int MotionMagicVelocityDutyCycleFOC
Definition SpnEnums.hpp:1168
Whether the device is enabled.
Definition SpnEnums.hpp:835
std::string Serialize() const
Definition SpnEnums.hpp:896
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:880
constexpr bool operator==(DeviceEnableValue data) const
Definition SpnEnums.hpp:850
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:862
int value
Definition SpnEnums.hpp:837
static constexpr int Enabled
Definition SpnEnums.hpp:839
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:870
constexpr DeviceEnableValue()
Definition SpnEnums.hpp:846
friend std::ostream & operator<<(std::ostream &os, DeviceEnableValue data)
Definition SpnEnums.hpp:890
constexpr bool operator!=(DeviceEnableValue data) const
Definition SpnEnums.hpp:858
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:854
constexpr bool operator<(DeviceEnableValue data) const
Definition SpnEnums.hpp:866
constexpr DeviceEnableValue(int value)
Definition SpnEnums.hpp:842
static constexpr int Disabled
Definition SpnEnums.hpp:840
The output mode of the differential PID controller.
Definition SpnEnums.hpp:1875
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1911
constexpr DiffPIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1887
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1881
constexpr bool operator!=(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1899
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1921
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1903
constexpr bool operator==(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1891
std::string Serialize() const
Definition SpnEnums.hpp:1938
friend std::ostream & operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data)
Definition SpnEnums.hpp:1932
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1895
constexpr DiffPIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1883
static constexpr int Voltage
Definition SpnEnums.hpp:1880
static constexpr int DutyCycle
Definition SpnEnums.hpp:1879
constexpr bool operator<(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1907
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1802
std::string Serialize() const
Definition SpnEnums.hpp:1863
constexpr bool operator<(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1833
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1821
friend std::ostream & operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1857
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:1813
static constexpr int Velocity
Definition SpnEnums.hpp:1807
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1837
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1809
constexpr bool operator!=(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1825
static constexpr int Position
Definition SpnEnums.hpp:1806
constexpr bool operator==(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1817
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1847
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1829
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1950
constexpr bool operator!=(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1973
static constexpr int Position
Definition SpnEnums.hpp:1954
std::string Serialize() const
Definition SpnEnums.hpp:2011
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:1961
friend std::ostream & operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data)
Definition SpnEnums.hpp:2005
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1957
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1969
constexpr bool operator<(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1981
static constexpr int Velocity
Definition SpnEnums.hpp:1955
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1995
constexpr bool operator==(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1965
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1985
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1977
The active control mode of the differential controller.
Definition SpnEnums.hpp:1681
static constexpr int MotionMagicVoltage
Definition SpnEnums.hpp:1699
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1724
static constexpr int NeutralOut
Definition SpnEnums.hpp:1686
static constexpr int PositionDutyCycle
Definition SpnEnums.hpp:1689
constexpr bool operator!=(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1728
static constexpr int VelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1706
static constexpr int Reserved
Definition SpnEnums.hpp:1709
static constexpr int PositionVoltageFOC
Definition SpnEnums.hpp:1701
static constexpr int MotionMagicTorqueCurrentFOC
Definition SpnEnums.hpp:1707
static constexpr int VelocityDutyCycleFOC
Definition SpnEnums.hpp:1694
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1704
static constexpr int VoltageOut
Definition SpnEnums.hpp:1696
static constexpr int VelocityVoltageFOC
Definition SpnEnums.hpp:1702
static constexpr int MotionMagicDutyCycleFOC
Definition SpnEnums.hpp:1695
static constexpr int MotionMagicVoltageFOC
Definition SpnEnums.hpp:1703
static constexpr int Follower
Definition SpnEnums.hpp:1708
static constexpr int DisabledOutput
Definition SpnEnums.hpp:1685
static constexpr int VoltageFOC
Definition SpnEnums.hpp:1700
constexpr DifferentialControlModeValue()
Definition SpnEnums.hpp:1716
static constexpr int DutyCycleOut
Definition SpnEnums.hpp:1688
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1732
std::string Serialize() const
Definition SpnEnums.hpp:1790
static constexpr int PositionVoltage
Definition SpnEnums.hpp:1697
static constexpr int StaticBrake
Definition SpnEnums.hpp:1687
friend std::ostream & operator<<(std::ostream &os, DifferentialControlModeValue data)
Definition SpnEnums.hpp:1784
static constexpr int PositionTorqueCurrentFOC
Definition SpnEnums.hpp:1705
static constexpr int MotionMagicDutyCycle
Definition SpnEnums.hpp:1691
constexpr bool operator<(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1736
static constexpr int VelocityDutyCycle
Definition SpnEnums.hpp:1690
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1750
static constexpr int PositionDutyCycleFOC
Definition SpnEnums.hpp:1693
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1740
static constexpr int CoastOut
Definition SpnEnums.hpp:1710
constexpr bool operator==(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1720
static constexpr int DutyCycleFOC
Definition SpnEnums.hpp:1692
constexpr DifferentialControlModeValue(int value)
Definition SpnEnums.hpp:1712
static constexpr int VelocityVoltage
Definition SpnEnums.hpp:1698
Choose what sensor source is used for differential control of a mechanism.
Definition SpnEnums.hpp:3029
static constexpr int Disabled
Disable differential control.
Definition SpnEnums.hpp:3036
static constexpr int RemoteTalonFX_Diff
Use another TalonFX on the same CAN bus.
Definition SpnEnums.hpp:3044
constexpr bool operator<(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3101
constexpr bool operator==(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3085
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3075
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3089
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3105
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3060
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3068
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3052
constexpr bool operator!=(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3093
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3097
std::string Serialize() const
Definition SpnEnums.hpp:3135
friend std::ostream & operator<<(std::ostream &os, DifferentialSensorSourceValue data)
Definition SpnEnums.hpp:3129
constexpr DifferentialSensorSourceValue()
Definition SpnEnums.hpp:3081
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3115
constexpr DifferentialSensorSourceValue(int value)
Definition SpnEnums.hpp:3077
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:2310
constexpr FeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:2367
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2324
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2395
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2338
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2331
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2387
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2345
constexpr FeedbackSensorSourceValue()
Definition SpnEnums.hpp:2371
constexpr bool operator==(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2375
constexpr bool operator<(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2391
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2379
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its internal rotor position against another CANcoder,...
Definition SpnEnums.hpp:2365
static constexpr int RotorSensor
Use the internal rotor sensor in the Talon.
Definition SpnEnums.hpp:2317
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2405
std::string Serialize() const
Definition SpnEnums.hpp:2426
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the internal rotor,...
Definition SpnEnums.hpp:2353
constexpr bool operator!=(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2383
friend std::ostream & operator<<(std::ostream &os, FeedbackSensorSourceValue data)
Definition SpnEnums.hpp:2420
Determines where to poll the forward limit switch.
Definition SpnEnums.hpp:2526
constexpr bool operator!=(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2578
static constexpr int LimitSwitchPin
Use the forward limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2533
std::string Serialize() const
Definition SpnEnums.hpp:2620
static constexpr int RemoteTalonFX
Use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2538
constexpr bool operator==(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2570
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2582
constexpr ForwardLimitSourceValue(int value)
Definition SpnEnums.hpp:2562
constexpr ForwardLimitSourceValue()
Definition SpnEnums.hpp:2566
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2600
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2590
constexpr bool operator<(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2586
friend std::ostream & operator<<(std::ostream &os, ForwardLimitSourceValue data)
Definition SpnEnums.hpp:2614
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2574
static constexpr int RemoteCANifier
Use the forward limit switch attached to another CANifier on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2543
int value
Definition SpnEnums.hpp:2528
static constexpr int Disabled
Disable the forward limit switch.
Definition SpnEnums.hpp:2560
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2556
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2550
Determines if the forward limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2439
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2444
constexpr bool operator<(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2470
constexpr bool operator==(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2454
constexpr ForwardLimitTypeValue()
Definition SpnEnums.hpp:2450
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2466
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2458
constexpr ForwardLimitTypeValue(int value)
Definition SpnEnums.hpp:2446
constexpr bool operator!=(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2462
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2484
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2443
std::string Serialize() const
Definition SpnEnums.hpp:2500
friend std::ostream & operator<<(std::ostream &os, ForwardLimitTypeValue data)
Definition SpnEnums.hpp:2494
int value
Definition SpnEnums.hpp:2441
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2474
Forward Limit Pin.
Definition SpnEnums.hpp:908
constexpr ForwardLimitValue(int value)
Definition SpnEnums.hpp:915
constexpr bool operator<(ForwardLimitValue data) const
Definition SpnEnums.hpp:939
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:943
static constexpr int ClosedToGround
Definition SpnEnums.hpp:912
constexpr ForwardLimitValue()
Definition SpnEnums.hpp:919
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:935
std::string Serialize() const
Definition SpnEnums.hpp:969
friend std::ostream & operator<<(std::ostream &os, ForwardLimitValue data)
Definition SpnEnums.hpp:963
int value
Definition SpnEnums.hpp:910
constexpr bool operator!=(ForwardLimitValue data) const
Definition SpnEnums.hpp:931
constexpr bool operator==(ForwardLimitValue data) const
Definition SpnEnums.hpp:923
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:953
static constexpr int Open
Definition SpnEnums.hpp:913
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:927
Whether device is locked by FRC.
Definition SpnEnums.hpp:349
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:376
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:394
static constexpr int Frc_Locked
Definition SpnEnums.hpp:353
constexpr FrcLockValue(int value)
Definition SpnEnums.hpp:356
static constexpr int Frc_Unlocked
Definition SpnEnums.hpp:354
int value
Definition SpnEnums.hpp:351
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:384
constexpr FrcLockValue()
Definition SpnEnums.hpp:360
friend std::ostream & operator<<(std::ostream &os, FrcLockValue data)
Definition SpnEnums.hpp:404
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:368
constexpr bool operator==(FrcLockValue data) const
Definition SpnEnums.hpp:364
constexpr bool operator<(FrcLockValue data) const
Definition SpnEnums.hpp:380
std::string Serialize() const
Definition SpnEnums.hpp:410
constexpr bool operator!=(FrcLockValue data) const
Definition SpnEnums.hpp:372
Gravity Feedforward/Feedback Type.
Definition SpnEnums.hpp:2037
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2084
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2094
constexpr GravityTypeValue()
Definition SpnEnums.hpp:2060
constexpr GravityTypeValue(int value)
Definition SpnEnums.hpp:2056
static constexpr int Elevator_Static
The system's gravity feedforward is constant, such as an elevator.
Definition SpnEnums.hpp:2045
int value
Definition SpnEnums.hpp:2039
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2076
std::string Serialize() const
Definition SpnEnums.hpp:2110
constexpr bool operator!=(GravityTypeValue data) const
Definition SpnEnums.hpp:2072
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2068
friend std::ostream & operator<<(std::ostream &os, GravityTypeValue data)
Definition SpnEnums.hpp:2104
constexpr bool operator==(GravityTypeValue data) const
Definition SpnEnums.hpp:2064
constexpr bool operator<(GravityTypeValue data) const
Definition SpnEnums.hpp:2080
static constexpr int Arm_Cosine
The system's gravity feedback is dependent on the angular position of the mechanism,...
Definition SpnEnums.hpp:2054
Invert state of the device as seen from the front of the motor.
Definition SpnEnums.hpp:2122
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2163
static constexpr int CounterClockwise_Positive
Positive motor output results in clockwise motion.
Definition SpnEnums.hpp:2129
constexpr bool operator!=(InvertedValue data) const
Definition SpnEnums.hpp:2151
constexpr InvertedValue(int value)
Definition SpnEnums.hpp:2135
int value
Definition SpnEnums.hpp:2124
static constexpr int Clockwise_Positive
Positive motor output results in counter-clockwise motion.
Definition SpnEnums.hpp:2133
std::string Serialize() const
Definition SpnEnums.hpp:2189
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2173
friend std::ostream & operator<<(std::ostream &os, InvertedValue data)
Definition SpnEnums.hpp:2183
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2147
constexpr InvertedValue()
Definition SpnEnums.hpp:2139
constexpr bool operator<(InvertedValue data) const
Definition SpnEnums.hpp:2159
constexpr bool operator==(InvertedValue data) const
Definition SpnEnums.hpp:2143
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2155
Whether the device is Pro licensed.
Definition SpnEnums.hpp:123
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:142
static constexpr int NotLicensed
Definition SpnEnums.hpp:127
int value
Definition SpnEnums.hpp:125
constexpr bool operator!=(IsPROLicensedValue data) const
Definition SpnEnums.hpp:146
constexpr bool operator==(IsPROLicensedValue data) const
Definition SpnEnums.hpp:138
static constexpr int Licensed
Definition SpnEnums.hpp:128
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:150
constexpr IsPROLicensedValue(int value)
Definition SpnEnums.hpp:130
constexpr bool operator<(IsPROLicensedValue data) const
Definition SpnEnums.hpp:154
constexpr IsPROLicensedValue()
Definition SpnEnums.hpp:134
friend std::ostream & operator<<(std::ostream &os, IsPROLicensedValue data)
Definition SpnEnums.hpp:178
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:158
std::string Serialize() const
Definition SpnEnums.hpp:184
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:168
The Color of LED1 when it's "Off".
Definition SpnEnums.hpp:580
constexpr bool operator<(Led1OffColorValue data) const
Definition SpnEnums.hpp:617
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:631
constexpr Led1OffColorValue()
Definition SpnEnums.hpp:597
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:605
static constexpr int Orange
Definition SpnEnums.hpp:587
static constexpr int Red
Definition SpnEnums.hpp:585
static constexpr int White
Definition SpnEnums.hpp:591
static constexpr int Off
Definition SpnEnums.hpp:584
constexpr bool operator!=(Led1OffColorValue data) const
Definition SpnEnums.hpp:609
static constexpr int Blue
Definition SpnEnums.hpp:588
static constexpr int Cyan
Definition SpnEnums.hpp:590
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:613
int value
Definition SpnEnums.hpp:582
std::string Serialize() const
Definition SpnEnums.hpp:653
constexpr bool operator==(Led1OffColorValue data) const
Definition SpnEnums.hpp:601
static constexpr int Pink
Definition SpnEnums.hpp:589
constexpr Led1OffColorValue(int value)
Definition SpnEnums.hpp:593
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:621
friend std::ostream & operator<<(std::ostream &os, Led1OffColorValue data)
Definition SpnEnums.hpp:647
static constexpr int Green
Definition SpnEnums.hpp:586
The Color of LED1 when it's "On".
Definition SpnEnums.hpp:495
static constexpr int Cyan
Definition SpnEnums.hpp:505
constexpr Led1OnColorValue()
Definition SpnEnums.hpp:512
constexpr bool operator==(Led1OnColorValue data) const
Definition SpnEnums.hpp:516
static constexpr int Pink
Definition SpnEnums.hpp:504
constexpr Led1OnColorValue(int value)
Definition SpnEnums.hpp:508
static constexpr int Blue
Definition SpnEnums.hpp:503
static constexpr int White
Definition SpnEnums.hpp:506
static constexpr int Green
Definition SpnEnums.hpp:501
static constexpr int Red
Definition SpnEnums.hpp:500
static constexpr int Off
Definition SpnEnums.hpp:499
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:536
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:528
static constexpr int Orange
Definition SpnEnums.hpp:502
constexpr bool operator!=(Led1OnColorValue data) const
Definition SpnEnums.hpp:524
constexpr bool operator<(Led1OnColorValue data) const
Definition SpnEnums.hpp:532
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:546
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:520
int value
Definition SpnEnums.hpp:497
std::string Serialize() const
Definition SpnEnums.hpp:568
friend std::ostream & operator<<(std::ostream &os, Led1OnColorValue data)
Definition SpnEnums.hpp:562
The Color of LED2 when it's "Off".
Definition SpnEnums.hpp:750
static constexpr int Pink
Definition SpnEnums.hpp:759
static constexpr int Red
Definition SpnEnums.hpp:755
static constexpr int Blue
Definition SpnEnums.hpp:758
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:801
constexpr bool operator<(Led2OffColorValue data) const
Definition SpnEnums.hpp:787
constexpr Led2OffColorValue()
Definition SpnEnums.hpp:767
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:775
static constexpr int Cyan
Definition SpnEnums.hpp:760
int value
Definition SpnEnums.hpp:752
static constexpr int Off
Definition SpnEnums.hpp:754
std::string Serialize() const
Definition SpnEnums.hpp:823
static constexpr int White
Definition SpnEnums.hpp:761
friend std::ostream & operator<<(std::ostream &os, Led2OffColorValue data)
Definition SpnEnums.hpp:817
constexpr bool operator==(Led2OffColorValue data) const
Definition SpnEnums.hpp:771
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:791
constexpr bool operator!=(Led2OffColorValue data) const
Definition SpnEnums.hpp:779
constexpr Led2OffColorValue(int value)
Definition SpnEnums.hpp:763
static constexpr int Orange
Definition SpnEnums.hpp:757
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:783
static constexpr int Green
Definition SpnEnums.hpp:756
The Color of LED2 when it's "On".
Definition SpnEnums.hpp:665
static constexpr int Red
Definition SpnEnums.hpp:670
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:698
std::string Serialize() const
Definition SpnEnums.hpp:738
constexpr bool operator==(Led2OnColorValue data) const
Definition SpnEnums.hpp:686
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:690
static constexpr int Green
Definition SpnEnums.hpp:671
static constexpr int Pink
Definition SpnEnums.hpp:674
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:716
static constexpr int Cyan
Definition SpnEnums.hpp:675
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:706
constexpr bool operator<(Led2OnColorValue data) const
Definition SpnEnums.hpp:702
friend std::ostream & operator<<(std::ostream &os, Led2OnColorValue data)
Definition SpnEnums.hpp:732
static constexpr int Blue
Definition SpnEnums.hpp:673
static constexpr int Orange
Definition SpnEnums.hpp:672
static constexpr int White
Definition SpnEnums.hpp:676
static constexpr int Off
Definition SpnEnums.hpp:669
int value
Definition SpnEnums.hpp:667
constexpr Led2OnColorValue(int value)
Definition SpnEnums.hpp:678
constexpr Led2OnColorValue()
Definition SpnEnums.hpp:682
constexpr bool operator!=(Led2OnColorValue data) const
Definition SpnEnums.hpp:694
Whether the device is Season Pass licensed.
Definition SpnEnums.hpp:196
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:231
static constexpr int NotLicensed
Definition SpnEnums.hpp:200
constexpr bool operator!=(Licensing_IsSeasonPassedValue data) const
Definition SpnEnums.hpp:219
constexpr Licensing_IsSeasonPassedValue()
Definition SpnEnums.hpp:207
friend std::ostream & operator<<(std::ostream &os, Licensing_IsSeasonPassedValue data)
Definition SpnEnums.hpp:251
constexpr bool operator<(Licensing_IsSeasonPassedValue data) const
Definition SpnEnums.hpp:227
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:223
std::string Serialize() const
Definition SpnEnums.hpp:257
constexpr bool operator==(Licensing_IsSeasonPassedValue data) const
Definition SpnEnums.hpp:211
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:215
constexpr Licensing_IsSeasonPassedValue(int value)
Definition SpnEnums.hpp:203
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:241
static constexpr int Licensed
Definition SpnEnums.hpp:201
Magnet health as measured by CANcoder.
Definition SpnEnums.hpp:2830
friend std::ostream & operator<<(std::ostream &os, MagnetHealthValue data)
Definition SpnEnums.hpp:2901
static constexpr int Magnet_Orange
Magnet health is adequate but with reduced accuracy.
Definition SpnEnums.hpp:2841
constexpr bool operator!=(MagnetHealthValue data) const
Definition SpnEnums.hpp:2867
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2889
static constexpr int Magnet_Red
The magnet is too close or too far from the CANcoder.
Definition SpnEnums.hpp:2837
constexpr bool operator==(MagnetHealthValue data) const
Definition SpnEnums.hpp:2859
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2863
static constexpr int Magnet_Green
Magnet health is ideal.
Definition SpnEnums.hpp:2845
std::string Serialize() const
Definition SpnEnums.hpp:2907
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2871
constexpr MagnetHealthValue()
Definition SpnEnums.hpp:2855
int value
Definition SpnEnums.hpp:2832
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2879
static constexpr int Magnet_Invalid
The accuracy cannot be determined.
Definition SpnEnums.hpp:2849
constexpr MagnetHealthValue(int value)
Definition SpnEnums.hpp:2851
constexpr bool operator<(MagnetHealthValue data) const
Definition SpnEnums.hpp:2875
Health of the distance measurement.
Definition SpnEnums.hpp:3377
constexpr bool operator==(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3403
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3415
static constexpr int Good
Measurement is good.
Definition SpnEnums.hpp:3384
constexpr MeasurementHealthValue(int value)
Definition SpnEnums.hpp:3395
static constexpr int Limited
Measurement is likely okay, but the target is either very far away or moving very quickly.
Definition SpnEnums.hpp:3389
constexpr bool operator<(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3419
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3423
std::string Serialize() const
Definition SpnEnums.hpp:3450
static constexpr int Bad
Measurement is compromised.
Definition SpnEnums.hpp:3393
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3407
constexpr bool operator!=(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3411
friend std::ostream & operator<<(std::ostream &os, MeasurementHealthValue data)
Definition SpnEnums.hpp:3444
constexpr MeasurementHealthValue()
Definition SpnEnums.hpp:3399
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3433
int value
Definition SpnEnums.hpp:3379
Check if Motion Magic® is running.
Definition SpnEnums.hpp:1281
constexpr bool operator<(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1312
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1308
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1300
constexpr bool operator!=(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1304
constexpr MotionMagicIsRunningValue()
Definition SpnEnums.hpp:1292
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1326
constexpr bool operator==(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1296
constexpr MotionMagicIsRunningValue(int value)
Definition SpnEnums.hpp:1288
std::string Serialize() const
Definition SpnEnums.hpp:1342
static constexpr int Disabled
Definition SpnEnums.hpp:1286
friend std::ostream & operator<<(std::ostream &os, MotionMagicIsRunningValue data)
Definition SpnEnums.hpp:1336
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1316
static constexpr int Enabled
Definition SpnEnums.hpp:1285
Assess the status of the motor output with respect to load and supply.
Definition SpnEnums.hpp:1578
std::string Serialize() const
Definition SpnEnums.hpp:1669
constexpr MotorOutputStatusValue()
Definition SpnEnums.hpp:1615
static constexpr int RegenBraking
The motor is braking in such a way where motor current is traveling back to the supply (typically a b...
Definition SpnEnums.hpp:1609
static constexpr int Off
Motor output is disabled.
Definition SpnEnums.hpp:1589
static constexpr int Motoring
The motor is loaded in a typical fashion, drawing current from the supply, and successfully turning t...
Definition SpnEnums.hpp:1599
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1649
constexpr MotorOutputStatusValue(int value)
Definition SpnEnums.hpp:1611
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1639
constexpr bool operator==(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1619
constexpr bool operator!=(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1627
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1623
friend std::ostream & operator<<(std::ostream &os, MotorOutputStatusValue data)
Definition SpnEnums.hpp:1663
constexpr bool operator<(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1635
static constexpr int StaticBraking
The motor is in neutral-brake.
Definition SpnEnums.hpp:1593
int value
Definition SpnEnums.hpp:1580
static constexpr int Unknown
The status of motor output could not be determined.
Definition SpnEnums.hpp:1585
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1631
static constexpr int DiscordantMotoring
The same as Motoring, except the rotor is being backdriven as the motor output is not enough to defea...
Definition SpnEnums.hpp:1604
The state of the motor controller bridge when output is neutral or disabled.
Definition SpnEnums.hpp:2202
constexpr NeutralModeValue(int value)
Definition SpnEnums.hpp:2209
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2221
constexpr bool operator==(NeutralModeValue data) const
Definition SpnEnums.hpp:2217
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2237
std::string Serialize() const
Definition SpnEnums.hpp:2263
constexpr bool operator<(NeutralModeValue data) const
Definition SpnEnums.hpp:2233
friend std::ostream & operator<<(std::ostream &os, NeutralModeValue data)
Definition SpnEnums.hpp:2257
static constexpr int Brake
Definition SpnEnums.hpp:2207
constexpr bool operator!=(NeutralModeValue data) const
Definition SpnEnums.hpp:2225
constexpr NeutralModeValue()
Definition SpnEnums.hpp:2213
int value
Definition SpnEnums.hpp:2204
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2247
static constexpr int Coast
Definition SpnEnums.hpp:2206
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2229
The output mode of the PID controller.
Definition SpnEnums.hpp:1427
std::string Serialize() const
Definition SpnEnums.hpp:1490
constexpr bool operator<(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1459
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1473
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1455
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1433
friend std::ostream & operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data)
Definition SpnEnums.hpp:1484
constexpr PIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1435
static constexpr int Voltage
Definition SpnEnums.hpp:1432
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1447
constexpr PIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1439
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1463
static constexpr int DutyCycle
Definition SpnEnums.hpp:1431
constexpr bool operator!=(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1451
constexpr bool operator==(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1443
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1354
static constexpr int Position
Definition SpnEnums.hpp:1358
constexpr PIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:1365
friend std::ostream & operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1409
constexpr bool operator!=(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1377
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1381
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1389
constexpr PIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1361
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1373
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1399
constexpr bool operator==(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1369
static constexpr int Velocity
Definition SpnEnums.hpp:1359
std::string Serialize() const
Definition SpnEnums.hpp:1415
constexpr bool operator<(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1385
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1502
constexpr bool operator!=(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1525
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:1513
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1529
constexpr bool operator<(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1533
friend std::ostream & operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1557
static constexpr int Velocity
Definition SpnEnums.hpp:1507
std::string Serialize() const
Definition SpnEnums.hpp:1563
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1537
constexpr bool operator==(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1517
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1509
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1521
static constexpr int Position
Definition SpnEnums.hpp:1506
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1547
Determines where to poll the reverse limit switch.
Definition SpnEnums.hpp:2720
static constexpr int RemoteTalonFX
Use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2732
constexpr ReverseLimitSourceValue(int value)
Definition SpnEnums.hpp:2756
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2794
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2750
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2744
std::string Serialize() const
Definition SpnEnums.hpp:2814
int value
Definition SpnEnums.hpp:2722
friend std::ostream & operator<<(std::ostream &os, ReverseLimitSourceValue data)
Definition SpnEnums.hpp:2808
static constexpr int RemoteCANifier
Use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires set...
Definition SpnEnums.hpp:2737
constexpr bool operator==(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2764
constexpr bool operator<(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2780
constexpr bool operator!=(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2772
static constexpr int LimitSwitchPin
Use the reverse limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2727
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2784
constexpr ReverseLimitSourceValue()
Definition SpnEnums.hpp:2760
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2776
static constexpr int Disabled
Disable the reverse limit switch.
Definition SpnEnums.hpp:2754
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2768
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2633
friend std::ostream & operator<<(std::ostream &os, ReverseLimitTypeValue data)
Definition SpnEnums.hpp:2688
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2638
constexpr bool operator!=(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2656
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2668
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2678
constexpr ReverseLimitTypeValue()
Definition SpnEnums.hpp:2644
constexpr bool operator<(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2664
constexpr bool operator==(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2648
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2652
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2637
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2660
std::string Serialize() const
Definition SpnEnums.hpp:2694
int value
Definition SpnEnums.hpp:2635
constexpr ReverseLimitTypeValue(int value)
Definition SpnEnums.hpp:2640
Reverse Limit Pin.
Definition SpnEnums.hpp:981
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1016
constexpr bool operator==(ReverseLimitValue data) const
Definition SpnEnums.hpp:996
static constexpr int Open
Definition SpnEnums.hpp:986
constexpr bool operator<(ReverseLimitValue data) const
Definition SpnEnums.hpp:1012
int value
Definition SpnEnums.hpp:983
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1008
std::string Serialize() const
Definition SpnEnums.hpp:1042
friend std::ostream & operator<<(std::ostream &os, ReverseLimitValue data)
Definition SpnEnums.hpp:1036
constexpr bool operator!=(ReverseLimitValue data) const
Definition SpnEnums.hpp:1004
static constexpr int ClosedToGround
Definition SpnEnums.hpp:985
constexpr ReverseLimitValue()
Definition SpnEnums.hpp:992
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1000
constexpr ReverseLimitValue(int value)
Definition SpnEnums.hpp:988
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1026
Whether the robot is enabled.
Definition SpnEnums.hpp:422
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:457
friend std::ostream & operator<<(std::ostream &os, RobotEnableValue data)
Definition SpnEnums.hpp:477
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:441
static constexpr int Disabled
Definition SpnEnums.hpp:427
constexpr bool operator<(RobotEnableValue data) const
Definition SpnEnums.hpp:453
constexpr RobotEnableValue(int value)
Definition SpnEnums.hpp:429
constexpr RobotEnableValue()
Definition SpnEnums.hpp:433
static constexpr int Enabled
Definition SpnEnums.hpp:426
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:449
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:467
std::string Serialize() const
Definition SpnEnums.hpp:483
constexpr bool operator!=(RobotEnableValue data) const
Definition SpnEnums.hpp:445
int value
Definition SpnEnums.hpp:424
constexpr bool operator==(RobotEnableValue data) const
Definition SpnEnums.hpp:437
Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.
Definition SpnEnums.hpp:270
static constexpr int CounterClockwise_Positive
Counter-clockwise motion reports positive rotation.
Definition SpnEnums.hpp:277
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:321
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:311
friend std::ostream & operator<<(std::ostream &os, SensorDirectionValue data)
Definition SpnEnums.hpp:331
constexpr SensorDirectionValue(int value)
Definition SpnEnums.hpp:283
constexpr bool operator==(SensorDirectionValue data) const
Definition SpnEnums.hpp:291
static constexpr int Clockwise_Positive
Clockwise motion reports positive rotation.
Definition SpnEnums.hpp:281
constexpr bool operator!=(SensorDirectionValue data) const
Definition SpnEnums.hpp:299
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:303
int value
Definition SpnEnums.hpp:272
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:295
constexpr bool operator<(SensorDirectionValue data) const
Definition SpnEnums.hpp:307
std::string Serialize() const
Definition SpnEnums.hpp:337
constexpr SensorDirectionValue()
Definition SpnEnums.hpp:287
Static Feedforward Sign during position closed loop.
Definition SpnEnums.hpp:3159
std::string Serialize() const
Definition SpnEnums.hpp:3231
friend std::ostream & operator<<(std::ostream &os, StaticFeedforwardSignValue data)
Definition SpnEnums.hpp:3225
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3189
constexpr bool operator!=(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3193
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3215
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3205
static constexpr int UseVelocitySign
Use the velocity reference sign.
Definition SpnEnums.hpp:3168
constexpr StaticFeedforwardSignValue()
Definition SpnEnums.hpp:3181
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3197
constexpr bool operator==(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3185
static constexpr int UseClosedLoopSign
Use the sign of closed loop error.
Definition SpnEnums.hpp:3175
constexpr bool operator<(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3201
constexpr StaticFeedforwardSignValue(int value)
Definition SpnEnums.hpp:3177
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
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:55
constexpr bool operator!=(System_StateValue data) const
Definition SpnEnums.hpp:59
constexpr bool operator==(System_StateValue data) const
Definition SpnEnums.hpp:51
static constexpr int Production
Definition SpnEnums.hpp:41
static constexpr int Bootup_4
Definition SpnEnums.hpp:30
std::string Serialize() const
Definition SpnEnums.hpp:111
static constexpr int ControlDisabled
Definition SpnEnums.hpp:35
static constexpr int NotLicensed
Definition SpnEnums.hpp:40
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:81
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
static constexpr int BootBeep
Definition SpnEnums.hpp:34
static constexpr int Bootup_6
Definition SpnEnums.hpp:32
int value
Definition SpnEnums.hpp:24
static constexpr int Fault
Definition SpnEnums.hpp:38
static constexpr int ControlEnabled_11
Definition SpnEnums.hpp:37
constexpr System_StateValue(int value)
Definition SpnEnums.hpp:43
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:71
friend std::ostream & operator<<(std::ostream &os, System_StateValue data)
Definition SpnEnums.hpp:105
static constexpr int Bootup_5
Definition SpnEnums.hpp:31
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:63
static constexpr int Bootup_7
Definition SpnEnums.hpp:33
constexpr System_StateValue()
Definition SpnEnums.hpp:47
static constexpr int Bootup_2
Definition SpnEnums.hpp:28
constexpr bool operator<(System_StateValue data) const
Definition SpnEnums.hpp:67
Update mode of the CANrange.
Definition SpnEnums.hpp:3463
constexpr UpdateModeValue()
Definition SpnEnums.hpp:3486
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3520
int value
Definition SpnEnums.hpp:3465
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3510
static constexpr int ShortRangeUserFreq
Uses short-range detection mode for improved detection under high ambient infrared light conditions.
Definition SpnEnums.hpp:3476
std::string Serialize() const
Definition SpnEnums.hpp:3537
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3502
friend std::ostream & operator<<(std::ostream &os, UpdateModeValue data)
Definition SpnEnums.hpp:3531
constexpr bool operator<(UpdateModeValue data) const
Definition SpnEnums.hpp:3506
constexpr bool operator==(UpdateModeValue data) const
Definition SpnEnums.hpp:3490
static constexpr int ShortRange100Hz
Updates distance/proximity at 100hz using short-range detection mode.
Definition SpnEnums.hpp:3470
constexpr UpdateModeValue(int value)
Definition SpnEnums.hpp:3482
constexpr bool operator!=(UpdateModeValue data) const
Definition SpnEnums.hpp:3498
static constexpr int LongRangeUserFreq
Uses long-range detection mode and user-specified update frequency.
Definition SpnEnums.hpp:3480
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3494
Definition StatusCodes.h:18