CTRE Phoenix 6 C++ 25.2.1
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 Status of the temperature sensor of the external motor.
1278 */
1280{
1281public:
1283
1284 /**
1285 * \brief Talon is collecting information on the sensor.
1286 */
1287 static constexpr int Collecting = 0;
1288 /**
1289 * \brief Temperature sensor appears to be disconnected.
1290 */
1291 static constexpr int Disconnected = 1;
1292 /**
1293 * \brief Temperature sensor is too hot to allow motor operation.
1294 */
1295 static constexpr int TooHot = 2;
1296 /**
1297 * \brief Temperature sensor is normal.
1298 */
1299 static constexpr int Normal = 3;
1300 /**
1301 * \brief Temperature sensor is present but is not used. Most likely the motor
1302 * arrangement is brushed or disabled.
1303 */
1304 static constexpr int NotUsed = 4;
1305 /**
1306 * \brief Temperature sensor appears to be for the wrong motor arrangement, or
1307 * signals are shorted.
1308 */
1309 static constexpr int WrongMotorOrShorted = 5;
1310
1312 value{value}
1313 {}
1314
1316 value{-1}
1317 {}
1318
1319 constexpr bool operator==(ExternalMotorTempStatusValue data) const
1320 {
1321 return this->value == data.value;
1322 }
1323 constexpr bool operator==(int data) const
1324 {
1325 return this->value == data;
1326 }
1327 constexpr bool operator!=(ExternalMotorTempStatusValue data) const
1328 {
1329 return this->value != data.value;
1330 }
1331 constexpr bool operator!=(int data) const
1332 {
1333 return this->value != data;
1334 }
1335 constexpr bool operator<(ExternalMotorTempStatusValue data) const
1336 {
1337 return this->value < data.value;
1338 }
1339 constexpr bool operator<(int data) const
1340 {
1341 return this->value < data;
1342 }
1343
1344 /**
1345 * \brief Gets the string representation of this enum
1346 *
1347 * \returns String representation of this enum
1348 */
1349 std::string ToString() const
1350 {
1351 switch (value)
1352 {
1353 case ExternalMotorTempStatusValue::Collecting: return "Collecting";
1354 case ExternalMotorTempStatusValue::Disconnected: return "Disconnected";
1355 case ExternalMotorTempStatusValue::TooHot: return "Too Hot";
1356 case ExternalMotorTempStatusValue::Normal: return "Normal";
1357 case ExternalMotorTempStatusValue::NotUsed: return "Not Used";
1358 case ExternalMotorTempStatusValue::WrongMotorOrShorted: return "Wrong Motor Or Shorted";
1359 default: return "Invalid Value";
1360 }
1361 }
1362
1363 friend std::ostream &operator<<(std::ostream &os, ExternalMotorTempStatusValue data)
1364 {
1365 os << data.ToString();
1366 return os;
1367 }
1368
1369 std::string Serialize() const
1370 {
1371 std::stringstream ss;
1372 ss << "u_" << this->value;
1373 return ss.str();
1374 }
1375};
1376
1377/**
1378 * \brief Check if Motion Magic® is running. This is equivalent to checking
1379 * that the reported control mode is a Motion Magic® based mode.
1380 */
1382{
1383public:
1385
1386 static constexpr int Enabled = 1;
1387 static constexpr int Disabled = 0;
1388
1390 value{value}
1391 {}
1392
1394 value{-1}
1395 {}
1396
1397 constexpr bool operator==(MotionMagicIsRunningValue data) const
1398 {
1399 return this->value == data.value;
1400 }
1401 constexpr bool operator==(int data) const
1402 {
1403 return this->value == data;
1404 }
1405 constexpr bool operator!=(MotionMagicIsRunningValue data) const
1406 {
1407 return this->value != data.value;
1408 }
1409 constexpr bool operator!=(int data) const
1410 {
1411 return this->value != data;
1412 }
1413 constexpr bool operator<(MotionMagicIsRunningValue data) const
1414 {
1415 return this->value < data.value;
1416 }
1417 constexpr bool operator<(int data) const
1418 {
1419 return this->value < data;
1420 }
1421
1422 /**
1423 * \brief Gets the string representation of this enum
1424 *
1425 * \returns String representation of this enum
1426 */
1427 std::string ToString() const
1428 {
1429 switch (value)
1430 {
1431 case MotionMagicIsRunningValue::Enabled: return "Enabled";
1432 case MotionMagicIsRunningValue::Disabled: return "Disabled";
1433 default: return "Invalid Value";
1434 }
1435 }
1436
1437 friend std::ostream &operator<<(std::ostream &os, MotionMagicIsRunningValue data)
1438 {
1439 os << data.ToString();
1440 return os;
1441 }
1442
1443 std::string Serialize() const
1444 {
1445 std::stringstream ss;
1446 ss << "u_" << this->value;
1447 return ss.str();
1448 }
1449};
1450
1451/**
1452 * \brief Whether the closed-loop is running on position or velocity.
1453 */
1455{
1456public:
1458
1459 static constexpr int Position = 0;
1460 static constexpr int Velocity = 1;
1461
1463 value{value}
1464 {}
1465
1467 value{-1}
1468 {}
1469
1471 {
1472 return this->value == data.value;
1473 }
1474 constexpr bool operator==(int data) const
1475 {
1476 return this->value == data;
1477 }
1479 {
1480 return this->value != data.value;
1481 }
1482 constexpr bool operator!=(int data) const
1483 {
1484 return this->value != data;
1485 }
1487 {
1488 return this->value < data.value;
1489 }
1490 constexpr bool operator<(int data) const
1491 {
1492 return this->value < data;
1493 }
1494
1495 /**
1496 * \brief Gets the string representation of this enum
1497 *
1498 * \returns String representation of this enum
1499 */
1500 std::string ToString() const
1501 {
1502 switch (value)
1503 {
1504 case PIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1505 case PIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1506 default: return "Invalid Value";
1507 }
1508 }
1509
1510 friend std::ostream &operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data)
1511 {
1512 os << data.ToString();
1513 return os;
1514 }
1515
1516 std::string Serialize() const
1517 {
1518 std::stringstream ss;
1519 ss << "u_" << this->value;
1520 return ss.str();
1521 }
1522};
1523
1524/**
1525 * \brief The output mode of the PID controller.
1526 */
1528{
1529public:
1531
1532 static constexpr int DutyCycle = 0;
1533 static constexpr int Voltage = 1;
1534 static constexpr int TorqueCurrentFOC = 2;
1535
1537 value{value}
1538 {}
1539
1541 value{-1}
1542 {}
1543
1544 constexpr bool operator==(PIDOutput_PIDOutputModeValue data) const
1545 {
1546 return this->value == data.value;
1547 }
1548 constexpr bool operator==(int data) const
1549 {
1550 return this->value == data;
1551 }
1552 constexpr bool operator!=(PIDOutput_PIDOutputModeValue data) const
1553 {
1554 return this->value != data.value;
1555 }
1556 constexpr bool operator!=(int data) const
1557 {
1558 return this->value != data;
1559 }
1560 constexpr bool operator<(PIDOutput_PIDOutputModeValue data) const
1561 {
1562 return this->value < data.value;
1563 }
1564 constexpr bool operator<(int data) const
1565 {
1566 return this->value < data;
1567 }
1568
1569 /**
1570 * \brief Gets the string representation of this enum
1571 *
1572 * \returns String representation of this enum
1573 */
1574 std::string ToString() const
1575 {
1576 switch (value)
1577 {
1578 case PIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
1579 case PIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
1580 case PIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1581 default: return "Invalid Value";
1582 }
1583 }
1584
1585 friend std::ostream &operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data)
1586 {
1587 os << data.ToString();
1588 return os;
1589 }
1590
1591 std::string Serialize() const
1592 {
1593 std::stringstream ss;
1594 ss << "u_" << this->value;
1595 return ss.str();
1596 }
1597};
1598
1599/**
1600 * \brief Whether the closed-loop is running on position or velocity.
1601 */
1603{
1604public:
1606
1607 static constexpr int Position = 0;
1608 static constexpr int Velocity = 1;
1609
1613
1615 value{-1}
1616 {}
1617
1619 {
1620 return this->value == data.value;
1621 }
1622 constexpr bool operator==(int data) const
1623 {
1624 return this->value == data;
1625 }
1627 {
1628 return this->value != data.value;
1629 }
1630 constexpr bool operator!=(int data) const
1631 {
1632 return this->value != data;
1633 }
1635 {
1636 return this->value < data.value;
1637 }
1638 constexpr bool operator<(int data) const
1639 {
1640 return this->value < data;
1641 }
1642
1643 /**
1644 * \brief Gets the string representation of this enum
1645 *
1646 * \returns String representation of this enum
1647 */
1648 std::string ToString() const
1649 {
1650 switch (value)
1651 {
1654 default: return "Invalid Value";
1655 }
1656 }
1657
1658 friend std::ostream &operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data)
1659 {
1660 os << data.ToString();
1661 return os;
1662 }
1663
1664 std::string Serialize() const
1665 {
1666 std::stringstream ss;
1667 ss << "u_" << this->value;
1668 return ss.str();
1669 }
1670};
1671
1672/**
1673 * \brief Assess the status of the motor output with respect to load and supply.
1674 *
1675 * \details This routine can be used to determine the general status of motor
1676 * commutation.
1677 */
1679{
1680public:
1682
1683 /**
1684 * \brief The status of motor output could not be determined.
1685 */
1686 static constexpr int Unknown = 0;
1687 /**
1688 * \brief Motor output is disabled.
1689 */
1690 static constexpr int Off = 1;
1691 /**
1692 * \brief The motor is in neutral-brake.
1693 */
1694 static constexpr int StaticBraking = 2;
1695 /**
1696 * \brief The motor is loaded in a typical fashion, drawing current from the
1697 * supply, and successfully turning the rotor in the direction of applied
1698 * voltage.
1699 */
1700 static constexpr int Motoring = 3;
1701 /**
1702 * \brief The same as Motoring, except the rotor is being backdriven as the
1703 * motor output is not enough to defeat load forces.
1704 */
1705 static constexpr int DiscordantMotoring = 4;
1706 /**
1707 * \brief The motor is braking in such a way where motor current is traveling
1708 * back to the supply (typically a battery).
1709 */
1710 static constexpr int RegenBraking = 5;
1711
1713 value{value}
1714 {}
1715
1717 value{-1}
1718 {}
1719
1720 constexpr bool operator==(MotorOutputStatusValue 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!=(MotorOutputStatusValue 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<(MotorOutputStatusValue 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 MotorOutputStatusValue::Unknown: return "Unknown";
1755 case MotorOutputStatusValue::Off: return "Off";
1756 case MotorOutputStatusValue::StaticBraking: return "StaticBraking";
1757 case MotorOutputStatusValue::Motoring: return "Motoring";
1758 case MotorOutputStatusValue::DiscordantMotoring: return "DiscordantMotoring";
1759 case MotorOutputStatusValue::RegenBraking: return "RegenBraking";
1760 default: return "Invalid Value";
1761 }
1762 }
1763
1764 friend std::ostream &operator<<(std::ostream &os, MotorOutputStatusValue data)
1765 {
1766 os << data.ToString();
1767 return os;
1768 }
1769
1770 std::string Serialize() const
1771 {
1772 std::stringstream ss;
1773 ss << "u_" << this->value;
1774 return ss.str();
1775 }
1776};
1777
1778/**
1779 * \brief The active control mode of the differential controller.
1780 */
1782{
1783public:
1785
1786 static constexpr int DisabledOutput = 0;
1787 static constexpr int NeutralOut = 1;
1788 static constexpr int StaticBrake = 2;
1789 static constexpr int DutyCycleOut = 3;
1790 static constexpr int PositionDutyCycle = 4;
1791 static constexpr int VelocityDutyCycle = 5;
1792 static constexpr int MotionMagicDutyCycle = 6;
1793 static constexpr int DutyCycleFOC = 7;
1794 static constexpr int PositionDutyCycleFOC = 8;
1795 static constexpr int VelocityDutyCycleFOC = 9;
1796 static constexpr int MotionMagicDutyCycleFOC = 10;
1797 static constexpr int VoltageOut = 11;
1798 static constexpr int PositionVoltage = 12;
1799 static constexpr int VelocityVoltage = 13;
1800 static constexpr int MotionMagicVoltage = 14;
1801 static constexpr int VoltageFOC = 15;
1802 static constexpr int PositionVoltageFOC = 16;
1803 static constexpr int VelocityVoltageFOC = 17;
1804 static constexpr int MotionMagicVoltageFOC = 18;
1805 static constexpr int TorqueCurrentFOC = 19;
1806 static constexpr int PositionTorqueCurrentFOC = 20;
1807 static constexpr int VelocityTorqueCurrentFOC = 21;
1808 static constexpr int MotionMagicTorqueCurrentFOC = 22;
1809 static constexpr int Follower = 23;
1810 static constexpr int Reserved = 24;
1811 static constexpr int CoastOut = 25;
1812
1814 value{value}
1815 {}
1816
1818 value{-1}
1819 {}
1820
1821 constexpr bool operator==(DifferentialControlModeValue data) const
1822 {
1823 return this->value == data.value;
1824 }
1825 constexpr bool operator==(int data) const
1826 {
1827 return this->value == data;
1828 }
1829 constexpr bool operator!=(DifferentialControlModeValue data) const
1830 {
1831 return this->value != data.value;
1832 }
1833 constexpr bool operator!=(int data) const
1834 {
1835 return this->value != data;
1836 }
1837 constexpr bool operator<(DifferentialControlModeValue data) const
1838 {
1839 return this->value < data.value;
1840 }
1841 constexpr bool operator<(int data) const
1842 {
1843 return this->value < data;
1844 }
1845
1846 /**
1847 * \brief Gets the string representation of this enum
1848 *
1849 * \returns String representation of this enum
1850 */
1851 std::string ToString() const
1852 {
1853 switch (value)
1854 {
1855 case DifferentialControlModeValue::DisabledOutput: return "DisabledOutput";
1856 case DifferentialControlModeValue::NeutralOut: return "NeutralOut";
1857 case DifferentialControlModeValue::StaticBrake: return "StaticBrake";
1858 case DifferentialControlModeValue::DutyCycleOut: return "DutyCycleOut";
1859 case DifferentialControlModeValue::PositionDutyCycle: return "PositionDutyCycle";
1860 case DifferentialControlModeValue::VelocityDutyCycle: return "VelocityDutyCycle";
1861 case DifferentialControlModeValue::MotionMagicDutyCycle: return "MotionMagicDutyCycle";
1862 case DifferentialControlModeValue::DutyCycleFOC: return "DutyCycleFOC";
1863 case DifferentialControlModeValue::PositionDutyCycleFOC: return "PositionDutyCycleFOC";
1864 case DifferentialControlModeValue::VelocityDutyCycleFOC: return "VelocityDutyCycleFOC";
1865 case DifferentialControlModeValue::MotionMagicDutyCycleFOC: return "MotionMagicDutyCycleFOC";
1866 case DifferentialControlModeValue::VoltageOut: return "VoltageOut";
1867 case DifferentialControlModeValue::PositionVoltage: return "PositionVoltage";
1868 case DifferentialControlModeValue::VelocityVoltage: return "VelocityVoltage";
1869 case DifferentialControlModeValue::MotionMagicVoltage: return "MotionMagicVoltage";
1870 case DifferentialControlModeValue::VoltageFOC: return "VoltageFOC";
1871 case DifferentialControlModeValue::PositionVoltageFOC: return "PositionVoltageFOC";
1872 case DifferentialControlModeValue::VelocityVoltageFOC: return "VelocityVoltageFOC";
1873 case DifferentialControlModeValue::MotionMagicVoltageFOC: return "MotionMagicVoltageFOC";
1874 case DifferentialControlModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
1875 case DifferentialControlModeValue::PositionTorqueCurrentFOC: return "PositionTorqueCurrentFOC";
1876 case DifferentialControlModeValue::VelocityTorqueCurrentFOC: return "VelocityTorqueCurrentFOC";
1877 case DifferentialControlModeValue::MotionMagicTorqueCurrentFOC: return "MotionMagicTorqueCurrentFOC";
1878 case DifferentialControlModeValue::Follower: return "Follower";
1879 case DifferentialControlModeValue::Reserved: return "Reserved";
1880 case DifferentialControlModeValue::CoastOut: return "CoastOut";
1881 default: return "Invalid Value";
1882 }
1883 }
1884
1885 friend std::ostream &operator<<(std::ostream &os, DifferentialControlModeValue data)
1886 {
1887 os << data.ToString();
1888 return os;
1889 }
1890
1891 std::string Serialize() const
1892 {
1893 std::stringstream ss;
1894 ss << "u_" << this->value;
1895 return ss.str();
1896 }
1897};
1898
1899/**
1900 * \brief Whether the closed-loop is running on position or velocity.
1901 */
1903{
1904public:
1906
1907 static constexpr int Position = 0;
1908 static constexpr int Velocity = 1;
1909
1913
1915 value{-1}
1916 {}
1917
1919 {
1920 return this->value == data.value;
1921 }
1922 constexpr bool operator==(int data) const
1923 {
1924 return this->value == data;
1925 }
1927 {
1928 return this->value != data.value;
1929 }
1930 constexpr bool operator!=(int data) const
1931 {
1932 return this->value != data;
1933 }
1935 {
1936 return this->value < data.value;
1937 }
1938 constexpr bool operator<(int data) const
1939 {
1940 return this->value < data;
1941 }
1942
1943 /**
1944 * \brief Gets the string representation of this enum
1945 *
1946 * \returns String representation of this enum
1947 */
1948 std::string ToString() const
1949 {
1950 switch (value)
1951 {
1952 case DiffPIDRefPIDErr_ClosedLoopModeValue::Position: return "Position";
1953 case DiffPIDRefPIDErr_ClosedLoopModeValue::Velocity: return "Velocity";
1954 default: return "Invalid Value";
1955 }
1956 }
1957
1958 friend std::ostream &operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue data)
1959 {
1960 os << data.ToString();
1961 return os;
1962 }
1963
1964 std::string Serialize() const
1965 {
1966 std::stringstream ss;
1967 ss << "u_" << this->value;
1968 return ss.str();
1969 }
1970};
1971
1972/**
1973 * \brief The output mode of the differential PID controller.
1974 */
1976{
1977public:
1979
1980 static constexpr int DutyCycle = 0;
1981 static constexpr int Voltage = 1;
1982 static constexpr int TorqueCurrentFOC = 2;
1983
1985 value{value}
1986 {}
1987
1989 value{-1}
1990 {}
1991
1993 {
1994 return this->value == data.value;
1995 }
1996 constexpr bool operator==(int data) const
1997 {
1998 return this->value == data;
1999 }
2001 {
2002 return this->value != data.value;
2003 }
2004 constexpr bool operator!=(int data) const
2005 {
2006 return this->value != data;
2007 }
2009 {
2010 return this->value < data.value;
2011 }
2012 constexpr bool operator<(int data) const
2013 {
2014 return this->value < data;
2015 }
2016
2017 /**
2018 * \brief Gets the string representation of this enum
2019 *
2020 * \returns String representation of this enum
2021 */
2022 std::string ToString() const
2023 {
2024 switch (value)
2025 {
2026 case DiffPIDOutput_PIDOutputModeValue::DutyCycle: return "DutyCycle";
2027 case DiffPIDOutput_PIDOutputModeValue::Voltage: return "Voltage";
2028 case DiffPIDOutput_PIDOutputModeValue::TorqueCurrentFOC: return "TorqueCurrentFOC";
2029 default: return "Invalid Value";
2030 }
2031 }
2032
2033 friend std::ostream &operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data)
2034 {
2035 os << data.ToString();
2036 return os;
2037 }
2038
2039 std::string Serialize() const
2040 {
2041 std::stringstream ss;
2042 ss << "u_" << this->value;
2043 return ss.str();
2044 }
2045};
2046
2047/**
2048 * \brief Whether the closed-loop is running on position or velocity.
2049 */
2051{
2052public:
2054
2055 static constexpr int Position = 0;
2056 static constexpr int Velocity = 1;
2057
2061
2065
2067 {
2068 return this->value == data.value;
2069 }
2070 constexpr bool operator==(int data) const
2071 {
2072 return this->value == data;
2073 }
2075 {
2076 return this->value != data.value;
2077 }
2078 constexpr bool operator!=(int data) const
2079 {
2080 return this->value != data;
2081 }
2083 {
2084 return this->value < data.value;
2085 }
2086 constexpr bool operator<(int data) const
2087 {
2088 return this->value < data;
2089 }
2090
2091 /**
2092 * \brief Gets the string representation of this enum
2093 *
2094 * \returns String representation of this enum
2095 */
2096 std::string ToString() const
2097 {
2098 switch (value)
2099 {
2102 default: return "Invalid Value";
2103 }
2104 }
2105
2106 friend std::ostream &operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data)
2107 {
2108 os << data.ToString();
2109 return os;
2110 }
2111
2112 std::string Serialize() const
2113 {
2114 std::stringstream ss;
2115 ss << "u_" << this->value;
2116 return ss.str();
2117 }
2118};
2119
2120/**
2121 * \brief Gravity Feedforward/Feedback Type.
2122 *
2123 * This determines the type of the gravity feedforward/feedback.
2124 *
2125 * Choose Elevator_Static for systems where the gravity feedforward is
2126 * constant, such as an elevator. The gravity feedforward output will
2127 * always have the same sign.
2128 *
2129 * Choose Arm_Cosine for systems where the gravity feedback is dependent
2130 * on the angular position of the mechanism, such as an arm. The gravity
2131 * feedback output will vary depending on the mechanism angular position.
2132 * Note that the sensor offset and ratios must be configured so that the
2133 * sensor reports a position of 0 when the mechanism is horizonal
2134 * (parallel to the ground), and the reported sensor position is 1:1 with
2135 * the mechanism.
2136 */
2138{
2139public:
2141
2142 /**
2143 * \brief The system's gravity feedforward is constant, such as an elevator. The
2144 * gravity feedforward output will always have the same sign.
2145 */
2146 static constexpr int Elevator_Static = 0;
2147 /**
2148 * \brief The system's gravity feedback is dependent on the angular position of
2149 * the mechanism, such as an arm. The gravity feedback output will vary
2150 * depending on the mechanism angular position. Note that the sensor
2151 * offset and ratios must be configured so that the sensor reports a
2152 * position of 0 when the mechanism is horizonal (parallel to the
2153 * ground), and the reported sensor position is 1:1 with the mechanism.
2154 */
2155 static constexpr int Arm_Cosine = 1;
2156
2157 constexpr GravityTypeValue(int value) :
2158 value{value}
2159 {}
2160
2161 constexpr GravityTypeValue() :
2162 value{-1}
2163 {}
2164
2165 constexpr bool operator==(GravityTypeValue data) const
2166 {
2167 return this->value == data.value;
2168 }
2169 constexpr bool operator==(int data) const
2170 {
2171 return this->value == data;
2172 }
2173 constexpr bool operator!=(GravityTypeValue data) const
2174 {
2175 return this->value != data.value;
2176 }
2177 constexpr bool operator!=(int data) const
2178 {
2179 return this->value != data;
2180 }
2181 constexpr bool operator<(GravityTypeValue data) const
2182 {
2183 return this->value < data.value;
2184 }
2185 constexpr bool operator<(int data) const
2186 {
2187 return this->value < data;
2188 }
2189
2190 /**
2191 * \brief Gets the string representation of this enum
2192 *
2193 * \returns String representation of this enum
2194 */
2195 std::string ToString() const
2196 {
2197 switch (value)
2198 {
2199 case GravityTypeValue::Elevator_Static: return "Elevator_Static";
2200 case GravityTypeValue::Arm_Cosine: return "Arm_Cosine";
2201 default: return "Invalid Value";
2202 }
2203 }
2204
2205 friend std::ostream &operator<<(std::ostream &os, GravityTypeValue data)
2206 {
2207 os << data.ToString();
2208 return os;
2209 }
2210
2211 std::string Serialize() const
2212 {
2213 std::stringstream ss;
2214 ss << "u_" << this->value;
2215 return ss.str();
2216 }
2217};
2218
2219/**
2220 * \brief Invert state of the device as seen from the front of the motor.
2221 */
2223{
2224public:
2226
2227 /**
2228 * \brief Positive motor output results in clockwise motion.
2229 */
2230 static constexpr int CounterClockwise_Positive = 0;
2231 /**
2232 * \brief Positive motor output results in counter-clockwise motion.
2233 */
2234 static constexpr int Clockwise_Positive = 1;
2235
2236 constexpr InvertedValue(int value) :
2237 value{value}
2238 {}
2239
2240 constexpr InvertedValue() :
2241 value{-1}
2242 {}
2243
2244 constexpr bool operator==(InvertedValue data) const
2245 {
2246 return this->value == data.value;
2247 }
2248 constexpr bool operator==(int data) const
2249 {
2250 return this->value == data;
2251 }
2252 constexpr bool operator!=(InvertedValue data) const
2253 {
2254 return this->value != data.value;
2255 }
2256 constexpr bool operator!=(int data) const
2257 {
2258 return this->value != data;
2259 }
2260 constexpr bool operator<(InvertedValue data) const
2261 {
2262 return this->value < data.value;
2263 }
2264 constexpr bool operator<(int data) const
2265 {
2266 return this->value < data;
2267 }
2268
2269 /**
2270 * \brief Gets the string representation of this enum
2271 *
2272 * \returns String representation of this enum
2273 */
2274 std::string ToString() const
2275 {
2276 switch (value)
2277 {
2278 case InvertedValue::CounterClockwise_Positive: return "CounterClockwise_Positive";
2279 case InvertedValue::Clockwise_Positive: return "Clockwise_Positive";
2280 default: return "Invalid Value";
2281 }
2282 }
2283
2284 friend std::ostream &operator<<(std::ostream &os, InvertedValue data)
2285 {
2286 os << data.ToString();
2287 return os;
2288 }
2289
2290 std::string Serialize() const
2291 {
2292 std::stringstream ss;
2293 ss << "u_" << this->value;
2294 return ss.str();
2295 }
2296};
2297
2298/**
2299 * \brief The state of the motor controller bridge when output is neutral or
2300 * disabled.
2301 */
2303{
2304public:
2306
2307 static constexpr int Coast = 0;
2308 static constexpr int Brake = 1;
2309
2310 constexpr NeutralModeValue(int value) :
2311 value{value}
2312 {}
2313
2314 constexpr NeutralModeValue() :
2315 value{-1}
2316 {}
2317
2318 constexpr bool operator==(NeutralModeValue data) const
2319 {
2320 return this->value == data.value;
2321 }
2322 constexpr bool operator==(int data) const
2323 {
2324 return this->value == data;
2325 }
2326 constexpr bool operator!=(NeutralModeValue data) const
2327 {
2328 return this->value != data.value;
2329 }
2330 constexpr bool operator!=(int data) const
2331 {
2332 return this->value != data;
2333 }
2334 constexpr bool operator<(NeutralModeValue data) const
2335 {
2336 return this->value < data.value;
2337 }
2338 constexpr bool operator<(int data) const
2339 {
2340 return this->value < data;
2341 }
2342
2343 /**
2344 * \brief Gets the string representation of this enum
2345 *
2346 * \returns String representation of this enum
2347 */
2348 std::string ToString() const
2349 {
2350 switch (value)
2351 {
2352 case NeutralModeValue::Coast: return "Coast";
2353 case NeutralModeValue::Brake: return "Brake";
2354 default: return "Invalid Value";
2355 }
2356 }
2357
2358 friend std::ostream &operator<<(std::ostream &os, NeutralModeValue data)
2359 {
2360 os << data.ToString();
2361 return os;
2362 }
2363
2364 std::string Serialize() const
2365 {
2366 std::stringstream ss;
2367 ss << "u_" << this->value;
2368 return ss.str();
2369 }
2370};
2371
2372/**
2373 * \brief Choose what sensor source is reported via API and used by closed-loop
2374 * and limit features. The default is RotorSensor, which uses the
2375 * internal rotor sensor in the Talon.
2376 *
2377 * Choose Remote* to use another sensor on the same CAN bus (this also
2378 * requires setting FeedbackRemoteSensorID). Talon will update its
2379 * position and velocity whenever the remote sensor publishes its
2380 * information on CAN bus, and the Talon internal rotor will not be used.
2381 *
2382 * Choose Fused* (requires Phoenix Pro) and Talon will fuse another
2383 * sensor's information with the internal rotor, which provides the best
2384 * possible position and velocity for accuracy and bandwidth (this also
2385 * requires setting FeedbackRemoteSensorID). This was developed for
2386 * applications such as swerve-azimuth.
2387 *
2388 * Choose Sync* (requires Phoenix Pro) and Talon will synchronize its
2389 * internal rotor position against another sensor, then continue to use
2390 * the rotor sensor for closed loop control (this also requires setting
2391 * FeedbackRemoteSensorID). The Talon will report if its internal
2392 * position differs significantly from the reported remote sensor
2393 * position. This was developed for mechanisms where there is a risk of
2394 * the sensor failing in such a way that it reports a position that does
2395 * not match the mechanism, such as the sensor mounting assembly breaking
2396 * off.
2397 *
2398 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
2399 * to use another Pigeon2 on the same CAN bus (this also requires setting
2400 * FeedbackRemoteSensorID). Talon will update its position to match the
2401 * selected value whenever Pigeon2 publishes its information on CAN bus.
2402 * Note that the Talon position will be in rotations and not degrees.
2403 *
2404 * \details Note: When the feedback source is changed to Fused* or Sync*, the
2405 * Talon needs a period of time to fuse before sensor-based
2406 * (soft-limit, closed loop, etc.) features are used. This period of
2407 * time is determined by the update frequency of the remote sensor's
2408 * Position signal.
2409 */
2411{
2412public:
2414
2415 /**
2416 * \brief Use the internal rotor sensor in the Talon.
2417 */
2418 static constexpr int RotorSensor = 0;
2419 /**
2420 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2421 * FeedbackRemoteSensorID). Talon will update its position and velocity
2422 * whenever CANcoder publishes its information on CAN bus, and the Talon
2423 * internal rotor will not be used.
2424 */
2425 static constexpr int RemoteCANcoder = 1;
2426 /**
2427 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2428 * FeedbackRemoteSensorID). Talon will update its position to match the
2429 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
2430 * Note that the Talon position will be in rotations and not degrees.
2431 */
2432 static constexpr int RemotePigeon2_Yaw = 2;
2433 /**
2434 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2435 * FeedbackRemoteSensorID). Talon will update its position to match the
2436 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
2437 * Note that the Talon position will be in rotations and not degrees.
2438 */
2439 static constexpr int RemotePigeon2_Pitch = 3;
2440 /**
2441 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
2442 * FeedbackRemoteSensorID). Talon will update its position to match the
2443 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
2444 * Note that the Talon position will be in rotations and not degrees.
2445 */
2446 static constexpr int RemotePigeon2_Roll = 4;
2447 /**
2448 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
2449 * with the internal rotor, which provides the best possible position and
2450 * velocity for accuracy and bandwidth (this also requires setting
2451 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
2452 * such as swerve-azimuth.
2453 */
2454 static constexpr int FusedCANcoder = 5;
2455 /**
2456 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
2457 * position against another CANcoder, then continue to use the rotor
2458 * sensor for closed loop control (this also requires setting
2459 * FeedbackRemoteSensorID). The Talon will report if its internal
2460 * position differs significantly from the reported CANcoder position.
2461 * SyncCANcoder was developed for mechanisms where there is a risk of the
2462 * CANcoder failing in such a way that it reports a position that does
2463 * not match the mechanism, such as the sensor mounting assembly breaking
2464 * off.
2465 */
2466 static constexpr int SyncCANcoder = 6;
2467 /**
2468 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
2469 * (S1IN) on CANdi. Talon will update its position and velocity whenever
2470 * CANdi publishes its information on CAN bus, and the Talon internal
2471 * rotor will not be used.
2472 */
2473 static constexpr int RemoteCANdiPWM1 = 9;
2474 /**
2475 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
2476 * (S2IN) on CANdi. Talon will update its position and velocity whenever
2477 * CANdi publishes its information on CAN bus, and the Talon internal
2478 * rotor will not be used.
2479 */
2480 static constexpr int RemoteCANdiPWM2 = 10;
2481 /**
2482 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
2483 * CANdi. Talon will update its position and velocity whenever CANdi
2484 * publishes its information on CAN bus, and the Talon internal rotor
2485 * will not be used.
2486 */
2487 static constexpr int RemoteCANdiQuadrature = 11;
2488 /**
2489 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
2490 * attached to the Sensor Input 1 (S1IN) on CANdi, which provides the
2491 * best possible position and velocity for accuracy and bandwidth (this
2492 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
2493 * developed for applications such as swerve-azimuth.
2494 */
2495 static constexpr int FusedCANdiPWM1 = 12;
2496 /**
2497 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
2498 * attached to the Sensor Input 2 (S2IN) on CANdi, which provides the
2499 * best possible position and velocity for accuracy and bandwidth (this
2500 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
2501 * developed for applications such as swerve-azimuth.
2502 */
2503 static constexpr int FusedCANdiPWM2 = 13;
2504 /**
2505 * \brief Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely
2506 * attached to the two Sensor Inputs on CANdi. This provides velocity and
2507 * relative position measurements. This also requires setting
2508 * FeedbackRemoteSensorID.
2509 */
2510 static constexpr int FusedCANdiQuadrature = 14;
2511 /**
2512 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
2513 * position against the pulse-width encoder attached to Sensor Input 1
2514 * (S1IN), then continue to use the rotor sensor for closed loop control
2515 * (this also requires setting FeedbackRemoteSensorID). The Talon will
2516 * report if its internal position differs significantly from the
2517 * reported PWM position. SyncCANdi was developed for mechanisms where
2518 * there is a risk of the CANdi failing in such a way that it reports a
2519 * position that does not match the mechanism, such as the sensor
2520 * mounting assembly breaking off.
2521 */
2522 static constexpr int SyncCANdiPWM1 = 15;
2523 /**
2524 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
2525 * position against the pulse-width encoder attached to Sensor Input 1
2526 * (S1IN), then continue to use the rotor sensor for closed loop control
2527 * (this also requires setting FeedbackRemoteSensorID). The Talon will
2528 * report if its internal position differs significantly from the
2529 * reported PWM position. SyncCANdi was developed for mechanisms where
2530 * there is a risk of the CANdi failing in such a way that it reports a
2531 * position that does not match the mechanism, such as the sensor
2532 * mounting assembly breaking off.
2533 */
2534 static constexpr int SyncCANdiPWM2 = 16;
2535
2537 value{value}
2538 {}
2539
2541 value{-1}
2542 {}
2543
2544 constexpr bool operator==(FeedbackSensorSourceValue data) const
2545 {
2546 return this->value == data.value;
2547 }
2548 constexpr bool operator==(int data) const
2549 {
2550 return this->value == data;
2551 }
2552 constexpr bool operator!=(FeedbackSensorSourceValue data) const
2553 {
2554 return this->value != data.value;
2555 }
2556 constexpr bool operator!=(int data) const
2557 {
2558 return this->value != data;
2559 }
2560 constexpr bool operator<(FeedbackSensorSourceValue data) const
2561 {
2562 return this->value < data.value;
2563 }
2564 constexpr bool operator<(int data) const
2565 {
2566 return this->value < data;
2567 }
2568
2569 /**
2570 * \brief Gets the string representation of this enum
2571 *
2572 * \returns String representation of this enum
2573 */
2574 std::string ToString() const
2575 {
2576 switch (value)
2577 {
2578 case FeedbackSensorSourceValue::RotorSensor: return "RotorSensor";
2579 case FeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2580 case FeedbackSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
2581 case FeedbackSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
2582 case FeedbackSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
2583 case FeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
2584 case FeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
2585 case FeedbackSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
2586 case FeedbackSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
2587 case FeedbackSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
2588 case FeedbackSensorSourceValue::FusedCANdiPWM1: return "FusedCANdiPWM1";
2589 case FeedbackSensorSourceValue::FusedCANdiPWM2: return "FusedCANdiPWM2";
2590 case FeedbackSensorSourceValue::FusedCANdiQuadrature: return "FusedCANdiQuadrature";
2591 case FeedbackSensorSourceValue::SyncCANdiPWM1: return "SyncCANdiPWM1";
2592 case FeedbackSensorSourceValue::SyncCANdiPWM2: return "SyncCANdiPWM2";
2593 default: return "Invalid Value";
2594 }
2595 }
2596
2597 friend std::ostream &operator<<(std::ostream &os, FeedbackSensorSourceValue data)
2598 {
2599 os << data.ToString();
2600 return os;
2601 }
2602
2603 std::string Serialize() const
2604 {
2605 std::stringstream ss;
2606 ss << "u_" << this->value;
2607 return ss.str();
2608 }
2609};
2610
2611/**
2612 * \brief Determines if the forward limit switch is normally-open (default) or
2613 * normally-closed.
2614 */
2616{
2617public:
2619
2620 static constexpr int NormallyOpen = 0;
2621 static constexpr int NormallyClosed = 1;
2622
2624 value{value}
2625 {}
2626
2628 value{-1}
2629 {}
2630
2631 constexpr bool operator==(ForwardLimitTypeValue data) const
2632 {
2633 return this->value == data.value;
2634 }
2635 constexpr bool operator==(int data) const
2636 {
2637 return this->value == data;
2638 }
2639 constexpr bool operator!=(ForwardLimitTypeValue data) const
2640 {
2641 return this->value != data.value;
2642 }
2643 constexpr bool operator!=(int data) const
2644 {
2645 return this->value != data;
2646 }
2647 constexpr bool operator<(ForwardLimitTypeValue data) const
2648 {
2649 return this->value < data.value;
2650 }
2651 constexpr bool operator<(int data) const
2652 {
2653 return this->value < data;
2654 }
2655
2656 /**
2657 * \brief Gets the string representation of this enum
2658 *
2659 * \returns String representation of this enum
2660 */
2661 std::string ToString() const
2662 {
2663 switch (value)
2664 {
2665 case ForwardLimitTypeValue::NormallyOpen: return "NormallyOpen";
2666 case ForwardLimitTypeValue::NormallyClosed: return "NormallyClosed";
2667 default: return "Invalid Value";
2668 }
2669 }
2670
2671 friend std::ostream &operator<<(std::ostream &os, ForwardLimitTypeValue data)
2672 {
2673 os << data.ToString();
2674 return os;
2675 }
2676
2677 std::string Serialize() const
2678 {
2679 std::stringstream ss;
2680 ss << "u_" << this->value;
2681 return ss.str();
2682 }
2683};
2684
2685/**
2686 * \brief Determines where to poll the forward limit switch. This defaults to
2687 * the forward limit switch pin on the limit switch connector.
2688 *
2689 * Choose RemoteTalonFX to use the forward limit switch attached to
2690 * another Talon FX on the same CAN bus (this also requires setting
2691 * ForwardLimitRemoteSensorID).
2692 *
2693 * Choose RemoteCANifier to use the forward limit switch attached to
2694 * another CANifier on the same CAN bus (this also requires setting
2695 * ForwardLimitRemoteSensorID).
2696 *
2697 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2698 * (this also requires setting ForwardLimitRemoteSensorID). The forward
2699 * limit will assert when the CANcoder magnet strength changes from BAD
2700 * (red) to ADEQUATE (orange) or GOOD (green).
2701 */
2703{
2704public:
2706
2707 /**
2708 * \brief Use the forward limit switch pin on the limit switch connector.
2709 */
2710 static constexpr int LimitSwitchPin = 0;
2711 /**
2712 * \brief Use the forward limit switch attached to another Talon FX on the same
2713 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
2714 */
2715 static constexpr int RemoteTalonFX = 1;
2716 /**
2717 * \brief Use the forward limit switch attached to another CANifier on the same
2718 * CAN bus (this also requires setting ForwardLimitRemoteSensorID).
2719 */
2720 static constexpr int RemoteCANifier = 2;
2721 /**
2722 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2723 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2724 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2725 * or GOOD (green).
2726 */
2727 static constexpr int RemoteCANcoder = 4;
2728 /**
2729 * \brief Use another CANrange on the same CAN bus (this also requires setting
2730 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2731 * CANrange proximity detect is tripped.
2732 */
2733 static constexpr int RemoteCANrange = 6;
2734 /**
2735 * \brief Use another CANdi on the same CAN bus (this also requires setting
2736 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2737 * CANdi Signal 1 Input (S1IN) pin matches the configured closed state.
2738 */
2739 static constexpr int RemoteCANdiS1 = 7;
2740 /**
2741 * \brief Use another CANdi on the same CAN bus (this also requires setting
2742 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2743 * CANdi Signal 2 Input (S2IN) pin matches the configured closed state.
2744 */
2745 static constexpr int RemoteCANdiS2 = 8;
2746 /**
2747 * \brief Disable the forward limit switch.
2748 */
2749 static constexpr int Disabled = 3;
2750
2752 value{value}
2753 {}
2754
2756 value{-1}
2757 {}
2758
2759 constexpr bool operator==(ForwardLimitSourceValue data) const
2760 {
2761 return this->value == data.value;
2762 }
2763 constexpr bool operator==(int data) const
2764 {
2765 return this->value == data;
2766 }
2767 constexpr bool operator!=(ForwardLimitSourceValue data) const
2768 {
2769 return this->value != data.value;
2770 }
2771 constexpr bool operator!=(int data) const
2772 {
2773 return this->value != data;
2774 }
2775 constexpr bool operator<(ForwardLimitSourceValue data) const
2776 {
2777 return this->value < data.value;
2778 }
2779 constexpr bool operator<(int data) const
2780 {
2781 return this->value < data;
2782 }
2783
2784 /**
2785 * \brief Gets the string representation of this enum
2786 *
2787 * \returns String representation of this enum
2788 */
2789 std::string ToString() const
2790 {
2791 switch (value)
2792 {
2793 case ForwardLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2794 case ForwardLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2795 case ForwardLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2796 case ForwardLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2797 case ForwardLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2798 case ForwardLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
2799 case ForwardLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
2800 case ForwardLimitSourceValue::Disabled: return "Disabled";
2801 default: return "Invalid Value";
2802 }
2803 }
2804
2805 friend std::ostream &operator<<(std::ostream &os, ForwardLimitSourceValue data)
2806 {
2807 os << data.ToString();
2808 return os;
2809 }
2810
2811 std::string Serialize() const
2812 {
2813 std::stringstream ss;
2814 ss << "u_" << this->value;
2815 return ss.str();
2816 }
2817};
2818
2819/**
2820 * \brief Determines if the reverse limit switch is normally-open (default) or
2821 * normally-closed.
2822 */
2824{
2825public:
2827
2828 static constexpr int NormallyOpen = 0;
2829 static constexpr int NormallyClosed = 1;
2830
2832 value{value}
2833 {}
2834
2836 value{-1}
2837 {}
2838
2839 constexpr bool operator==(ReverseLimitTypeValue data) const
2840 {
2841 return this->value == data.value;
2842 }
2843 constexpr bool operator==(int data) const
2844 {
2845 return this->value == data;
2846 }
2847 constexpr bool operator!=(ReverseLimitTypeValue data) const
2848 {
2849 return this->value != data.value;
2850 }
2851 constexpr bool operator!=(int data) const
2852 {
2853 return this->value != data;
2854 }
2855 constexpr bool operator<(ReverseLimitTypeValue data) const
2856 {
2857 return this->value < data.value;
2858 }
2859 constexpr bool operator<(int data) const
2860 {
2861 return this->value < data;
2862 }
2863
2864 /**
2865 * \brief Gets the string representation of this enum
2866 *
2867 * \returns String representation of this enum
2868 */
2869 std::string ToString() const
2870 {
2871 switch (value)
2872 {
2873 case ReverseLimitTypeValue::NormallyOpen: return "NormallyOpen";
2874 case ReverseLimitTypeValue::NormallyClosed: return "NormallyClosed";
2875 default: return "Invalid Value";
2876 }
2877 }
2878
2879 friend std::ostream &operator<<(std::ostream &os, ReverseLimitTypeValue data)
2880 {
2881 os << data.ToString();
2882 return os;
2883 }
2884
2885 std::string Serialize() const
2886 {
2887 std::stringstream ss;
2888 ss << "u_" << this->value;
2889 return ss.str();
2890 }
2891};
2892
2893/**
2894 * \brief Determines where to poll the reverse limit switch. This defaults to
2895 * the reverse limit switch pin on the limit switch connector.
2896 *
2897 * Choose RemoteTalonFX to use the reverse limit switch attached to
2898 * another Talon FX on the same CAN bus (this also requires setting
2899 * ReverseLimitRemoteSensorID).
2900 *
2901 * Choose RemoteCANifier to use the reverse limit switch attached to
2902 * another CANifier on the same CAN bus (this also requires setting
2903 * ReverseLimitRemoteSensorID).
2904 *
2905 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2906 * (this also requires setting ReverseLimitRemoteSensorID). The reverse
2907 * limit will assert when the CANcoder magnet strength changes from BAD
2908 * (red) to ADEQUATE (orange) or GOOD (green).
2909 */
2911{
2912public:
2914
2915 /**
2916 * \brief Use the reverse limit switch pin on the limit switch connector.
2917 */
2918 static constexpr int LimitSwitchPin = 0;
2919 /**
2920 * \brief Use the reverse limit switch attached to another Talon FX on the same
2921 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2922 */
2923 static constexpr int RemoteTalonFX = 1;
2924 /**
2925 * \brief Use the reverse limit switch attached to another CANifier on the same
2926 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2927 */
2928 static constexpr int RemoteCANifier = 2;
2929 /**
2930 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2931 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2932 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2933 * or GOOD (green).
2934 */
2935 static constexpr int RemoteCANcoder = 4;
2936 /**
2937 * \brief Use another CANrange on the same CAN bus (this also requires setting
2938 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2939 * CANrange proximity detect is tripped.
2940 */
2941 static constexpr int RemoteCANrange = 6;
2942 /**
2943 * \brief Use another CANdi on the same CAN bus (this also requires setting
2944 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2945 * CANdi Signal 1 Input (S1IN) pin matches the configured closed state.
2946 */
2947 static constexpr int RemoteCANdiS1 = 7;
2948 /**
2949 * \brief Use another CANdi on the same CAN bus (this also requires setting
2950 * ForwardLimitRemoteSensorID). The forward limit will assert when the
2951 * CANdi Signal 2 Input (S2IN) pin matches the configured closed state.
2952 */
2953 static constexpr int RemoteCANdiS2 = 8;
2954 /**
2955 * \brief Disable the reverse limit switch.
2956 */
2957 static constexpr int Disabled = 3;
2958
2960 value{value}
2961 {}
2962
2964 value{-1}
2965 {}
2966
2967 constexpr bool operator==(ReverseLimitSourceValue data) const
2968 {
2969 return this->value == data.value;
2970 }
2971 constexpr bool operator==(int data) const
2972 {
2973 return this->value == data;
2974 }
2975 constexpr bool operator!=(ReverseLimitSourceValue data) const
2976 {
2977 return this->value != data.value;
2978 }
2979 constexpr bool operator!=(int data) const
2980 {
2981 return this->value != data;
2982 }
2983 constexpr bool operator<(ReverseLimitSourceValue data) const
2984 {
2985 return this->value < data.value;
2986 }
2987 constexpr bool operator<(int data) const
2988 {
2989 return this->value < data;
2990 }
2991
2992 /**
2993 * \brief Gets the string representation of this enum
2994 *
2995 * \returns String representation of this enum
2996 */
2997 std::string ToString() const
2998 {
2999 switch (value)
3000 {
3001 case ReverseLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
3002 case ReverseLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
3003 case ReverseLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
3004 case ReverseLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3005 case ReverseLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
3006 case ReverseLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
3007 case ReverseLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
3008 case ReverseLimitSourceValue::Disabled: return "Disabled";
3009 default: return "Invalid Value";
3010 }
3011 }
3012
3013 friend std::ostream &operator<<(std::ostream &os, ReverseLimitSourceValue data)
3014 {
3015 os << data.ToString();
3016 return os;
3017 }
3018
3019 std::string Serialize() const
3020 {
3021 std::stringstream ss;
3022 ss << "u_" << this->value;
3023 return ss.str();
3024 }
3025};
3026
3027/**
3028 * \brief Magnet health as measured by CANcoder.
3029 *
3030 * Red indicates too close or too far, Orange is adequate but with
3031 * reduced accuracy, green is ideal. Invalid means the accuracy cannot be
3032 * determined.
3033 */
3035{
3036public:
3038
3039 /**
3040 * \brief The magnet is too close or too far from the CANcoder.
3041 */
3042 static constexpr int Magnet_Red = 1;
3043 /**
3044 * \brief Magnet health is adequate but with reduced accuracy.
3045 */
3046 static constexpr int Magnet_Orange = 2;
3047 /**
3048 * \brief Magnet health is ideal.
3049 */
3050 static constexpr int Magnet_Green = 3;
3051 /**
3052 * \brief The accuracy cannot be determined.
3053 */
3054 static constexpr int Magnet_Invalid = 0;
3055
3056 constexpr MagnetHealthValue(int value) :
3057 value{value}
3058 {}
3059
3060 constexpr MagnetHealthValue() :
3061 value{-1}
3062 {}
3063
3064 constexpr bool operator==(MagnetHealthValue data) const
3065 {
3066 return this->value == data.value;
3067 }
3068 constexpr bool operator==(int data) const
3069 {
3070 return this->value == data;
3071 }
3072 constexpr bool operator!=(MagnetHealthValue data) const
3073 {
3074 return this->value != data.value;
3075 }
3076 constexpr bool operator!=(int data) const
3077 {
3078 return this->value != data;
3079 }
3080 constexpr bool operator<(MagnetHealthValue data) const
3081 {
3082 return this->value < data.value;
3083 }
3084 constexpr bool operator<(int data) const
3085 {
3086 return this->value < data;
3087 }
3088
3089 /**
3090 * \brief Gets the string representation of this enum
3091 *
3092 * \returns String representation of this enum
3093 */
3094 std::string ToString() const
3095 {
3096 switch (value)
3097 {
3098 case MagnetHealthValue::Magnet_Red: return "Magnet_Red";
3099 case MagnetHealthValue::Magnet_Orange: return "Magnet_Orange";
3100 case MagnetHealthValue::Magnet_Green: return "Magnet_Green";
3101 case MagnetHealthValue::Magnet_Invalid: return "Magnet_Invalid";
3102 default: return "Invalid Value";
3103 }
3104 }
3105
3106 friend std::ostream &operator<<(std::ostream &os, MagnetHealthValue data)
3107 {
3108 os << data.ToString();
3109 return os;
3110 }
3111
3112 std::string Serialize() const
3113 {
3114 std::stringstream ss;
3115 ss << "u_" << this->value;
3116 return ss.str();
3117 }
3118};
3119
3120/**
3121 * \brief The applied output of the bridge.
3122 */
3124{
3125public:
3127
3128 static constexpr int BridgeReq_Coast = 0;
3129 static constexpr int BridgeReq_Brake = 1;
3130 static constexpr int BridgeReq_Trapez = 6;
3131 static constexpr int BridgeReq_FOCTorque = 7;
3132 static constexpr int BridgeReq_MusicTone = 8;
3133 static constexpr int BridgeReq_FOCEasy = 9;
3134 static constexpr int BridgeReq_FaultBrake = 12;
3135 static constexpr int BridgeReq_FaultCoast = 13;
3136 static constexpr int BridgeReq_ActiveBrake = 14;
3137 static constexpr int BridgeReq_VariableBrake = 15;
3138
3139 constexpr BridgeOutputValue(int value) :
3140 value{value}
3141 {}
3142
3143 constexpr BridgeOutputValue() :
3144 value{-1}
3145 {}
3146
3147 constexpr bool operator==(BridgeOutputValue data) const
3148 {
3149 return this->value == data.value;
3150 }
3151 constexpr bool operator==(int data) const
3152 {
3153 return this->value == data;
3154 }
3155 constexpr bool operator!=(BridgeOutputValue data) const
3156 {
3157 return this->value != data.value;
3158 }
3159 constexpr bool operator!=(int data) const
3160 {
3161 return this->value != data;
3162 }
3163 constexpr bool operator<(BridgeOutputValue data) const
3164 {
3165 return this->value < data.value;
3166 }
3167 constexpr bool operator<(int data) const
3168 {
3169 return this->value < data;
3170 }
3171
3172 /**
3173 * \brief Gets the string representation of this enum
3174 *
3175 * \returns String representation of this enum
3176 */
3177 std::string ToString() const
3178 {
3179 switch (value)
3180 {
3181 case BridgeOutputValue::BridgeReq_Coast: return "BridgeReq_Coast";
3182 case BridgeOutputValue::BridgeReq_Brake: return "BridgeReq_Brake";
3183 case BridgeOutputValue::BridgeReq_Trapez: return "BridgeReq_Trapez";
3184 case BridgeOutputValue::BridgeReq_FOCTorque: return "BridgeReq_FOCTorque";
3185 case BridgeOutputValue::BridgeReq_MusicTone: return "BridgeReq_MusicTone";
3186 case BridgeOutputValue::BridgeReq_FOCEasy: return "BridgeReq_FOCEasy";
3187 case BridgeOutputValue::BridgeReq_FaultBrake: return "BridgeReq_FaultBrake";
3188 case BridgeOutputValue::BridgeReq_FaultCoast: return "BridgeReq_FaultCoast";
3189 case BridgeOutputValue::BridgeReq_ActiveBrake: return "BridgeReq_ActiveBrake";
3190 case BridgeOutputValue::BridgeReq_VariableBrake: return "BridgeReq_VariableBrake";
3191 default: return "Invalid Value";
3192 }
3193 }
3194
3195 friend std::ostream &operator<<(std::ostream &os, BridgeOutputValue data)
3196 {
3197 os << data.ToString();
3198 return os;
3199 }
3200
3201 std::string Serialize() const
3202 {
3203 std::stringstream ss;
3204 ss << "u_" << this->value;
3205 return ss.str();
3206 }
3207};
3208
3209/**
3210 * \brief Choose what sensor source is used for differential control of a
3211 * mechanism. The default is Disabled. All other options require
3212 * setting the DifferentialTalonFXSensorID, as the average of this Talon
3213 * FX's sensor and the remote TalonFX's sensor is used for the
3214 * differential controller's primary targets.
3215 *
3216 * Choose RemoteTalonFX_Diff to use another TalonFX on the same CAN bus.
3217 * Talon FX will update its differential position and velocity whenever
3218 * the remote TalonFX publishes its information on CAN bus. The
3219 * differential controller will use the difference between this TalonFX's
3220 * sensor and the remote Talon FX's sensor for the differential component
3221 * of the output.
3222 *
3223 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
3224 * to use another Pigeon2 on the same CAN bus (this also requires setting
3225 * DifferentialRemoteSensorID). Talon FX will update its differential
3226 * position to match the selected value whenever Pigeon2 publishes its
3227 * information on CAN bus. Note that the Talon FX differential position
3228 * will be in rotations and not degrees.
3229 *
3230 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
3231 * (this also requires setting DifferentialRemoteSensorID). Talon FX
3232 * will update its differential position and velocity to match the
3233 * CANcoder whenever CANcoder publishes its information on CAN bus.
3234 */
3236{
3237public:
3239
3240 /**
3241 * \brief Disable differential control.
3242 */
3243 static constexpr int Disabled = 0;
3244 /**
3245 * \brief Use another TalonFX on the same CAN bus. Talon FX will update its
3246 * differential position and velocity whenever the remote TalonFX
3247 * publishes its information on CAN bus. The differential controller
3248 * will use the difference between this TalonFX's sensor and the remote
3249 * Talon FX's sensor for the differential component of the output.
3250 */
3251 static constexpr int RemoteTalonFX_Diff = 1;
3252 /**
3253 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3254 * DifferentialRemoteSensorID). Talon FX will update its differential
3255 * position to match the Pigeon2 yaw whenever Pigeon2 publishes its
3256 * information on CAN bus. Note that the Talon FX differential position
3257 * will be in rotations and not degrees.
3258 */
3259 static constexpr int RemotePigeon2_Yaw = 2;
3260 /**
3261 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3262 * DifferentialRemoteSensorID). Talon FX will update its differential
3263 * position to match the Pigeon2 pitch whenever Pigeon2 publishes its
3264 * information on CAN bus. Note that the Talon FX differential position
3265 * will be in rotations and not degrees.
3266 */
3267 static constexpr int RemotePigeon2_Pitch = 3;
3268 /**
3269 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3270 * DifferentialRemoteSensorID). Talon FX will update its differential
3271 * position to match the Pigeon2 roll whenever Pigeon2 publishes its
3272 * information on CAN bus. Note that the Talon FX differential position
3273 * will be in rotations and not degrees.
3274 */
3275 static constexpr int RemotePigeon2_Roll = 4;
3276 /**
3277 * \brief Use another CANcoder on the same CAN bus (this also requires setting
3278 * DifferentialRemoteSensorID). Talon FX will update its differential
3279 * position and velocity to match the CANcoder whenever CANcoder
3280 * publishes its information on CAN bus.
3281 */
3282 static constexpr int RemoteCANcoder = 5;
3283
3285 value{value}
3286 {}
3287
3289 value{-1}
3290 {}
3291
3293 {
3294 return this->value == data.value;
3295 }
3296 constexpr bool operator==(int data) const
3297 {
3298 return this->value == data;
3299 }
3301 {
3302 return this->value != data.value;
3303 }
3304 constexpr bool operator!=(int data) const
3305 {
3306 return this->value != data;
3307 }
3308 constexpr bool operator<(DifferentialSensorSourceValue data) const
3309 {
3310 return this->value < data.value;
3311 }
3312 constexpr bool operator<(int data) const
3313 {
3314 return this->value < data;
3315 }
3316
3317 /**
3318 * \brief Gets the string representation of this enum
3319 *
3320 * \returns String representation of this enum
3321 */
3322 std::string ToString() const
3323 {
3324 switch (value)
3325 {
3326 case DifferentialSensorSourceValue::Disabled: return "Disabled";
3327 case DifferentialSensorSourceValue::RemoteTalonFX_Diff: return "RemoteTalonFX_Diff";
3328 case DifferentialSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
3329 case DifferentialSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
3330 case DifferentialSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
3331 case DifferentialSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3332 default: return "Invalid Value";
3333 }
3334 }
3335
3336 friend std::ostream &operator<<(std::ostream &os, DifferentialSensorSourceValue data)
3337 {
3338 os << data.ToString();
3339 return os;
3340 }
3341
3342 std::string Serialize() const
3343 {
3344 std::stringstream ss;
3345 ss << "u_" << this->value;
3346 return ss.str();
3347 }
3348};
3349
3350/**
3351 * \brief Static Feedforward Sign during position closed loop.
3352 *
3353 * This determines the sign of the applied kS during position closed-loop
3354 * modes. The default behavior uses the velocity reference sign. This
3355 * works well with velocity closed loop, Motion Magic® controls, and
3356 * position closed loop when velocity reference is specified (motion
3357 * profiling).
3358 *
3359 * However, when using position closed loop with zero velocity reference
3360 * (no motion profiling), the application may want to apply static
3361 * feedforward based on the sign of closed loop error instead. When doing
3362 * so, we recommend using the minimal amount of kS, otherwise the motor
3363 * output may dither when closed loop error is near zero.
3364 */
3366{
3367public:
3369
3370 /**
3371 * \brief Use the velocity reference sign. This works well with velocity closed
3372 * loop, Motion Magic® controls, and position closed loop when velocity
3373 * reference is specified (motion profiling).
3374 */
3375 static constexpr int UseVelocitySign = 0;
3376 /**
3377 * \brief Use the sign of closed loop error. This is useful when using position
3378 * closed loop with zero velocity reference (no motion profiling). We
3379 * recommend the minimal amount of kS, otherwise the motor output may
3380 * dither when closed loop error is near zero.
3381 */
3382 static constexpr int UseClosedLoopSign = 1;
3383
3385 value{value}
3386 {}
3387
3389 value{-1}
3390 {}
3391
3392 constexpr bool operator==(StaticFeedforwardSignValue data) const
3393 {
3394 return this->value == data.value;
3395 }
3396 constexpr bool operator==(int data) const
3397 {
3398 return this->value == data;
3399 }
3400 constexpr bool operator!=(StaticFeedforwardSignValue data) const
3401 {
3402 return this->value != data.value;
3403 }
3404 constexpr bool operator!=(int data) const
3405 {
3406 return this->value != data;
3407 }
3408 constexpr bool operator<(StaticFeedforwardSignValue data) const
3409 {
3410 return this->value < data.value;
3411 }
3412 constexpr bool operator<(int data) const
3413 {
3414 return this->value < data;
3415 }
3416
3417 /**
3418 * \brief Gets the string representation of this enum
3419 *
3420 * \returns String representation of this enum
3421 */
3422 std::string ToString() const
3423 {
3424 switch (value)
3425 {
3426 case StaticFeedforwardSignValue::UseVelocitySign: return "UseVelocitySign";
3427 case StaticFeedforwardSignValue::UseClosedLoopSign: return "UseClosedLoopSign";
3428 default: return "Invalid Value";
3429 }
3430 }
3431
3432 friend std::ostream &operator<<(std::ostream &os, StaticFeedforwardSignValue data)
3433 {
3434 os << data.ToString();
3435 return os;
3436 }
3437
3438 std::string Serialize() const
3439 {
3440 std::stringstream ss;
3441 ss << "u_" << this->value;
3442 return ss.str();
3443 }
3444};
3445
3446/**
3447 * \brief The type of motor attached to the Talon.
3448 *
3449 * \details This can be used to determine what motor is attached to the Talon
3450 * FX. Return will be "Unknown" if firmware is too old or device is
3451 * not present.
3452 */
3454{
3455public:
3457
3458 /**
3459 * \brief Talon could not determine the type of motor attached.
3460 */
3461 static constexpr int Unknown = 0;
3462 /**
3463 * \brief Talon is attached to an integrated Falcon motor.
3464 */
3465 static constexpr int Falcon500_Integrated = 1;
3466 /**
3467 * \brief Talon is attached to an integrated Kraken X60 motor.
3468 */
3469 static constexpr int KrakenX60_Integrated = 2;
3470 /**
3471 * \brief Talon is attached to an integrated Kraken X44 motor.
3472 */
3473 static constexpr int KrakenX44_Integrated = 3;
3474 /**
3475 * \brief Talon is connected to a CTR Electronics Minion® brushless three phase
3476 * motor.
3477 */
3478 static constexpr int Minion_JST = 4;
3479 /**
3480 * \brief Talon is connected to a third party brushed DC motor with leads A and
3481 * B.
3482 */
3483 static constexpr int Brushed_AB = 5;
3484 /**
3485 * \brief Talon is connected to a third party brushed DC motor with leads A and
3486 * C.
3487 */
3488 static constexpr int Brushed_AC = 6;
3489 /**
3490 * \brief Talon is connected to a third party brushed DC motor with leads B and
3491 * C.
3492 */
3493 static constexpr int Brushed_BC = 7;
3494 /**
3495 * \brief Talon is connected to a third party NEO brushless three phase motor.
3496 */
3497 static constexpr int NEO_JST = 8;
3498 /**
3499 * \brief Talon is connected to a third party NEO550 brushless three phase
3500 * motor.
3501 */
3502 static constexpr int NEO550_JST = 9;
3503 /**
3504 * \brief Talon is connected to a third party VORTEX brushless three phase
3505 * motor.
3506 */
3507 static constexpr int VORTEX_JST = 10;
3508
3510 value{value}
3511 {}
3512
3514 value{-1}
3515 {}
3516
3517 constexpr bool operator==(ConnectedMotorValue data) const
3518 {
3519 return this->value == data.value;
3520 }
3521 constexpr bool operator==(int data) const
3522 {
3523 return this->value == data;
3524 }
3525 constexpr bool operator!=(ConnectedMotorValue data) const
3526 {
3527 return this->value != data.value;
3528 }
3529 constexpr bool operator!=(int data) const
3530 {
3531 return this->value != data;
3532 }
3533 constexpr bool operator<(ConnectedMotorValue data) const
3534 {
3535 return this->value < data.value;
3536 }
3537 constexpr bool operator<(int data) const
3538 {
3539 return this->value < data;
3540 }
3541
3542 /**
3543 * \brief Gets the string representation of this enum
3544 *
3545 * \returns String representation of this enum
3546 */
3547 std::string ToString() const
3548 {
3549 switch (value)
3550 {
3551 case ConnectedMotorValue::Unknown: return "Unknown";
3552 case ConnectedMotorValue::Falcon500_Integrated: return "Falcon500_Integrated";
3553 case ConnectedMotorValue::KrakenX60_Integrated: return "KrakenX60_Integrated";
3554 case ConnectedMotorValue::KrakenX44_Integrated: return "KrakenX44_Integrated";
3555 case ConnectedMotorValue::Minion_JST: return "Minion_JST";
3556 case ConnectedMotorValue::Brushed_AB: return "Brushed_AB";
3557 case ConnectedMotorValue::Brushed_AC: return "Brushed_AC";
3558 case ConnectedMotorValue::Brushed_BC: return "Brushed_BC";
3559 case ConnectedMotorValue::NEO_JST: return "NEO_JST";
3560 case ConnectedMotorValue::NEO550_JST: return "NEO550_JST";
3561 case ConnectedMotorValue::VORTEX_JST: return "VORTEX_JST";
3562 default: return "Invalid Value";
3563 }
3564 }
3565
3566 friend std::ostream &operator<<(std::ostream &os, ConnectedMotorValue data)
3567 {
3568 os << data.ToString();
3569 return os;
3570 }
3571
3572 std::string Serialize() const
3573 {
3574 std::stringstream ss;
3575 ss << "u_" << this->value;
3576 return ss.str();
3577 }
3578};
3579
3580/**
3581 * \brief Health of the distance measurement.
3582 */
3584{
3585public:
3587
3588 /**
3589 * \brief Measurement is good.
3590 */
3591 static constexpr int Good = 0;
3592 /**
3593 * \brief Measurement is likely okay, but the target is either very far away or
3594 * moving very quickly.
3595 */
3596 static constexpr int Limited = 1;
3597 /**
3598 * \brief Measurement is compromised.
3599 */
3600 static constexpr int Bad = 2;
3601
3603 value{value}
3604 {}
3605
3607 value{-1}
3608 {}
3609
3610 constexpr bool operator==(MeasurementHealthValue data) const
3611 {
3612 return this->value == data.value;
3613 }
3614 constexpr bool operator==(int data) const
3615 {
3616 return this->value == data;
3617 }
3618 constexpr bool operator!=(MeasurementHealthValue data) const
3619 {
3620 return this->value != data.value;
3621 }
3622 constexpr bool operator!=(int data) const
3623 {
3624 return this->value != data;
3625 }
3626 constexpr bool operator<(MeasurementHealthValue data) const
3627 {
3628 return this->value < data.value;
3629 }
3630 constexpr bool operator<(int data) const
3631 {
3632 return this->value < data;
3633 }
3634
3635 /**
3636 * \brief Gets the string representation of this enum
3637 *
3638 * \returns String representation of this enum
3639 */
3640 std::string ToString() const
3641 {
3642 switch (value)
3643 {
3644 case MeasurementHealthValue::Good: return "Good";
3645 case MeasurementHealthValue::Limited: return "Limited";
3646 case MeasurementHealthValue::Bad: return "Bad";
3647 default: return "Invalid Value";
3648 }
3649 }
3650
3651 friend std::ostream &operator<<(std::ostream &os, MeasurementHealthValue data)
3652 {
3653 os << data.ToString();
3654 return os;
3655 }
3656
3657 std::string Serialize() const
3658 {
3659 std::stringstream ss;
3660 ss << "u_" << this->value;
3661 return ss.str();
3662 }
3663};
3664
3665/**
3666 * \brief Update mode of the CANrange. The CANrange supports short-range and
3667 * long-range detection at various update frequencies.
3668 */
3670{
3671public:
3673
3674 /**
3675 * \brief Updates distance/proximity at 100hz using short-range detection mode.
3676 */
3677 static constexpr int ShortRange100Hz = 0;
3678 /**
3679 * \brief Uses short-range detection mode for improved detection under high
3680 * ambient infrared light conditions. Uses user-specified update
3681 * frequency.
3682 */
3683 static constexpr int ShortRangeUserFreq = 1;
3684 /**
3685 * \brief Uses long-range detection mode and user-specified update frequency.
3686 */
3687 static constexpr int LongRangeUserFreq = 2;
3688
3689 constexpr UpdateModeValue(int value) :
3690 value{value}
3691 {}
3692
3693 constexpr UpdateModeValue() :
3694 value{-1}
3695 {}
3696
3697 constexpr bool operator==(UpdateModeValue data) const
3698 {
3699 return this->value == data.value;
3700 }
3701 constexpr bool operator==(int data) const
3702 {
3703 return this->value == data;
3704 }
3705 constexpr bool operator!=(UpdateModeValue data) const
3706 {
3707 return this->value != data.value;
3708 }
3709 constexpr bool operator!=(int data) const
3710 {
3711 return this->value != data;
3712 }
3713 constexpr bool operator<(UpdateModeValue data) const
3714 {
3715 return this->value < data.value;
3716 }
3717 constexpr bool operator<(int data) const
3718 {
3719 return this->value < data;
3720 }
3721
3722 /**
3723 * \brief Gets the string representation of this enum
3724 *
3725 * \returns String representation of this enum
3726 */
3727 std::string ToString() const
3728 {
3729 switch (value)
3730 {
3731 case UpdateModeValue::ShortRange100Hz: return "ShortRange100Hz";
3732 case UpdateModeValue::ShortRangeUserFreq: return "ShortRangeUserFreq";
3733 case UpdateModeValue::LongRangeUserFreq: return "LongRangeUserFreq";
3734 default: return "Invalid Value";
3735 }
3736 }
3737
3738 friend std::ostream &operator<<(std::ostream &os, UpdateModeValue data)
3739 {
3740 os << data.ToString();
3741 return os;
3742 }
3743
3744 std::string Serialize() const
3745 {
3746 std::stringstream ss;
3747 ss << "u_" << this->value;
3748 return ss.str();
3749 }
3750};
3751
3752/**
3753 * \brief Requires Phoenix Pro; Improves commutation and velocity measurement
3754 * for motors with hall sensors. Talon can use advanced features to
3755 * improve commutation and velocity measurement when using a motor with
3756 * hall sensors. This can improve peak efficiency by as high as 2% and
3757 * reduce noise in the measured velocity.
3758 */
3760{
3761public:
3763
3764 /**
3765 * \brief Talon will utilize hall sensors without advanced features.
3766 */
3767 static constexpr int Disabled = 0;
3768 /**
3769 * \brief Requires Phoenix Pro; Talon uses advanced features to improve
3770 * commutation and velocity measurement when using hall sensors. This
3771 * can improve peak efficiency by as high as 2% and reduce noise in the
3772 * measured velocity.
3773 */
3774 static constexpr int Enabled = 1;
3775
3777 value{value}
3778 {}
3779
3781 value{-1}
3782 {}
3783
3784 constexpr bool operator==(AdvancedHallSupportValue data) const
3785 {
3786 return this->value == data.value;
3787 }
3788 constexpr bool operator==(int data) const
3789 {
3790 return this->value == data;
3791 }
3792 constexpr bool operator!=(AdvancedHallSupportValue data) const
3793 {
3794 return this->value != data.value;
3795 }
3796 constexpr bool operator!=(int data) const
3797 {
3798 return this->value != data;
3799 }
3800 constexpr bool operator<(AdvancedHallSupportValue data) const
3801 {
3802 return this->value < data.value;
3803 }
3804 constexpr bool operator<(int data) const
3805 {
3806 return this->value < data;
3807 }
3808
3809 /**
3810 * \brief Gets the string representation of this enum
3811 *
3812 * \returns String representation of this enum
3813 */
3814 std::string ToString() const
3815 {
3816 switch (value)
3817 {
3818 case AdvancedHallSupportValue::Disabled: return "Disabled";
3819 case AdvancedHallSupportValue::Enabled: return "Enabled";
3820 default: return "Invalid Value";
3821 }
3822 }
3823
3824 friend std::ostream &operator<<(std::ostream &os, AdvancedHallSupportValue data)
3825 {
3826 os << data.ToString();
3827 return os;
3828 }
3829
3830 std::string Serialize() const
3831 {
3832 std::stringstream ss;
3833 ss << "u_" << this->value;
3834 return ss.str();
3835 }
3836};
3837
3838/**
3839 * \brief Selects the motor and motor connections used with Talon.
3840 *
3841 * This setting determines what kind of motor and sensors are used with
3842 * the Talon. This also determines what signals are used on the JST and
3843 * Gadgeteer port.
3844 *
3845 * Motor drive will not function correctly if this setting does not match
3846 * the physical setup.
3847 */
3849{
3850public:
3852
3853 /**
3854 * \brief Motor is not selected. This is the default setting to ensure the user
3855 * has an opportunity to select the correct motor arrangement before
3856 * attempting to drive motor.
3857 */
3858 static constexpr int Disabled = 0;
3859 /**
3860 * \brief CTR Electronics Minion® brushless three phase motor.
3861 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3862 * C).
3863 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3864 * on pin [5]. Motor JST cable can be plugged directly into the JST
3865 * connector.
3866 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3867 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3868 * pin [9].
3869 */
3870 static constexpr int Minion_JST = 1;
3871 /**
3872 * \brief Third party brushed DC motor with two leads.
3873 * Use the Brushed Motor Wiring config to determine which leads to use on
3874 * the Talon (motor leads may be flipped to correct for clockwise vs
3875 * counterclockwise).
3876 * Note that the invert configuration can still be used to invert rotor
3877 * orientation.
3878 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3879 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3880 * pin [9].
3881 */
3882 static constexpr int Brushed_DC = 2;
3883 /**
3884 * \brief Third party NEO brushless three phase motor (~6000 RPM at 12V).
3885 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3886 * C).
3887 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3888 * on pin [5]. Motor JST cable can be plugged directly into the JST
3889 * connector.
3890 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3891 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3892 * pin [9].
3893 */
3894 static constexpr int NEO_JST = 5;
3895 /**
3896 * \brief Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
3897 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3898 * C).
3899 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3900 * on pin [5]. Motor JST cable can be plugged directly into the JST
3901 * connector.
3902 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3903 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3904 * pin [9].
3905 */
3906 static constexpr int NEO550_JST = 6;
3907 /**
3908 * \brief Third party VORTEX brushless three phase motor.
3909 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3910 * C).
3911 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3912 * on pin [5]. Motor JST cable can be plugged directly into the JST
3913 * connector.
3914 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3915 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3916 * pin [9].
3917 */
3918 static constexpr int VORTEX_JST = 7;
3919
3921 value{value}
3922 {}
3923
3925 value{-1}
3926 {}
3927
3928 constexpr bool operator==(MotorArrangementValue data) const
3929 {
3930 return this->value == data.value;
3931 }
3932 constexpr bool operator==(int data) const
3933 {
3934 return this->value == data;
3935 }
3936 constexpr bool operator!=(MotorArrangementValue data) const
3937 {
3938 return this->value != data.value;
3939 }
3940 constexpr bool operator!=(int data) const
3941 {
3942 return this->value != data;
3943 }
3944 constexpr bool operator<(MotorArrangementValue data) const
3945 {
3946 return this->value < data.value;
3947 }
3948 constexpr bool operator<(int data) const
3949 {
3950 return this->value < data;
3951 }
3952
3953 /**
3954 * \brief Gets the string representation of this enum
3955 *
3956 * \returns String representation of this enum
3957 */
3958 std::string ToString() const
3959 {
3960 switch (value)
3961 {
3962 case MotorArrangementValue::Disabled: return "Disabled";
3963 case MotorArrangementValue::Minion_JST: return "Minion_JST";
3964 case MotorArrangementValue::Brushed_DC: return "Brushed_DC";
3965 case MotorArrangementValue::NEO_JST: return "NEO_JST";
3966 case MotorArrangementValue::NEO550_JST: return "NEO550_JST";
3967 case MotorArrangementValue::VORTEX_JST: return "VORTEX_JST";
3968 default: return "Invalid Value";
3969 }
3970 }
3971
3972 friend std::ostream &operator<<(std::ostream &os, MotorArrangementValue data)
3973 {
3974 os << data.ToString();
3975 return os;
3976 }
3977
3978 std::string Serialize() const
3979 {
3980 std::stringstream ss;
3981 ss << "u_" << this->value;
3982 return ss.str();
3983 }
3984};
3985
3986/**
3987 * \brief State of the Signal 1 input (S1IN).
3988 */
3990{
3991public:
3993
3994 /**
3995 * \brief Input is not driven high or low, it is disconnected from load.
3996 */
3997 static constexpr int Floating = 0;
3998 /**
3999 * \brief Input is driven low (below 0.5V).
4000 */
4001 static constexpr int Low = 1;
4002 /**
4003 * \brief Input is driven high (above 3V).
4004 */
4005 static constexpr int High = 2;
4006
4007 constexpr S1StateValue(int value) :
4008 value{value}
4009 {}
4010
4011 constexpr S1StateValue() :
4012 value{-1}
4013 {}
4014
4015 constexpr bool operator==(S1StateValue data) const
4016 {
4017 return this->value == data.value;
4018 }
4019 constexpr bool operator==(int data) const
4020 {
4021 return this->value == data;
4022 }
4023 constexpr bool operator!=(S1StateValue data) const
4024 {
4025 return this->value != data.value;
4026 }
4027 constexpr bool operator!=(int data) const
4028 {
4029 return this->value != data;
4030 }
4031 constexpr bool operator<(S1StateValue data) const
4032 {
4033 return this->value < data.value;
4034 }
4035 constexpr bool operator<(int data) const
4036 {
4037 return this->value < data;
4038 }
4039
4040 /**
4041 * \brief Gets the string representation of this enum
4042 *
4043 * \returns String representation of this enum
4044 */
4045 std::string ToString() const
4046 {
4047 switch (value)
4048 {
4049 case S1StateValue::Floating: return "Floating";
4050 case S1StateValue::Low: return "Low";
4051 case S1StateValue::High: return "High";
4052 default: return "Invalid Value";
4053 }
4054 }
4055
4056 friend std::ostream &operator<<(std::ostream &os, S1StateValue data)
4057 {
4058 os << data.ToString();
4059 return os;
4060 }
4061
4062 std::string Serialize() const
4063 {
4064 std::stringstream ss;
4065 ss << "u_" << this->value;
4066 return ss.str();
4067 }
4068};
4069
4070/**
4071 * \brief State of the Signal 2 input (S2IN).
4072 */
4074{
4075public:
4077
4078 /**
4079 * \brief Input is not driven high or low, it is disconnected from load.
4080 */
4081 static constexpr int Floating = 0;
4082 /**
4083 * \brief Input is driven low (below 0.5V).
4084 */
4085 static constexpr int Low = 1;
4086 /**
4087 * \brief Input is driven high (above 3V).
4088 */
4089 static constexpr int High = 2;
4090
4091 constexpr S2StateValue(int value) :
4092 value{value}
4093 {}
4094
4095 constexpr S2StateValue() :
4096 value{-1}
4097 {}
4098
4099 constexpr bool operator==(S2StateValue data) const
4100 {
4101 return this->value == data.value;
4102 }
4103 constexpr bool operator==(int data) const
4104 {
4105 return this->value == data;
4106 }
4107 constexpr bool operator!=(S2StateValue data) const
4108 {
4109 return this->value != data.value;
4110 }
4111 constexpr bool operator!=(int data) const
4112 {
4113 return this->value != data;
4114 }
4115 constexpr bool operator<(S2StateValue data) const
4116 {
4117 return this->value < data.value;
4118 }
4119 constexpr bool operator<(int data) const
4120 {
4121 return this->value < data;
4122 }
4123
4124 /**
4125 * \brief Gets the string representation of this enum
4126 *
4127 * \returns String representation of this enum
4128 */
4129 std::string ToString() const
4130 {
4131 switch (value)
4132 {
4133 case S2StateValue::Floating: return "Floating";
4134 case S2StateValue::Low: return "Low";
4135 case S2StateValue::High: return "High";
4136 default: return "Invalid Value";
4137 }
4138 }
4139
4140 friend std::ostream &operator<<(std::ostream &os, S2StateValue data)
4141 {
4142 os << data.ToString();
4143 return os;
4144 }
4145
4146 std::string Serialize() const
4147 {
4148 std::stringstream ss;
4149 ss << "u_" << this->value;
4150 return ss.str();
4151 }
4152};
4153
4154/**
4155 * \brief The floating state of the Signal 1 input (S1IN).
4156 */
4158{
4159public:
4161
4162 /**
4163 * \brief The input will attempt to detect when it is floating. This is enabled
4164 * by default.
4165 */
4166 static constexpr int FloatDetect = 0;
4167 /**
4168 * \brief The input will be pulled high when not loaded by an outside device.
4169 * This is useful for NPN-style devices.
4170 */
4171 static constexpr int PullHigh = 1;
4172 /**
4173 * \brief The input will be pulled low when not loaded by an outside device.
4174 * This is useful for PNP-style devices.
4175 */
4176 static constexpr int PullLow = 2;
4177 /**
4178 * \brief The input will pull in the direction of the last measured state. This
4179 * may be useful for devices that can enter into a high-Z tri-state.
4180 */
4181 static constexpr int BusKeeper = 3;
4182
4183 constexpr S1FloatStateValue(int value) :
4184 value{value}
4185 {}
4186
4187 constexpr S1FloatStateValue() :
4188 value{-1}
4189 {}
4190
4191 constexpr bool operator==(S1FloatStateValue data) const
4192 {
4193 return this->value == data.value;
4194 }
4195 constexpr bool operator==(int data) const
4196 {
4197 return this->value == data;
4198 }
4199 constexpr bool operator!=(S1FloatStateValue data) const
4200 {
4201 return this->value != data.value;
4202 }
4203 constexpr bool operator!=(int data) const
4204 {
4205 return this->value != data;
4206 }
4207 constexpr bool operator<(S1FloatStateValue data) const
4208 {
4209 return this->value < data.value;
4210 }
4211 constexpr bool operator<(int data) const
4212 {
4213 return this->value < data;
4214 }
4215
4216 /**
4217 * \brief Gets the string representation of this enum
4218 *
4219 * \returns String representation of this enum
4220 */
4221 std::string ToString() const
4222 {
4223 switch (value)
4224 {
4225 case S1FloatStateValue::FloatDetect: return "Float Detect";
4226 case S1FloatStateValue::PullHigh: return "Pull High";
4227 case S1FloatStateValue::PullLow: return "Pull Low";
4228 case S1FloatStateValue::BusKeeper: return "Bus Keeper";
4229 default: return "Invalid Value";
4230 }
4231 }
4232
4233 friend std::ostream &operator<<(std::ostream &os, S1FloatStateValue data)
4234 {
4235 os << data.ToString();
4236 return os;
4237 }
4238
4239 std::string Serialize() const
4240 {
4241 std::stringstream ss;
4242 ss << "u_" << this->value;
4243 return ss.str();
4244 }
4245};
4246
4247/**
4248 * \brief The floating state of the Signal 2 input (S2IN).
4249 */
4251{
4252public:
4254
4255 /**
4256 * \brief The input will attempt to detect when it is floating. This is enabled
4257 * by default.
4258 */
4259 static constexpr int FloatDetect = 0;
4260 /**
4261 * \brief The input will be pulled high when not loaded by an outside device.
4262 * This is useful for NPN-style devices.
4263 */
4264 static constexpr int PullHigh = 1;
4265 /**
4266 * \brief The input will be pulled low when not loaded by an outside device.
4267 * This is useful for PNP-style devices.
4268 */
4269 static constexpr int PullLow = 2;
4270 /**
4271 * \brief The input will pull in the direction of the last measured state. This
4272 * may be useful for devices that can enter into a high-Z tri-state.
4273 */
4274 static constexpr int BusKeeper = 3;
4275
4276 constexpr S2FloatStateValue(int value) :
4277 value{value}
4278 {}
4279
4280 constexpr S2FloatStateValue() :
4281 value{-1}
4282 {}
4283
4284 constexpr bool operator==(S2FloatStateValue data) const
4285 {
4286 return this->value == data.value;
4287 }
4288 constexpr bool operator==(int data) const
4289 {
4290 return this->value == data;
4291 }
4292 constexpr bool operator!=(S2FloatStateValue data) const
4293 {
4294 return this->value != data.value;
4295 }
4296 constexpr bool operator!=(int data) const
4297 {
4298 return this->value != data;
4299 }
4300 constexpr bool operator<(S2FloatStateValue data) const
4301 {
4302 return this->value < data.value;
4303 }
4304 constexpr bool operator<(int data) const
4305 {
4306 return this->value < data;
4307 }
4308
4309 /**
4310 * \brief Gets the string representation of this enum
4311 *
4312 * \returns String representation of this enum
4313 */
4314 std::string ToString() const
4315 {
4316 switch (value)
4317 {
4318 case S2FloatStateValue::FloatDetect: return "Float Detect";
4319 case S2FloatStateValue::PullHigh: return "Pull High";
4320 case S2FloatStateValue::PullLow: return "Pull Low";
4321 case S2FloatStateValue::BusKeeper: return "Bus Keeper";
4322 default: return "Invalid Value";
4323 }
4324 }
4325
4326 friend std::ostream &operator<<(std::ostream &os, S2FloatStateValue data)
4327 {
4328 os << data.ToString();
4329 return os;
4330 }
4331
4332 std::string Serialize() const
4333 {
4334 std::stringstream ss;
4335 ss << "u_" << this->value;
4336 return ss.str();
4337 }
4338};
4339
4340/**
4341 * \brief Choose what sensor source is reported via API and used by closed-loop
4342 * and limit features. The default is Commutation, which uses the
4343 * external sensor used for motor commutation.
4344 *
4345 * Choose Remote* to use another sensor on the same CAN bus (this also
4346 * requires setting FeedbackRemoteSensorID). Talon will update its
4347 * position and velocity whenever the remote sensor publishes its
4348 * information on CAN bus, and the Talon commutation sensor will not be
4349 * used.
4350 *
4351 * Choose Fused* (requires Phoenix Pro) and Talon will fuse another
4352 * sensor's information with the commutation sensor, which provides the
4353 * best possible position and velocity for accuracy and bandwidth (this
4354 * also requires setting FeedbackRemoteSensorID). This was developed for
4355 * applications such as swerve-azimuth.
4356 *
4357 * Choose Sync* (requires Phoenix Pro) and Talon will synchronize its
4358 * commutation sensor position against another sensor, then continue to
4359 * use the rotor sensor for closed loop control (this also requires
4360 * setting FeedbackRemoteSensorID). The Talon will report if its
4361 * internal position differs significantly from the reported remote
4362 * sensor position. This was developed for mechanisms where there is a
4363 * risk of the sensor failing in such a way that it reports a position
4364 * that does not match the mechanism, such as the sensor mounting
4365 * assembly breaking off.
4366 *
4367 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
4368 * to use another Pigeon2 on the same CAN bus (this also requires setting
4369 * FeedbackRemoteSensorID). Talon will update its position to match the
4370 * selected value whenever Pigeon2 publishes its information on CAN bus.
4371 * Note that the Talon position will be in rotations and not degrees.
4372 *
4373 * Choose Quadrature to use a quadrature encoder directly attached to the
4374 * Talon data port. This provides velocity and relative position
4375 * measurements.
4376 *
4377 * Choose PulseWidth to use a pulse-width encoder directly attached to
4378 * the Talon data port. This provides velocity and absolute position
4379 * measurements.
4380 *
4381 * \details Note: When the feedback source is changed to Fused* or Sync*, the
4382 * Talon needs a period of time to fuse before sensor-based
4383 * (soft-limit, closed loop, etc.) features are used. This period of
4384 * time is determined by the update frequency of the remote sensor's
4385 * Position signal.
4386 */
4388{
4389public:
4391
4392 /**
4393 * \brief Use the external sensor used for motor commutation.
4394 */
4395 static constexpr int Commutation = 0;
4396 /**
4397 * \brief Use another CANcoder on the same CAN bus (this also requires setting
4398 * FeedbackRemoteSensorID). Talon will update its position and velocity
4399 * whenever CANcoder publishes its information on CAN bus, and the Talon
4400 * commutation sensor will not be used.
4401 */
4402 static constexpr int RemoteCANcoder = 1;
4403 /**
4404 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4405 * FeedbackRemoteSensorID). Talon will update its position to match the
4406 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
4407 * Note that the Talon position will be in rotations and not degrees.
4408 */
4409 static constexpr int RemotePigeon2_Yaw = 2;
4410 /**
4411 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4412 * FeedbackRemoteSensorID). Talon will update its position to match the
4413 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
4414 * Note that the Talon position will be in rotations and not degrees.
4415 */
4416 static constexpr int RemotePigeon2_Pitch = 3;
4417 /**
4418 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4419 * FeedbackRemoteSensorID). Talon will update its position to match the
4420 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
4421 * Note that the Talon position will be in rotations and not degrees.
4422 */
4423 static constexpr int RemotePigeon2_Roll = 4;
4424 /**
4425 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
4426 * with the commutation sensor, which provides the best possible position
4427 * and velocity for accuracy and bandwidth (this also requires setting
4428 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
4429 * such as swerve-azimuth.
4430 */
4431 static constexpr int FusedCANcoder = 5;
4432 /**
4433 * \brief Requires Phoenix Pro; Talon will synchronize its commutation sensor
4434 * position against another CANcoder, then continue to use the rotor
4435 * sensor for closed loop control (this also requires setting
4436 * FeedbackRemoteSensorID). The Talon will report if its internal
4437 * position differs significantly from the reported CANcoder position.
4438 * SyncCANcoder was developed for mechanisms where there is a risk of the
4439 * CANcoder failing in such a way that it reports a position that does
4440 * not match the mechanism, such as the sensor mounting assembly breaking
4441 * off.
4442 */
4443 static constexpr int SyncCANcoder = 6;
4444 /**
4445 * \brief Use a quadrature encoder directly attached to the Talon data port.
4446 * This provides velocity and relative position measurements.
4447 */
4448 static constexpr int Quadrature = 7;
4449 /**
4450 * \brief Use a pulse-width encoder directly attached to the Talon data port.
4451 * This provides velocity and absolute position measurements.
4452 */
4453 static constexpr int PulseWidth = 8;
4454 /**
4455 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
4456 * (S1IN) on CANdi. Talon will update its position and velocity whenever
4457 * CANdi publishes its information on CAN bus, and the Talon internal
4458 * rotor will not be used.
4459 */
4460 static constexpr int RemoteCANdiPWM1 = 9;
4461 /**
4462 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
4463 * (S2IN) on CANdi. Talon will update its position and velocity whenever
4464 * CANdi publishes its information on CAN bus, and the Talon internal
4465 * rotor will not be used.
4466 */
4467 static constexpr int RemoteCANdiPWM2 = 10;
4468 /**
4469 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
4470 * CANdi. Talon will update its position and velocity whenever CANdi
4471 * publishes its information on CAN bus, and the Talon internal rotor
4472 * will not be used.
4473 */
4474 static constexpr int RemoteCANdiQuadrature = 11;
4475 /**
4476 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
4477 * attached to the Sensor Input 1 (S1IN) on CANdi, which provides the
4478 * best possible position and velocity for accuracy and bandwidth (this
4479 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
4480 * developed for applications such as swerve-azimuth.
4481 */
4482 static constexpr int FusedCANdiPWM1 = 12;
4483 /**
4484 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
4485 * attached to the Sensor Input 2 (S2IN) on CANdi, which provides the
4486 * best possible position and velocity for accuracy and bandwidth (this
4487 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
4488 * developed for applications such as swerve-azimuth.
4489 */
4490 static constexpr int FusedCANdiPWM2 = 13;
4491 /**
4492 * \brief Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely
4493 * attached to the two Sensor Inputs on CANdi. This provides velocity and
4494 * relative position measurements. This also requires setting
4495 * FeedbackRemoteSensorID.
4496 */
4497 static constexpr int FusedCANdiQuadrature = 14;
4498 /**
4499 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
4500 * position against the pulse-width encoder attached to Sensor Input 1
4501 * (S1IN), then continue to use the rotor sensor for closed loop control
4502 * (this also requires setting FeedbackRemoteSensorID). The Talon will
4503 * report if its internal position differs significantly from the
4504 * reported PWM position. SyncCANdi was developed for mechanisms where
4505 * there is a risk of the CANdi failing in such a way that it reports a
4506 * position that does not match the mechanism, such as the sensor
4507 * mounting assembly breaking off.
4508 */
4509 static constexpr int SyncCANdiPWM1 = 15;
4510 /**
4511 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
4512 * position against the pulse-width encoder attached to Sensor Input 1
4513 * (S1IN), then continue to use the rotor sensor for closed loop control
4514 * (this also requires setting FeedbackRemoteSensorID). The Talon will
4515 * report if its internal position differs significantly from the
4516 * reported PWM position. SyncCANdi was developed for mechanisms where
4517 * there is a risk of the CANdi failing in such a way that it reports a
4518 * position that does not match the mechanism, such as the sensor
4519 * mounting assembly breaking off.
4520 */
4521 static constexpr int SyncCANdiPWM2 = 16;
4522
4524 value{value}
4525 {}
4526
4528 value{-1}
4529 {}
4530
4532 {
4533 return this->value == data.value;
4534 }
4535 constexpr bool operator==(int data) const
4536 {
4537 return this->value == data;
4538 }
4540 {
4541 return this->value != data.value;
4542 }
4543 constexpr bool operator!=(int data) const
4544 {
4545 return this->value != data;
4546 }
4548 {
4549 return this->value < data.value;
4550 }
4551 constexpr bool operator<(int data) const
4552 {
4553 return this->value < data;
4554 }
4555
4556 /**
4557 * \brief Gets the string representation of this enum
4558 *
4559 * \returns String representation of this enum
4560 */
4561 std::string ToString() const
4562 {
4563 switch (value)
4564 {
4565 case ExternalFeedbackSensorSourceValue::Commutation: return "Commutation";
4566 case ExternalFeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
4567 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
4568 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
4569 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
4570 case ExternalFeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
4571 case ExternalFeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
4572 case ExternalFeedbackSensorSourceValue::Quadrature: return "Quadrature";
4573 case ExternalFeedbackSensorSourceValue::PulseWidth: return "PulseWidth";
4574 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
4575 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
4576 case ExternalFeedbackSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
4577 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM1: return "FusedCANdiPWM1";
4578 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM2: return "FusedCANdiPWM2";
4579 case ExternalFeedbackSensorSourceValue::FusedCANdiQuadrature: return "FusedCANdiQuadrature";
4580 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM1: return "SyncCANdiPWM1";
4581 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM2: return "SyncCANdiPWM2";
4582 default: return "Invalid Value";
4583 }
4584 }
4585
4586 friend std::ostream &operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data)
4587 {
4588 os << data.ToString();
4589 return os;
4590 }
4591
4592 std::string Serialize() const
4593 {
4594 std::stringstream ss;
4595 ss << "u_" << this->value;
4596 return ss.str();
4597 }
4598};
4599
4600/**
4601 * \brief The relationship between the motor controlled by a Talon and the
4602 * external sensor connected to the data port. This does not affect the
4603 * commutation sensor or remote sensors.
4604 *
4605 * To determine the sensor phase, set this config to Aligned and drive
4606 * the motor with positive output. If the reported sensor velocity is
4607 * positive, then the phase is Aligned. If the reported sensor velocity
4608 * is negative, then the phase is Opposed.
4609 *
4610 * The sensor direction is automatically inverted along with motor
4611 * invert, so the sensor phase does not need to be changed when motor
4612 * invert changes.
4613 */
4615{
4616public:
4618
4619 /**
4620 * \brief The sensor direction is normally aligned with the motor.
4621 */
4622 static constexpr int Aligned = 0;
4623 /**
4624 * \brief The sensor direction is normally opposed to the motor.
4625 */
4626 static constexpr int Opposed = 1;
4627
4628 constexpr SensorPhaseValue(int value) :
4629 value{value}
4630 {}
4631
4632 constexpr SensorPhaseValue() :
4633 value{-1}
4634 {}
4635
4636 constexpr bool operator==(SensorPhaseValue data) const
4637 {
4638 return this->value == data.value;
4639 }
4640 constexpr bool operator==(int data) const
4641 {
4642 return this->value == data;
4643 }
4644 constexpr bool operator!=(SensorPhaseValue data) const
4645 {
4646 return this->value != data.value;
4647 }
4648 constexpr bool operator!=(int data) const
4649 {
4650 return this->value != data;
4651 }
4652 constexpr bool operator<(SensorPhaseValue data) const
4653 {
4654 return this->value < data.value;
4655 }
4656 constexpr bool operator<(int data) const
4657 {
4658 return this->value < data;
4659 }
4660
4661 /**
4662 * \brief Gets the string representation of this enum
4663 *
4664 * \returns String representation of this enum
4665 */
4666 std::string ToString() const
4667 {
4668 switch (value)
4669 {
4670 case SensorPhaseValue::Aligned: return "Aligned";
4671 case SensorPhaseValue::Opposed: return "Opposed";
4672 default: return "Invalid Value";
4673 }
4674 }
4675
4676 friend std::ostream &operator<<(std::ostream &os, SensorPhaseValue data)
4677 {
4678 os << data.ToString();
4679 return os;
4680 }
4681
4682 std::string Serialize() const
4683 {
4684 std::stringstream ss;
4685 ss << "u_" << this->value;
4686 return ss.str();
4687 }
4688};
4689
4690/**
4691 * \brief What value the Signal 1 input (S1IN) needs to be for the CANdi to
4692 * detect as Closed.
4693 *
4694 * \details Devices using the S1 input as a remote limit switch will treat the
4695 * switch as closed when the S1 input is this state.
4696 */
4698{
4699public:
4701
4702 /**
4703 * \brief The S1 input will be treated as closed when it is not floating.
4704 */
4705 static constexpr int CloseWhenNotFloating = 0;
4706 /**
4707 * \brief The S1 input will be treated as closed when it is floating.
4708 */
4709 static constexpr int CloseWhenFloating = 1;
4710 /**
4711 * \brief The S1 input will be treated as closed when it is not High.
4712 */
4713 static constexpr int CloseWhenNotHigh = 2;
4714 /**
4715 * \brief The S1 input will be treated as closed when it is High.
4716 */
4717 static constexpr int CloseWhenHigh = 3;
4718 /**
4719 * \brief The S1 input will be treated as closed when it is not Low.
4720 */
4721 static constexpr int CloseWhenNotLow = 4;
4722 /**
4723 * \brief The S1 input will be treated as closed when it is Low.
4724 */
4725 static constexpr int CloseWhenLow = 5;
4726
4727 constexpr S1CloseStateValue(int value) :
4728 value{value}
4729 {}
4730
4731 constexpr S1CloseStateValue() :
4732 value{-1}
4733 {}
4734
4735 constexpr bool operator==(S1CloseStateValue data) const
4736 {
4737 return this->value == data.value;
4738 }
4739 constexpr bool operator==(int data) const
4740 {
4741 return this->value == data;
4742 }
4743 constexpr bool operator!=(S1CloseStateValue data) const
4744 {
4745 return this->value != data.value;
4746 }
4747 constexpr bool operator!=(int data) const
4748 {
4749 return this->value != data;
4750 }
4751 constexpr bool operator<(S1CloseStateValue data) const
4752 {
4753 return this->value < data.value;
4754 }
4755 constexpr bool operator<(int data) const
4756 {
4757 return this->value < data;
4758 }
4759
4760 /**
4761 * \brief Gets the string representation of this enum
4762 *
4763 * \returns String representation of this enum
4764 */
4765 std::string ToString() const
4766 {
4767 switch (value)
4768 {
4769 case S1CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
4770 case S1CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
4771 case S1CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
4772 case S1CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
4773 case S1CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
4774 case S1CloseStateValue::CloseWhenLow: return "CloseWhenLow";
4775 default: return "Invalid Value";
4776 }
4777 }
4778
4779 friend std::ostream &operator<<(std::ostream &os, S1CloseStateValue data)
4780 {
4781 os << data.ToString();
4782 return os;
4783 }
4784
4785 std::string Serialize() const
4786 {
4787 std::stringstream ss;
4788 ss << "u_" << this->value;
4789 return ss.str();
4790 }
4791};
4792
4793/**
4794 * \brief What value the Signal 2 input (S2IN) needs to be for the CANdi to
4795 * detect as Closed.
4796 *
4797 * \details Devices using the S2 input as a remote limit switch will treat the
4798 * switch as closed when the S2 input is this state.
4799 */
4801{
4802public:
4804
4805 /**
4806 * \brief The S2 input will be treated as closed when it is not floating.
4807 */
4808 static constexpr int CloseWhenNotFloating = 0;
4809 /**
4810 * \brief The S2 input will be treated as closed when it is floating.
4811 */
4812 static constexpr int CloseWhenFloating = 1;
4813 /**
4814 * \brief The S2 input will be treated as closed when it is not High.
4815 */
4816 static constexpr int CloseWhenNotHigh = 2;
4817 /**
4818 * \brief The S2 input will be treated as closed when it is High.
4819 */
4820 static constexpr int CloseWhenHigh = 3;
4821 /**
4822 * \brief The S2 input will be treated as closed when it is not Low.
4823 */
4824 static constexpr int CloseWhenNotLow = 4;
4825 /**
4826 * \brief The S2 input will be treated as closed when it is Low.
4827 */
4828 static constexpr int CloseWhenLow = 5;
4829
4830 constexpr S2CloseStateValue(int value) :
4831 value{value}
4832 {}
4833
4834 constexpr S2CloseStateValue() :
4835 value{-1}
4836 {}
4837
4838 constexpr bool operator==(S2CloseStateValue data) const
4839 {
4840 return this->value == data.value;
4841 }
4842 constexpr bool operator==(int data) const
4843 {
4844 return this->value == data;
4845 }
4846 constexpr bool operator!=(S2CloseStateValue data) const
4847 {
4848 return this->value != data.value;
4849 }
4850 constexpr bool operator!=(int data) const
4851 {
4852 return this->value != data;
4853 }
4854 constexpr bool operator<(S2CloseStateValue data) const
4855 {
4856 return this->value < data.value;
4857 }
4858 constexpr bool operator<(int data) const
4859 {
4860 return this->value < data;
4861 }
4862
4863 /**
4864 * \brief Gets the string representation of this enum
4865 *
4866 * \returns String representation of this enum
4867 */
4868 std::string ToString() const
4869 {
4870 switch (value)
4871 {
4872 case S2CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
4873 case S2CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
4874 case S2CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
4875 case S2CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
4876 case S2CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
4877 case S2CloseStateValue::CloseWhenLow: return "CloseWhenLow";
4878 default: return "Invalid Value";
4879 }
4880 }
4881
4882 friend std::ostream &operator<<(std::ostream &os, S2CloseStateValue data)
4883 {
4884 os << data.ToString();
4885 return os;
4886 }
4887
4888 std::string Serialize() const
4889 {
4890 std::stringstream ss;
4891 ss << "u_" << this->value;
4892 return ss.str();
4893 }
4894};
4895
4896/**
4897 * \brief If a brushed motor is selected with Motor Arrangement, this config
4898 * determines which of three leads to use.
4899 */
4901{
4902public:
4904
4905 /**
4906 * \brief Third party brushed DC motor with two leads.
4907 * Motor leads: Use terminal A for the motor red lead and terminal B for
4908 * the motor black lead (motor leads may be flipped to correct for
4909 * clockwise vs counterclockwise).
4910 * Note that the invert configuration can still be used to invert rotor
4911 * orientation.
4912 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4913 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4914 * pin [9].
4915 */
4916 static constexpr int Leads_A_and_B = 0;
4917 /**
4918 * \brief Third party brushed DC motor with two leads.
4919 * Motor leads: Use terminal A for the motor red lead and terminal C for
4920 * the motor black lead (motor leads may be flipped to correct for
4921 * clockwise vs counterclockwise).
4922 * Note that the invert configuration can still be used to reverse rotor
4923 * orientation.
4924 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4925 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4926 * pin [9].
4927 */
4928 static constexpr int Leads_A_and_C = 1;
4929 /**
4930 * \brief Third party brushed DC motor with two leads.
4931 * Motor leads: Use terminal B for the motor red lead and terminal C for
4932 * the motor black lead (motor leads may be flipped to correct for
4933 * clockwise vs counterclockwise).
4934 * Note that the invert configuration can still be used to reverse rotor
4935 * orientation.
4936 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4937 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4938 * pin [9].
4939 */
4940 static constexpr int Leads_B_and_C = 2;
4941
4943 value{value}
4944 {}
4945
4947 value{-1}
4948 {}
4949
4950 constexpr bool operator==(BrushedMotorWiringValue data) const
4951 {
4952 return this->value == data.value;
4953 }
4954 constexpr bool operator==(int data) const
4955 {
4956 return this->value == data;
4957 }
4958 constexpr bool operator!=(BrushedMotorWiringValue data) const
4959 {
4960 return this->value != data.value;
4961 }
4962 constexpr bool operator!=(int data) const
4963 {
4964 return this->value != data;
4965 }
4966 constexpr bool operator<(BrushedMotorWiringValue data) const
4967 {
4968 return this->value < data.value;
4969 }
4970 constexpr bool operator<(int data) const
4971 {
4972 return this->value < data;
4973 }
4974
4975 /**
4976 * \brief Gets the string representation of this enum
4977 *
4978 * \returns String representation of this enum
4979 */
4980 std::string ToString() const
4981 {
4982 switch (value)
4983 {
4984 case BrushedMotorWiringValue::Leads_A_and_B: return "Leads_A_and_B";
4985 case BrushedMotorWiringValue::Leads_A_and_C: return "Leads_A_and_C";
4986 case BrushedMotorWiringValue::Leads_B_and_C: return "Leads_B_and_C";
4987 default: return "Invalid Value";
4988 }
4989 }
4990
4991 friend std::ostream &operator<<(std::ostream &os, BrushedMotorWiringValue data)
4992 {
4993 os << data.ToString();
4994 return os;
4995 }
4996
4997 std::string Serialize() const
4998 {
4999 std::stringstream ss;
5000 ss << "u_" << this->value;
5001 return ss.str();
5002 }
5003};
5004
5005
5006}
5007}
5008}
Definition Serializable.hpp:15
Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors.
Definition SpnEnums.hpp:3760
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3804
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3814
std::string Serialize() const
Definition SpnEnums.hpp:3830
friend std::ostream & operator<<(std::ostream &os, AdvancedHallSupportValue data)
Definition SpnEnums.hpp:3824
constexpr AdvancedHallSupportValue()
Definition SpnEnums.hpp:3780
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3788
constexpr bool operator==(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3784
static constexpr int Enabled
Requires Phoenix Pro; Talon uses advanced features to improve commutation and velocity measurement wh...
Definition SpnEnums.hpp:3774
static constexpr int Disabled
Talon will utilize hall sensors without advanced features.
Definition SpnEnums.hpp:3767
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3796
constexpr bool operator!=(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3792
constexpr bool operator<(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3800
constexpr AdvancedHallSupportValue(int value)
Definition SpnEnums.hpp:3776
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:3124
constexpr bool operator<(BridgeOutputValue data) const
Definition SpnEnums.hpp:3163
constexpr bool operator==(BridgeOutputValue data) const
Definition SpnEnums.hpp:3147
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3167
static constexpr int BridgeReq_VariableBrake
Definition SpnEnums.hpp:3137
constexpr bool operator!=(BridgeOutputValue data) const
Definition SpnEnums.hpp:3155
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3151
friend std::ostream & operator<<(std::ostream &os, BridgeOutputValue data)
Definition SpnEnums.hpp:3195
static constexpr int BridgeReq_FaultCoast
Definition SpnEnums.hpp:3135
static constexpr int BridgeReq_FOCEasy
Definition SpnEnums.hpp:3133
std::string Serialize() const
Definition SpnEnums.hpp:3201
static constexpr int BridgeReq_Trapez
Definition SpnEnums.hpp:3130
static constexpr int BridgeReq_ActiveBrake
Definition SpnEnums.hpp:3136
constexpr BridgeOutputValue(int value)
Definition SpnEnums.hpp:3139
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3177
static constexpr int BridgeReq_MusicTone
Definition SpnEnums.hpp:3132
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3159
static constexpr int BridgeReq_Brake
Definition SpnEnums.hpp:3129
static constexpr int BridgeReq_FOCTorque
Definition SpnEnums.hpp:3131
constexpr BridgeOutputValue()
Definition SpnEnums.hpp:3143
int value
Definition SpnEnums.hpp:3126
static constexpr int BridgeReq_FaultBrake
Definition SpnEnums.hpp:3134
static constexpr int BridgeReq_Coast
Definition SpnEnums.hpp:3128
If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to...
Definition SpnEnums.hpp:4901
constexpr bool operator==(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4950
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4980
int value
Definition SpnEnums.hpp:4903
constexpr BrushedMotorWiringValue(int value)
Definition SpnEnums.hpp:4942
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4962
static constexpr int Leads_A_and_B
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4916
friend std::ostream & operator<<(std::ostream &os, BrushedMotorWiringValue data)
Definition SpnEnums.hpp:4991
std::string Serialize() const
Definition SpnEnums.hpp:4997
constexpr bool operator<(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4966
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4954
constexpr bool operator!=(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4958
static constexpr int Leads_B_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4940
static constexpr int Leads_A_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4928
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4970
constexpr BrushedMotorWiringValue()
Definition SpnEnums.hpp:4946
The type of motor attached to the Talon.
Definition SpnEnums.hpp:3454
int value
Definition SpnEnums.hpp:3456
static constexpr int Falcon500_Integrated
Talon is attached to an integrated Falcon motor.
Definition SpnEnums.hpp:3465
static constexpr int NEO550_JST
Talon is connected to a third party NEO550 brushless three phase motor.
Definition SpnEnums.hpp:3502
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3537
static constexpr int KrakenX44_Integrated
Talon is attached to an integrated Kraken X44 motor.
Definition SpnEnums.hpp:3473
std::string Serialize() const
Definition SpnEnums.hpp:3572
static constexpr int Brushed_AC
Talon is connected to a third party brushed DC motor with leads A and C.
Definition SpnEnums.hpp:3488
constexpr bool operator!=(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3525
static constexpr int NEO_JST
Talon is connected to a third party NEO brushless three phase motor.
Definition SpnEnums.hpp:3497
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3529
static constexpr int Brushed_AB
Talon is connected to a third party brushed DC motor with leads A and B.
Definition SpnEnums.hpp:3483
static constexpr int Brushed_BC
Talon is connected to a third party brushed DC motor with leads B and C.
Definition SpnEnums.hpp:3493
constexpr ConnectedMotorValue(int value)
Definition SpnEnums.hpp:3509
static constexpr int Minion_JST
Talon is connected to a CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:3478
constexpr bool operator<(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3533
constexpr bool operator==(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3517
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3547
static constexpr int KrakenX60_Integrated
Talon is attached to an integrated Kraken X60 motor.
Definition SpnEnums.hpp:3469
friend std::ostream & operator<<(std::ostream &os, ConnectedMotorValue data)
Definition SpnEnums.hpp:3566
constexpr ConnectedMotorValue()
Definition SpnEnums.hpp:3513
static constexpr int VORTEX_JST
Talon is connected to a third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:3507
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3521
static constexpr int Unknown
Talon could not determine the type of motor attached.
Definition SpnEnums.hpp:3461
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:1976
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2012
constexpr DiffPIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1988
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1982
constexpr bool operator!=(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:2000
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2022
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2004
constexpr bool operator==(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1992
std::string Serialize() const
Definition SpnEnums.hpp:2039
friend std::ostream & operator<<(std::ostream &os, DiffPIDOutput_PIDOutputModeValue data)
Definition SpnEnums.hpp:2033
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1996
constexpr DiffPIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1984
static constexpr int Voltage
Definition SpnEnums.hpp:1981
static constexpr int DutyCycle
Definition SpnEnums.hpp:1980
constexpr bool operator<(DiffPIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:2008
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1903
std::string Serialize() const
Definition SpnEnums.hpp:1964
constexpr bool operator<(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1934
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1922
friend std::ostream & operator<<(std::ostream &os, DiffPIDRefPIDErr_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1958
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:1914
static constexpr int Velocity
Definition SpnEnums.hpp:1908
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1938
constexpr DiffPIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1910
constexpr bool operator!=(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1926
static constexpr int Position
Definition SpnEnums.hpp:1907
constexpr bool operator==(DiffPIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1918
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1948
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1930
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:2051
constexpr bool operator!=(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:2074
static constexpr int Position
Definition SpnEnums.hpp:2055
std::string Serialize() const
Definition SpnEnums.hpp:2112
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:2062
friend std::ostream & operator<<(std::ostream &os, DiffPIDRefSlopeECUTime_ClosedLoopModeValue data)
Definition SpnEnums.hpp:2106
constexpr DiffPIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:2058
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2070
constexpr bool operator<(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:2082
static constexpr int Velocity
Definition SpnEnums.hpp:2056
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2096
constexpr bool operator==(DiffPIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:2066
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2086
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2078
The active control mode of the differential controller.
Definition SpnEnums.hpp:1782
static constexpr int MotionMagicVoltage
Definition SpnEnums.hpp:1800
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1825
static constexpr int NeutralOut
Definition SpnEnums.hpp:1787
static constexpr int PositionDutyCycle
Definition SpnEnums.hpp:1790
constexpr bool operator!=(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1829
static constexpr int VelocityTorqueCurrentFOC
Definition SpnEnums.hpp:1807
static constexpr int Reserved
Definition SpnEnums.hpp:1810
static constexpr int PositionVoltageFOC
Definition SpnEnums.hpp:1802
static constexpr int MotionMagicTorqueCurrentFOC
Definition SpnEnums.hpp:1808
static constexpr int VelocityDutyCycleFOC
Definition SpnEnums.hpp:1795
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1805
static constexpr int VoltageOut
Definition SpnEnums.hpp:1797
static constexpr int VelocityVoltageFOC
Definition SpnEnums.hpp:1803
static constexpr int MotionMagicDutyCycleFOC
Definition SpnEnums.hpp:1796
static constexpr int MotionMagicVoltageFOC
Definition SpnEnums.hpp:1804
static constexpr int Follower
Definition SpnEnums.hpp:1809
static constexpr int DisabledOutput
Definition SpnEnums.hpp:1786
static constexpr int VoltageFOC
Definition SpnEnums.hpp:1801
constexpr DifferentialControlModeValue()
Definition SpnEnums.hpp:1817
static constexpr int DutyCycleOut
Definition SpnEnums.hpp:1789
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1833
std::string Serialize() const
Definition SpnEnums.hpp:1891
static constexpr int PositionVoltage
Definition SpnEnums.hpp:1798
static constexpr int StaticBrake
Definition SpnEnums.hpp:1788
friend std::ostream & operator<<(std::ostream &os, DifferentialControlModeValue data)
Definition SpnEnums.hpp:1885
static constexpr int PositionTorqueCurrentFOC
Definition SpnEnums.hpp:1806
static constexpr int MotionMagicDutyCycle
Definition SpnEnums.hpp:1792
constexpr bool operator<(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1837
static constexpr int VelocityDutyCycle
Definition SpnEnums.hpp:1791
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1851
static constexpr int PositionDutyCycleFOC
Definition SpnEnums.hpp:1794
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1841
static constexpr int CoastOut
Definition SpnEnums.hpp:1811
constexpr bool operator==(DifferentialControlModeValue data) const
Definition SpnEnums.hpp:1821
static constexpr int DutyCycleFOC
Definition SpnEnums.hpp:1793
constexpr DifferentialControlModeValue(int value)
Definition SpnEnums.hpp:1813
static constexpr int VelocityVoltage
Definition SpnEnums.hpp:1799
Choose what sensor source is used for differential control of a mechanism.
Definition SpnEnums.hpp:3236
static constexpr int Disabled
Disable differential control.
Definition SpnEnums.hpp:3243
static constexpr int RemoteTalonFX_Diff
Use another TalonFX on the same CAN bus.
Definition SpnEnums.hpp:3251
constexpr bool operator<(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3308
constexpr bool operator==(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3292
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3282
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3296
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3312
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3267
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3275
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3259
constexpr bool operator!=(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3300
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3304
std::string Serialize() const
Definition SpnEnums.hpp:3342
friend std::ostream & operator<<(std::ostream &os, DifferentialSensorSourceValue data)
Definition SpnEnums.hpp:3336
constexpr DifferentialSensorSourceValue()
Definition SpnEnums.hpp:3288
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3322
constexpr DifferentialSensorSourceValue(int value)
Definition SpnEnums.hpp:3284
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:4388
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on CANdi.
Definition SpnEnums.hpp:4474
std::string Serialize() const
Definition SpnEnums.hpp:4592
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its commutation sensor position against another CANcoder...
Definition SpnEnums.hpp:4443
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4423
static constexpr int FusedCANdiPWM2
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (...
Definition SpnEnums.hpp:4490
constexpr bool operator<(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4547
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4409
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4551
static constexpr int SyncCANdiPWM1
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:4509
static constexpr int FusedCANdiQuadrature
Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs...
Definition SpnEnums.hpp:4497
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on CANdi.
Definition SpnEnums.hpp:4460
static constexpr int SyncCANdiPWM2
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:4521
constexpr ExternalFeedbackSensorSourceValue()
Definition SpnEnums.hpp:4527
constexpr bool operator!=(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4539
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4416
static constexpr int Commutation
Use the external sensor used for motor commutation.
Definition SpnEnums.hpp:4395
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4402
static constexpr int FusedCANdiPWM1
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (...
Definition SpnEnums.hpp:4482
constexpr bool operator==(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4531
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4535
constexpr ExternalFeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:4523
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4561
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4543
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the commutation sensor,...
Definition SpnEnums.hpp:4431
friend std::ostream & operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data)
Definition SpnEnums.hpp:4586
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on CANdi.
Definition SpnEnums.hpp:4467
static constexpr int Quadrature
Use a quadrature encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:4448
static constexpr int PulseWidth
Use a pulse-width encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:4453
Status of the temperature sensor of the external motor.
Definition SpnEnums.hpp:1280
static constexpr int Normal
Temperature sensor is normal.
Definition SpnEnums.hpp:1299
friend std::ostream & operator<<(std::ostream &os, ExternalMotorTempStatusValue data)
Definition SpnEnums.hpp:1363
static constexpr int Collecting
Talon is collecting information on the sensor.
Definition SpnEnums.hpp:1287
static constexpr int NotUsed
Temperature sensor is present but is not used.
Definition SpnEnums.hpp:1304
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1339
static constexpr int TooHot
Temperature sensor is too hot to allow motor operation.
Definition SpnEnums.hpp:1295
static constexpr int WrongMotorOrShorted
Temperature sensor appears to be for the wrong motor arrangement, or signals are shorted.
Definition SpnEnums.hpp:1309
std::string Serialize() const
Definition SpnEnums.hpp:1369
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1331
constexpr bool operator!=(ExternalMotorTempStatusValue data) const
Definition SpnEnums.hpp:1327
static constexpr int Disconnected
Temperature sensor appears to be disconnected.
Definition SpnEnums.hpp:1291
constexpr bool operator==(ExternalMotorTempStatusValue data) const
Definition SpnEnums.hpp:1319
constexpr bool operator<(ExternalMotorTempStatusValue data) const
Definition SpnEnums.hpp:1335
constexpr ExternalMotorTempStatusValue(int value)
Definition SpnEnums.hpp:1311
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1323
constexpr ExternalMotorTempStatusValue()
Definition SpnEnums.hpp:1315
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1349
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:2411
constexpr FeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:2536
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2425
static constexpr int FusedCANdiQuadrature
Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs...
Definition SpnEnums.hpp:2510
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2564
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2439
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2432
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2556
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:2446
static constexpr int SyncCANdiPWM2
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:2534
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on CANdi.
Definition SpnEnums.hpp:2480
constexpr FeedbackSensorSourceValue()
Definition SpnEnums.hpp:2540
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on CANdi.
Definition SpnEnums.hpp:2487
constexpr bool operator==(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2544
constexpr bool operator<(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2560
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2548
static constexpr int SyncCANdiPWM1
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:2522
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its internal rotor position against another CANcoder,...
Definition SpnEnums.hpp:2466
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on CANdi.
Definition SpnEnums.hpp:2473
static constexpr int FusedCANdiPWM1
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (...
Definition SpnEnums.hpp:2495
static constexpr int RotorSensor
Use the internal rotor sensor in the Talon.
Definition SpnEnums.hpp:2418
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2574
std::string Serialize() const
Definition SpnEnums.hpp:2603
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the internal rotor,...
Definition SpnEnums.hpp:2454
constexpr bool operator!=(FeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:2552
static constexpr int FusedCANdiPWM2
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (...
Definition SpnEnums.hpp:2503
friend std::ostream & operator<<(std::ostream &os, FeedbackSensorSourceValue data)
Definition SpnEnums.hpp:2597
Determines where to poll the forward limit switch.
Definition SpnEnums.hpp:2703
constexpr bool operator!=(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2767
static constexpr int LimitSwitchPin
Use the forward limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2710
std::string Serialize() const
Definition SpnEnums.hpp:2811
static constexpr int RemoteCANdiS1
Use another CANdi on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2739
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:2715
constexpr bool operator==(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2759
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2771
constexpr ForwardLimitSourceValue(int value)
Definition SpnEnums.hpp:2751
constexpr ForwardLimitSourceValue()
Definition SpnEnums.hpp:2755
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2789
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2779
constexpr bool operator<(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2775
friend std::ostream & operator<<(std::ostream &os, ForwardLimitSourceValue data)
Definition SpnEnums.hpp:2805
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2763
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:2720
static constexpr int RemoteCANdiS2
Use another CANdi on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2745
int value
Definition SpnEnums.hpp:2705
static constexpr int Disabled
Disable the forward limit switch.
Definition SpnEnums.hpp:2749
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2733
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2727
Determines if the forward limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2616
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2621
constexpr bool operator<(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2647
constexpr bool operator==(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2631
constexpr ForwardLimitTypeValue()
Definition SpnEnums.hpp:2627
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2643
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2635
constexpr ForwardLimitTypeValue(int value)
Definition SpnEnums.hpp:2623
constexpr bool operator!=(ForwardLimitTypeValue data) const
Definition SpnEnums.hpp:2639
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2661
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2620
std::string Serialize() const
Definition SpnEnums.hpp:2677
friend std::ostream & operator<<(std::ostream &os, ForwardLimitTypeValue data)
Definition SpnEnums.hpp:2671
int value
Definition SpnEnums.hpp:2618
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2651
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:2138
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2185
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2195
constexpr GravityTypeValue()
Definition SpnEnums.hpp:2161
constexpr GravityTypeValue(int value)
Definition SpnEnums.hpp:2157
static constexpr int Elevator_Static
The system's gravity feedforward is constant, such as an elevator.
Definition SpnEnums.hpp:2146
int value
Definition SpnEnums.hpp:2140
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2177
std::string Serialize() const
Definition SpnEnums.hpp:2211
constexpr bool operator!=(GravityTypeValue data) const
Definition SpnEnums.hpp:2173
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2169
friend std::ostream & operator<<(std::ostream &os, GravityTypeValue data)
Definition SpnEnums.hpp:2205
constexpr bool operator==(GravityTypeValue data) const
Definition SpnEnums.hpp:2165
constexpr bool operator<(GravityTypeValue data) const
Definition SpnEnums.hpp:2181
static constexpr int Arm_Cosine
The system's gravity feedback is dependent on the angular position of the mechanism,...
Definition SpnEnums.hpp:2155
Invert state of the device as seen from the front of the motor.
Definition SpnEnums.hpp:2223
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2264
static constexpr int CounterClockwise_Positive
Positive motor output results in clockwise motion.
Definition SpnEnums.hpp:2230
constexpr bool operator!=(InvertedValue data) const
Definition SpnEnums.hpp:2252
constexpr InvertedValue(int value)
Definition SpnEnums.hpp:2236
int value
Definition SpnEnums.hpp:2225
static constexpr int Clockwise_Positive
Positive motor output results in counter-clockwise motion.
Definition SpnEnums.hpp:2234
std::string Serialize() const
Definition SpnEnums.hpp:2290
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2274
friend std::ostream & operator<<(std::ostream &os, InvertedValue data)
Definition SpnEnums.hpp:2284
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2248
constexpr InvertedValue()
Definition SpnEnums.hpp:2240
constexpr bool operator<(InvertedValue data) const
Definition SpnEnums.hpp:2260
constexpr bool operator==(InvertedValue data) const
Definition SpnEnums.hpp:2244
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2256
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:3035
friend std::ostream & operator<<(std::ostream &os, MagnetHealthValue data)
Definition SpnEnums.hpp:3106
static constexpr int Magnet_Orange
Magnet health is adequate but with reduced accuracy.
Definition SpnEnums.hpp:3046
constexpr bool operator!=(MagnetHealthValue data) const
Definition SpnEnums.hpp:3072
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3094
static constexpr int Magnet_Red
The magnet is too close or too far from the CANcoder.
Definition SpnEnums.hpp:3042
constexpr bool operator==(MagnetHealthValue data) const
Definition SpnEnums.hpp:3064
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3068
static constexpr int Magnet_Green
Magnet health is ideal.
Definition SpnEnums.hpp:3050
std::string Serialize() const
Definition SpnEnums.hpp:3112
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3076
constexpr MagnetHealthValue()
Definition SpnEnums.hpp:3060
int value
Definition SpnEnums.hpp:3037
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3084
static constexpr int Magnet_Invalid
The accuracy cannot be determined.
Definition SpnEnums.hpp:3054
constexpr MagnetHealthValue(int value)
Definition SpnEnums.hpp:3056
constexpr bool operator<(MagnetHealthValue data) const
Definition SpnEnums.hpp:3080
Health of the distance measurement.
Definition SpnEnums.hpp:3584
constexpr bool operator==(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3610
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3622
static constexpr int Good
Measurement is good.
Definition SpnEnums.hpp:3591
constexpr MeasurementHealthValue(int value)
Definition SpnEnums.hpp:3602
static constexpr int Limited
Measurement is likely okay, but the target is either very far away or moving very quickly.
Definition SpnEnums.hpp:3596
constexpr bool operator<(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3626
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3630
std::string Serialize() const
Definition SpnEnums.hpp:3657
static constexpr int Bad
Measurement is compromised.
Definition SpnEnums.hpp:3600
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3614
constexpr bool operator!=(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3618
friend std::ostream & operator<<(std::ostream &os, MeasurementHealthValue data)
Definition SpnEnums.hpp:3651
constexpr MeasurementHealthValue()
Definition SpnEnums.hpp:3606
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3640
int value
Definition SpnEnums.hpp:3586
Check if Motion Magic® is running.
Definition SpnEnums.hpp:1382
constexpr bool operator<(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1413
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1409
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1401
constexpr bool operator!=(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1405
constexpr MotionMagicIsRunningValue()
Definition SpnEnums.hpp:1393
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1427
constexpr bool operator==(MotionMagicIsRunningValue data) const
Definition SpnEnums.hpp:1397
constexpr MotionMagicIsRunningValue(int value)
Definition SpnEnums.hpp:1389
std::string Serialize() const
Definition SpnEnums.hpp:1443
static constexpr int Disabled
Definition SpnEnums.hpp:1387
friend std::ostream & operator<<(std::ostream &os, MotionMagicIsRunningValue data)
Definition SpnEnums.hpp:1437
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1417
static constexpr int Enabled
Definition SpnEnums.hpp:1386
Selects the motor and motor connections used with Talon.
Definition SpnEnums.hpp:3849
constexpr bool operator<(MotorArrangementValue data) const
Definition SpnEnums.hpp:3944
int value
Definition SpnEnums.hpp:3851
static constexpr int NEO_JST
Third party NEO brushless three phase motor (~6000 RPM at 12V).
Definition SpnEnums.hpp:3894
friend std::ostream & operator<<(std::ostream &os, MotorArrangementValue data)
Definition SpnEnums.hpp:3972
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3940
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3948
static constexpr int NEO550_JST
Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
Definition SpnEnums.hpp:3906
static constexpr int Brushed_DC
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:3882
static constexpr int Minion_JST
CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:3870
std::string Serialize() const
Definition SpnEnums.hpp:3978
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3932
constexpr MotorArrangementValue(int value)
Definition SpnEnums.hpp:3920
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3958
constexpr bool operator!=(MotorArrangementValue data) const
Definition SpnEnums.hpp:3936
constexpr bool operator==(MotorArrangementValue data) const
Definition SpnEnums.hpp:3928
static constexpr int VORTEX_JST
Third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:3918
constexpr MotorArrangementValue()
Definition SpnEnums.hpp:3924
static constexpr int Disabled
Motor is not selected.
Definition SpnEnums.hpp:3858
Assess the status of the motor output with respect to load and supply.
Definition SpnEnums.hpp:1679
std::string Serialize() const
Definition SpnEnums.hpp:1770
constexpr MotorOutputStatusValue()
Definition SpnEnums.hpp:1716
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:1710
static constexpr int Off
Motor output is disabled.
Definition SpnEnums.hpp:1690
static constexpr int Motoring
The motor is loaded in a typical fashion, drawing current from the supply, and successfully turning t...
Definition SpnEnums.hpp:1700
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1750
constexpr MotorOutputStatusValue(int value)
Definition SpnEnums.hpp:1712
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1740
constexpr bool operator==(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1720
constexpr bool operator!=(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1728
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1724
friend std::ostream & operator<<(std::ostream &os, MotorOutputStatusValue data)
Definition SpnEnums.hpp:1764
constexpr bool operator<(MotorOutputStatusValue data) const
Definition SpnEnums.hpp:1736
static constexpr int StaticBraking
The motor is in neutral-brake.
Definition SpnEnums.hpp:1694
int value
Definition SpnEnums.hpp:1681
static constexpr int Unknown
The status of motor output could not be determined.
Definition SpnEnums.hpp:1686
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1732
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:1705
The state of the motor controller bridge when output is neutral or disabled.
Definition SpnEnums.hpp:2303
constexpr NeutralModeValue(int value)
Definition SpnEnums.hpp:2310
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2322
constexpr bool operator==(NeutralModeValue data) const
Definition SpnEnums.hpp:2318
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2338
std::string Serialize() const
Definition SpnEnums.hpp:2364
constexpr bool operator<(NeutralModeValue data) const
Definition SpnEnums.hpp:2334
friend std::ostream & operator<<(std::ostream &os, NeutralModeValue data)
Definition SpnEnums.hpp:2358
static constexpr int Brake
Definition SpnEnums.hpp:2308
constexpr bool operator!=(NeutralModeValue data) const
Definition SpnEnums.hpp:2326
constexpr NeutralModeValue()
Definition SpnEnums.hpp:2314
int value
Definition SpnEnums.hpp:2305
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2348
static constexpr int Coast
Definition SpnEnums.hpp:2307
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2330
The output mode of the PID controller.
Definition SpnEnums.hpp:1528
std::string Serialize() const
Definition SpnEnums.hpp:1591
constexpr bool operator<(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1560
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1574
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1556
static constexpr int TorqueCurrentFOC
Definition SpnEnums.hpp:1534
friend std::ostream & operator<<(std::ostream &os, PIDOutput_PIDOutputModeValue data)
Definition SpnEnums.hpp:1585
constexpr PIDOutput_PIDOutputModeValue(int value)
Definition SpnEnums.hpp:1536
static constexpr int Voltage
Definition SpnEnums.hpp:1533
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1548
constexpr PIDOutput_PIDOutputModeValue()
Definition SpnEnums.hpp:1540
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1564
static constexpr int DutyCycle
Definition SpnEnums.hpp:1532
constexpr bool operator!=(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1552
constexpr bool operator==(PIDOutput_PIDOutputModeValue data) const
Definition SpnEnums.hpp:1544
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1455
static constexpr int Position
Definition SpnEnums.hpp:1459
constexpr PIDRefPIDErr_ClosedLoopModeValue()
Definition SpnEnums.hpp:1466
friend std::ostream & operator<<(std::ostream &os, PIDRefPIDErr_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1510
constexpr bool operator!=(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1478
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1482
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1490
constexpr PIDRefPIDErr_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1462
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1474
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1500
constexpr bool operator==(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1470
static constexpr int Velocity
Definition SpnEnums.hpp:1460
std::string Serialize() const
Definition SpnEnums.hpp:1516
constexpr bool operator<(PIDRefPIDErr_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1486
Whether the closed-loop is running on position or velocity.
Definition SpnEnums.hpp:1603
constexpr bool operator!=(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1626
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue()
Definition SpnEnums.hpp:1614
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:1630
constexpr bool operator<(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1634
friend std::ostream & operator<<(std::ostream &os, PIDRefSlopeECUTime_ClosedLoopModeValue data)
Definition SpnEnums.hpp:1658
static constexpr int Velocity
Definition SpnEnums.hpp:1608
std::string Serialize() const
Definition SpnEnums.hpp:1664
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:1638
constexpr bool operator==(PIDRefSlopeECUTime_ClosedLoopModeValue data) const
Definition SpnEnums.hpp:1618
constexpr PIDRefSlopeECUTime_ClosedLoopModeValue(int value)
Definition SpnEnums.hpp:1610
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:1622
static constexpr int Position
Definition SpnEnums.hpp:1607
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:1648
Determines where to poll the reverse limit switch.
Definition SpnEnums.hpp:2911
static constexpr int RemoteCANdiS2
Use another CANdi on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2953
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:2923
constexpr ReverseLimitSourceValue(int value)
Definition SpnEnums.hpp:2959
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2997
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2941
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2935
static constexpr int RemoteCANdiS1
Use another CANdi on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Definition SpnEnums.hpp:2947
std::string Serialize() const
Definition SpnEnums.hpp:3019
int value
Definition SpnEnums.hpp:2913
friend std::ostream & operator<<(std::ostream &os, ReverseLimitSourceValue data)
Definition SpnEnums.hpp:3013
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:2928
constexpr bool operator==(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2967
constexpr bool operator<(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2983
constexpr bool operator!=(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2975
static constexpr int LimitSwitchPin
Use the reverse limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2918
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2987
constexpr ReverseLimitSourceValue()
Definition SpnEnums.hpp:2963
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2979
static constexpr int Disabled
Disable the reverse limit switch.
Definition SpnEnums.hpp:2957
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2971
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2824
friend std::ostream & operator<<(std::ostream &os, ReverseLimitTypeValue data)
Definition SpnEnums.hpp:2879
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2829
constexpr bool operator!=(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2847
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2859
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2869
constexpr ReverseLimitTypeValue()
Definition SpnEnums.hpp:2835
constexpr bool operator<(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2855
constexpr bool operator==(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2839
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2843
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2828
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2851
std::string Serialize() const
Definition SpnEnums.hpp:2885
int value
Definition SpnEnums.hpp:2826
constexpr ReverseLimitTypeValue(int value)
Definition SpnEnums.hpp:2831
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
What value the Signal 1 input (S1IN) needs to be for the CANdi to detect as Closed.
Definition SpnEnums.hpp:4698
int value
Definition SpnEnums.hpp:4700
constexpr bool operator==(S1CloseStateValue data) const
Definition SpnEnums.hpp:4735
static constexpr int CloseWhenNotHigh
The S1 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:4713
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4739
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4755
static constexpr int CloseWhenNotFloating
The S1 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:4705
static constexpr int CloseWhenFloating
The S1 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:4709
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4765
static constexpr int CloseWhenNotLow
The S1 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:4721
static constexpr int CloseWhenLow
The S1 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:4725
constexpr S1CloseStateValue(int value)
Definition SpnEnums.hpp:4727
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4747
std::string Serialize() const
Definition SpnEnums.hpp:4785
friend std::ostream & operator<<(std::ostream &os, S1CloseStateValue data)
Definition SpnEnums.hpp:4779
constexpr bool operator<(S1CloseStateValue data) const
Definition SpnEnums.hpp:4751
constexpr S1CloseStateValue()
Definition SpnEnums.hpp:4731
constexpr bool operator!=(S1CloseStateValue data) const
Definition SpnEnums.hpp:4743
static constexpr int CloseWhenHigh
The S1 input will be treated as closed when it is High.
Definition SpnEnums.hpp:4717
The floating state of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:4158
std::string Serialize() const
Definition SpnEnums.hpp:4239
int value
Definition SpnEnums.hpp:4160
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:4171
constexpr S1FloatStateValue()
Definition SpnEnums.hpp:4187
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4211
friend std::ostream & operator<<(std::ostream &os, S1FloatStateValue data)
Definition SpnEnums.hpp:4233
constexpr S1FloatStateValue(int value)
Definition SpnEnums.hpp:4183
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4221
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4203
constexpr bool operator==(S1FloatStateValue data) const
Definition SpnEnums.hpp:4191
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:4181
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:4176
constexpr bool operator<(S1FloatStateValue data) const
Definition SpnEnums.hpp:4207
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4195
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:4166
constexpr bool operator!=(S1FloatStateValue data) const
Definition SpnEnums.hpp:4199
State of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:3990
constexpr S1StateValue(int value)
Definition SpnEnums.hpp:4007
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:4001
constexpr S1StateValue()
Definition SpnEnums.hpp:4011
std::string Serialize() const
Definition SpnEnums.hpp:4062
constexpr bool operator==(S1StateValue data) const
Definition SpnEnums.hpp:4015
int value
Definition SpnEnums.hpp:3992
constexpr bool operator!=(S1StateValue data) const
Definition SpnEnums.hpp:4023
constexpr bool operator<(S1StateValue data) const
Definition SpnEnums.hpp:4031
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:4005
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4019
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4035
friend std::ostream & operator<<(std::ostream &os, S1StateValue data)
Definition SpnEnums.hpp:4056
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:3997
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4045
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4027
What value the Signal 2 input (S2IN) needs to be for the CANdi to detect as Closed.
Definition SpnEnums.hpp:4801
constexpr S2CloseStateValue()
Definition SpnEnums.hpp:4834
static constexpr int CloseWhenNotLow
The S2 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:4824
int value
Definition SpnEnums.hpp:4803
std::string Serialize() const
Definition SpnEnums.hpp:4888
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4842
constexpr bool operator==(S2CloseStateValue data) const
Definition SpnEnums.hpp:4838
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4850
static constexpr int CloseWhenNotHigh
The S2 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:4816
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4858
constexpr bool operator!=(S2CloseStateValue data) const
Definition SpnEnums.hpp:4846
constexpr S2CloseStateValue(int value)
Definition SpnEnums.hpp:4830
constexpr bool operator<(S2CloseStateValue data) const
Definition SpnEnums.hpp:4854
static constexpr int CloseWhenLow
The S2 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:4828
static constexpr int CloseWhenHigh
The S2 input will be treated as closed when it is High.
Definition SpnEnums.hpp:4820
static constexpr int CloseWhenFloating
The S2 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:4812
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4868
friend std::ostream & operator<<(std::ostream &os, S2CloseStateValue data)
Definition SpnEnums.hpp:4882
static constexpr int CloseWhenNotFloating
The S2 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:4808
The floating state of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:4251
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4304
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4296
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:4264
constexpr bool operator<(S2FloatStateValue data) const
Definition SpnEnums.hpp:4300
constexpr bool operator==(S2FloatStateValue data) const
Definition SpnEnums.hpp:4284
constexpr bool operator!=(S2FloatStateValue data) const
Definition SpnEnums.hpp:4292
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4314
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:4274
constexpr S2FloatStateValue(int value)
Definition SpnEnums.hpp:4276
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:4269
std::string Serialize() const
Definition SpnEnums.hpp:4332
int value
Definition SpnEnums.hpp:4253
constexpr S2FloatStateValue()
Definition SpnEnums.hpp:4280
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4288
friend std::ostream & operator<<(std::ostream &os, S2FloatStateValue data)
Definition SpnEnums.hpp:4326
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:4259
State of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:4074
friend std::ostream & operator<<(std::ostream &os, S2StateValue data)
Definition SpnEnums.hpp:4140
constexpr bool operator==(S2StateValue data) const
Definition SpnEnums.hpp:4099
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:4089
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4111
std::string Serialize() const
Definition SpnEnums.hpp:4146
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4129
int value
Definition SpnEnums.hpp:4076
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4119
constexpr S2StateValue(int value)
Definition SpnEnums.hpp:4091
constexpr bool operator<(S2StateValue data) const
Definition SpnEnums.hpp:4115
constexpr S2StateValue()
Definition SpnEnums.hpp:4095
constexpr bool operator!=(S2StateValue data) const
Definition SpnEnums.hpp:4107
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:4081
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:4085
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4103
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
The relationship between the motor controlled by a Talon and the external sensor connected to the dat...
Definition SpnEnums.hpp:4615
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4640
int value
Definition SpnEnums.hpp:4617
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4648
constexpr bool operator!=(SensorPhaseValue data) const
Definition SpnEnums.hpp:4644
constexpr bool operator<(SensorPhaseValue data) const
Definition SpnEnums.hpp:4652
constexpr SensorPhaseValue(int value)
Definition SpnEnums.hpp:4628
std::string Serialize() const
Definition SpnEnums.hpp:4682
static constexpr int Aligned
The sensor direction is normally aligned with the motor.
Definition SpnEnums.hpp:4622
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4666
static constexpr int Opposed
The sensor direction is normally opposed to the motor.
Definition SpnEnums.hpp:4626
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4656
constexpr bool operator==(SensorPhaseValue data) const
Definition SpnEnums.hpp:4636
friend std::ostream & operator<<(std::ostream &os, SensorPhaseValue data)
Definition SpnEnums.hpp:4676
constexpr SensorPhaseValue()
Definition SpnEnums.hpp:4632
Static Feedforward Sign during position closed loop.
Definition SpnEnums.hpp:3366
std::string Serialize() const
Definition SpnEnums.hpp:3438
friend std::ostream & operator<<(std::ostream &os, StaticFeedforwardSignValue data)
Definition SpnEnums.hpp:3432
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3396
constexpr bool operator!=(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3400
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3422
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3412
static constexpr int UseVelocitySign
Use the velocity reference sign.
Definition SpnEnums.hpp:3375
constexpr StaticFeedforwardSignValue()
Definition SpnEnums.hpp:3388
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3404
constexpr bool operator==(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3392
static constexpr int UseClosedLoopSign
Use the sign of closed loop error.
Definition SpnEnums.hpp:3382
constexpr bool operator<(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3408
constexpr StaticFeedforwardSignValue(int value)
Definition SpnEnums.hpp:3384
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:3670
constexpr UpdateModeValue()
Definition SpnEnums.hpp:3693
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3727
int value
Definition SpnEnums.hpp:3672
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3717
static constexpr int ShortRangeUserFreq
Uses short-range detection mode for improved detection under high ambient infrared light conditions.
Definition SpnEnums.hpp:3683
std::string Serialize() const
Definition SpnEnums.hpp:3744
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3709
friend std::ostream & operator<<(std::ostream &os, UpdateModeValue data)
Definition SpnEnums.hpp:3738
constexpr bool operator<(UpdateModeValue data) const
Definition SpnEnums.hpp:3713
constexpr bool operator==(UpdateModeValue data) const
Definition SpnEnums.hpp:3697
static constexpr int ShortRange100Hz
Updates distance/proximity at 100hz using short-range detection mode.
Definition SpnEnums.hpp:3677
constexpr UpdateModeValue(int value)
Definition SpnEnums.hpp:3689
constexpr bool operator!=(UpdateModeValue data) const
Definition SpnEnums.hpp:3705
static constexpr int LongRangeUserFreq
Uses long-range detection mode and user-specified update frequency.
Definition SpnEnums.hpp:3687
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3701
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18