CTRE Phoenix 6 C++ 25.3.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 counter-clockwise motion.
2229 */
2230 static constexpr int CounterClockwise_Positive = 0;
2231 /**
2232 * \brief Positive motor output results in 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 the CTR Electronics' CANdi™. Talon will update its position
2470 * and velocity whenever the CTR Electronics' CANdi™ publishes its
2471 * information on CAN bus, and the Talon internal 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 the CTR Electronics' CANdi™. Talon will update its position
2477 * and velocity whenever the CTR Electronics' CANdi™ publishes its
2478 * information on CAN bus, and the Talon internal 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 * the CTR Electronics' CANdi™. Talon will update its position and
2484 * velocity whenever the CTR Electronics' CANdi™ publishes its
2485 * information on CAN bus, and the Talon internal rotor 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 the CTR Electronics' CANdi™,
2491 * which provides the best possible position and velocity for accuracy
2492 * and bandwidth (this also requires setting FeedbackRemoteSensorID).
2493 * FusedCANdi was 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 the CTR Electronics' CANdi™,
2499 * which provides the best possible position and velocity for accuracy
2500 * and bandwidth (this also requires setting FeedbackRemoteSensorID).
2501 * FusedCANdi was 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 the CTR Electronics' CANdi™. This
2507 * provides velocity and relative position measurements. This also
2508 * requires setting 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 CTR Electronics' CANdi™ failing in such a way
2519 * that it reports a position that does not match the mechanism, such as
2520 * the sensor 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 CTR Electronics' CANdi™ failing in such a way
2531 * that it reports a position that does not match the mechanism, such as
2532 * the sensor 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 CTR Electronics' CANdi™ on the same CAN bus (this also
2736 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2737 * assert when the CTR Electronics' CANdi™ Signal 1 Input (S1IN) pin
2738 * matches the configured closed state.
2739 */
2740 static constexpr int RemoteCANdiS1 = 7;
2741 /**
2742 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
2743 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2744 * assert when the CTR Electronics' CANdi™ Signal 2 Input (S2IN) pin
2745 * matches the configured closed state.
2746 */
2747 static constexpr int RemoteCANdiS2 = 8;
2748 /**
2749 * \brief Disable the forward limit switch.
2750 */
2751 static constexpr int Disabled = 3;
2752
2754 value{value}
2755 {}
2756
2758 value{-1}
2759 {}
2760
2761 constexpr bool operator==(ForwardLimitSourceValue data) const
2762 {
2763 return this->value == data.value;
2764 }
2765 constexpr bool operator==(int data) const
2766 {
2767 return this->value == data;
2768 }
2769 constexpr bool operator!=(ForwardLimitSourceValue data) const
2770 {
2771 return this->value != data.value;
2772 }
2773 constexpr bool operator!=(int data) const
2774 {
2775 return this->value != data;
2776 }
2777 constexpr bool operator<(ForwardLimitSourceValue data) const
2778 {
2779 return this->value < data.value;
2780 }
2781 constexpr bool operator<(int data) const
2782 {
2783 return this->value < data;
2784 }
2785
2786 /**
2787 * \brief Gets the string representation of this enum
2788 *
2789 * \returns String representation of this enum
2790 */
2791 std::string ToString() const
2792 {
2793 switch (value)
2794 {
2795 case ForwardLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
2796 case ForwardLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
2797 case ForwardLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
2798 case ForwardLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
2799 case ForwardLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
2800 case ForwardLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
2801 case ForwardLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
2802 case ForwardLimitSourceValue::Disabled: return "Disabled";
2803 default: return "Invalid Value";
2804 }
2805 }
2806
2807 friend std::ostream &operator<<(std::ostream &os, ForwardLimitSourceValue data)
2808 {
2809 os << data.ToString();
2810 return os;
2811 }
2812
2813 std::string Serialize() const
2814 {
2815 std::stringstream ss;
2816 ss << "u_" << this->value;
2817 return ss.str();
2818 }
2819};
2820
2821/**
2822 * \brief Determines if the reverse limit switch is normally-open (default) or
2823 * normally-closed.
2824 */
2826{
2827public:
2829
2830 static constexpr int NormallyOpen = 0;
2831 static constexpr int NormallyClosed = 1;
2832
2834 value{value}
2835 {}
2836
2838 value{-1}
2839 {}
2840
2841 constexpr bool operator==(ReverseLimitTypeValue data) const
2842 {
2843 return this->value == data.value;
2844 }
2845 constexpr bool operator==(int data) const
2846 {
2847 return this->value == data;
2848 }
2849 constexpr bool operator!=(ReverseLimitTypeValue data) const
2850 {
2851 return this->value != data.value;
2852 }
2853 constexpr bool operator!=(int data) const
2854 {
2855 return this->value != data;
2856 }
2857 constexpr bool operator<(ReverseLimitTypeValue data) const
2858 {
2859 return this->value < data.value;
2860 }
2861 constexpr bool operator<(int data) const
2862 {
2863 return this->value < data;
2864 }
2865
2866 /**
2867 * \brief Gets the string representation of this enum
2868 *
2869 * \returns String representation of this enum
2870 */
2871 std::string ToString() const
2872 {
2873 switch (value)
2874 {
2875 case ReverseLimitTypeValue::NormallyOpen: return "NormallyOpen";
2876 case ReverseLimitTypeValue::NormallyClosed: return "NormallyClosed";
2877 default: return "Invalid Value";
2878 }
2879 }
2880
2881 friend std::ostream &operator<<(std::ostream &os, ReverseLimitTypeValue data)
2882 {
2883 os << data.ToString();
2884 return os;
2885 }
2886
2887 std::string Serialize() const
2888 {
2889 std::stringstream ss;
2890 ss << "u_" << this->value;
2891 return ss.str();
2892 }
2893};
2894
2895/**
2896 * \brief Determines where to poll the reverse limit switch. This defaults to
2897 * the reverse limit switch pin on the limit switch connector.
2898 *
2899 * Choose RemoteTalonFX to use the reverse limit switch attached to
2900 * another Talon FX on the same CAN bus (this also requires setting
2901 * ReverseLimitRemoteSensorID).
2902 *
2903 * Choose RemoteCANifier to use the reverse limit switch attached to
2904 * another CANifier on the same CAN bus (this also requires setting
2905 * ReverseLimitRemoteSensorID).
2906 *
2907 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
2908 * (this also requires setting ReverseLimitRemoteSensorID). The reverse
2909 * limit will assert when the CANcoder magnet strength changes from BAD
2910 * (red) to ADEQUATE (orange) or GOOD (green).
2911 */
2913{
2914public:
2916
2917 /**
2918 * \brief Use the reverse limit switch pin on the limit switch connector.
2919 */
2920 static constexpr int LimitSwitchPin = 0;
2921 /**
2922 * \brief Use the reverse limit switch attached to another Talon FX on the same
2923 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2924 */
2925 static constexpr int RemoteTalonFX = 1;
2926 /**
2927 * \brief Use the reverse limit switch attached to another CANifier on the same
2928 * CAN bus (this also requires setting ReverseLimitRemoteSensorID).
2929 */
2930 static constexpr int RemoteCANifier = 2;
2931 /**
2932 * \brief Use another CANcoder on the same CAN bus (this also requires setting
2933 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2934 * CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange)
2935 * or GOOD (green).
2936 */
2937 static constexpr int RemoteCANcoder = 4;
2938 /**
2939 * \brief Use another CANrange on the same CAN bus (this also requires setting
2940 * ReverseLimitRemoteSensorID). The reverse limit will assert when the
2941 * CANrange proximity detect is tripped.
2942 */
2943 static constexpr int RemoteCANrange = 6;
2944 /**
2945 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
2946 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2947 * assert when the CTR Electronics' CANdi™ Signal 1 Input (S1IN) pin
2948 * matches the configured closed state.
2949 */
2950 static constexpr int RemoteCANdiS1 = 7;
2951 /**
2952 * \brief Use another CTR Electronics' CANdi™ on the same CAN bus (this also
2953 * requires setting ForwardLimitRemoteSensorID). The forward limit will
2954 * assert when CANdi™ Signal 2 Input (S2IN) pin matches the configured
2955 * closed state.
2956 */
2957 static constexpr int RemoteCANdiS2 = 8;
2958 /**
2959 * \brief Disable the reverse limit switch.
2960 */
2961 static constexpr int Disabled = 3;
2962
2964 value{value}
2965 {}
2966
2968 value{-1}
2969 {}
2970
2971 constexpr bool operator==(ReverseLimitSourceValue data) const
2972 {
2973 return this->value == data.value;
2974 }
2975 constexpr bool operator==(int data) const
2976 {
2977 return this->value == data;
2978 }
2979 constexpr bool operator!=(ReverseLimitSourceValue data) const
2980 {
2981 return this->value != data.value;
2982 }
2983 constexpr bool operator!=(int data) const
2984 {
2985 return this->value != data;
2986 }
2987 constexpr bool operator<(ReverseLimitSourceValue data) const
2988 {
2989 return this->value < data.value;
2990 }
2991 constexpr bool operator<(int data) const
2992 {
2993 return this->value < data;
2994 }
2995
2996 /**
2997 * \brief Gets the string representation of this enum
2998 *
2999 * \returns String representation of this enum
3000 */
3001 std::string ToString() const
3002 {
3003 switch (value)
3004 {
3005 case ReverseLimitSourceValue::LimitSwitchPin: return "LimitSwitchPin";
3006 case ReverseLimitSourceValue::RemoteTalonFX: return "RemoteTalonFX";
3007 case ReverseLimitSourceValue::RemoteCANifier: return "RemoteCANifier";
3008 case ReverseLimitSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3009 case ReverseLimitSourceValue::RemoteCANrange: return "RemoteCANrange";
3010 case ReverseLimitSourceValue::RemoteCANdiS1: return "RemoteCANdiS1";
3011 case ReverseLimitSourceValue::RemoteCANdiS2: return "RemoteCANdiS2";
3012 case ReverseLimitSourceValue::Disabled: return "Disabled";
3013 default: return "Invalid Value";
3014 }
3015 }
3016
3017 friend std::ostream &operator<<(std::ostream &os, ReverseLimitSourceValue data)
3018 {
3019 os << data.ToString();
3020 return os;
3021 }
3022
3023 std::string Serialize() const
3024 {
3025 std::stringstream ss;
3026 ss << "u_" << this->value;
3027 return ss.str();
3028 }
3029};
3030
3031/**
3032 * \brief Magnet health as measured by CANcoder.
3033 *
3034 * Red indicates too close or too far, Orange is adequate but with
3035 * reduced accuracy, green is ideal. Invalid means the accuracy cannot be
3036 * determined.
3037 */
3039{
3040public:
3042
3043 /**
3044 * \brief The magnet is too close or too far from the CANcoder.
3045 */
3046 static constexpr int Magnet_Red = 1;
3047 /**
3048 * \brief Magnet health is adequate but with reduced accuracy.
3049 */
3050 static constexpr int Magnet_Orange = 2;
3051 /**
3052 * \brief Magnet health is ideal.
3053 */
3054 static constexpr int Magnet_Green = 3;
3055 /**
3056 * \brief The accuracy cannot be determined.
3057 */
3058 static constexpr int Magnet_Invalid = 0;
3059
3060 constexpr MagnetHealthValue(int value) :
3061 value{value}
3062 {}
3063
3064 constexpr MagnetHealthValue() :
3065 value{-1}
3066 {}
3067
3068 constexpr bool operator==(MagnetHealthValue data) const
3069 {
3070 return this->value == data.value;
3071 }
3072 constexpr bool operator==(int data) const
3073 {
3074 return this->value == data;
3075 }
3076 constexpr bool operator!=(MagnetHealthValue data) const
3077 {
3078 return this->value != data.value;
3079 }
3080 constexpr bool operator!=(int data) const
3081 {
3082 return this->value != data;
3083 }
3084 constexpr bool operator<(MagnetHealthValue data) const
3085 {
3086 return this->value < data.value;
3087 }
3088 constexpr bool operator<(int data) const
3089 {
3090 return this->value < data;
3091 }
3092
3093 /**
3094 * \brief Gets the string representation of this enum
3095 *
3096 * \returns String representation of this enum
3097 */
3098 std::string ToString() const
3099 {
3100 switch (value)
3101 {
3102 case MagnetHealthValue::Magnet_Red: return "Magnet_Red";
3103 case MagnetHealthValue::Magnet_Orange: return "Magnet_Orange";
3104 case MagnetHealthValue::Magnet_Green: return "Magnet_Green";
3105 case MagnetHealthValue::Magnet_Invalid: return "Magnet_Invalid";
3106 default: return "Invalid Value";
3107 }
3108 }
3109
3110 friend std::ostream &operator<<(std::ostream &os, MagnetHealthValue data)
3111 {
3112 os << data.ToString();
3113 return os;
3114 }
3115
3116 std::string Serialize() const
3117 {
3118 std::stringstream ss;
3119 ss << "u_" << this->value;
3120 return ss.str();
3121 }
3122};
3123
3124/**
3125 * \brief The applied output of the bridge.
3126 */
3128{
3129public:
3131
3132 static constexpr int BridgeReq_Coast = 0;
3133 static constexpr int BridgeReq_Brake = 1;
3134 static constexpr int BridgeReq_Trapez = 6;
3135 static constexpr int BridgeReq_FOCTorque = 7;
3136 static constexpr int BridgeReq_MusicTone = 8;
3137 static constexpr int BridgeReq_FOCEasy = 9;
3138 static constexpr int BridgeReq_FaultBrake = 12;
3139 static constexpr int BridgeReq_FaultCoast = 13;
3140 static constexpr int BridgeReq_ActiveBrake = 14;
3141 static constexpr int BridgeReq_VariableBrake = 15;
3142
3143 constexpr BridgeOutputValue(int value) :
3144 value{value}
3145 {}
3146
3147 constexpr BridgeOutputValue() :
3148 value{-1}
3149 {}
3150
3151 constexpr bool operator==(BridgeOutputValue data) const
3152 {
3153 return this->value == data.value;
3154 }
3155 constexpr bool operator==(int data) const
3156 {
3157 return this->value == data;
3158 }
3159 constexpr bool operator!=(BridgeOutputValue data) const
3160 {
3161 return this->value != data.value;
3162 }
3163 constexpr bool operator!=(int data) const
3164 {
3165 return this->value != data;
3166 }
3167 constexpr bool operator<(BridgeOutputValue data) const
3168 {
3169 return this->value < data.value;
3170 }
3171 constexpr bool operator<(int data) const
3172 {
3173 return this->value < data;
3174 }
3175
3176 /**
3177 * \brief Gets the string representation of this enum
3178 *
3179 * \returns String representation of this enum
3180 */
3181 std::string ToString() const
3182 {
3183 switch (value)
3184 {
3185 case BridgeOutputValue::BridgeReq_Coast: return "BridgeReq_Coast";
3186 case BridgeOutputValue::BridgeReq_Brake: return "BridgeReq_Brake";
3187 case BridgeOutputValue::BridgeReq_Trapez: return "BridgeReq_Trapez";
3188 case BridgeOutputValue::BridgeReq_FOCTorque: return "BridgeReq_FOCTorque";
3189 case BridgeOutputValue::BridgeReq_MusicTone: return "BridgeReq_MusicTone";
3190 case BridgeOutputValue::BridgeReq_FOCEasy: return "BridgeReq_FOCEasy";
3191 case BridgeOutputValue::BridgeReq_FaultBrake: return "BridgeReq_FaultBrake";
3192 case BridgeOutputValue::BridgeReq_FaultCoast: return "BridgeReq_FaultCoast";
3193 case BridgeOutputValue::BridgeReq_ActiveBrake: return "BridgeReq_ActiveBrake";
3194 case BridgeOutputValue::BridgeReq_VariableBrake: return "BridgeReq_VariableBrake";
3195 default: return "Invalid Value";
3196 }
3197 }
3198
3199 friend std::ostream &operator<<(std::ostream &os, BridgeOutputValue data)
3200 {
3201 os << data.ToString();
3202 return os;
3203 }
3204
3205 std::string Serialize() const
3206 {
3207 std::stringstream ss;
3208 ss << "u_" << this->value;
3209 return ss.str();
3210 }
3211};
3212
3213/**
3214 * \brief Choose what sensor source is used for differential control of a
3215 * mechanism. The default is Disabled. All other options require
3216 * setting the DifferentialTalonFXSensorID, as the average of this Talon
3217 * FX's sensor and the remote TalonFX's sensor is used for the
3218 * differential controller's primary targets.
3219 *
3220 * Choose RemoteTalonFX_Diff to use another TalonFX on the same CAN bus.
3221 * Talon FX will update its differential position and velocity whenever
3222 * the remote TalonFX publishes its information on CAN bus. The
3223 * differential controller will use the difference between this TalonFX's
3224 * sensor and the remote Talon FX's sensor for the differential component
3225 * of the output.
3226 *
3227 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
3228 * to use another Pigeon2 on the same CAN bus (this also requires setting
3229 * DifferentialRemoteSensorID). Talon FX will update its differential
3230 * position to match the selected value whenever Pigeon2 publishes its
3231 * information on CAN bus. Note that the Talon FX differential position
3232 * will be in rotations and not degrees.
3233 *
3234 * Choose RemoteCANcoder to use another CANcoder on the same CAN bus
3235 * (this also requires setting DifferentialRemoteSensorID). Talon FX
3236 * will update its differential position and velocity to match the
3237 * CANcoder whenever CANcoder publishes its information on CAN bus.
3238 */
3240{
3241public:
3243
3244 /**
3245 * \brief Disable differential control.
3246 */
3247 static constexpr int Disabled = 0;
3248 /**
3249 * \brief Use another TalonFX on the same CAN bus. Talon FX will update its
3250 * differential position and velocity whenever the remote TalonFX
3251 * publishes its information on CAN bus. The differential controller
3252 * will use the difference between this TalonFX's sensor and the remote
3253 * Talon FX's sensor for the differential component of the output.
3254 */
3255 static constexpr int RemoteTalonFX_Diff = 1;
3256 /**
3257 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3258 * DifferentialRemoteSensorID). Talon FX will update its differential
3259 * position to match the Pigeon2 yaw whenever Pigeon2 publishes its
3260 * information on CAN bus. Note that the Talon FX differential position
3261 * will be in rotations and not degrees.
3262 */
3263 static constexpr int RemotePigeon2_Yaw = 2;
3264 /**
3265 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3266 * DifferentialRemoteSensorID). Talon FX will update its differential
3267 * position to match the Pigeon2 pitch whenever Pigeon2 publishes its
3268 * information on CAN bus. Note that the Talon FX differential position
3269 * will be in rotations and not degrees.
3270 */
3271 static constexpr int RemotePigeon2_Pitch = 3;
3272 /**
3273 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
3274 * DifferentialRemoteSensorID). Talon FX will update its differential
3275 * position to match the Pigeon2 roll whenever Pigeon2 publishes its
3276 * information on CAN bus. Note that the Talon FX differential position
3277 * will be in rotations and not degrees.
3278 */
3279 static constexpr int RemotePigeon2_Roll = 4;
3280 /**
3281 * \brief Use another CANcoder on the same CAN bus (this also requires setting
3282 * DifferentialRemoteSensorID). Talon FX will update its differential
3283 * position and velocity to match the CANcoder whenever CANcoder
3284 * publishes its information on CAN bus.
3285 */
3286 static constexpr int RemoteCANcoder = 5;
3287
3289 value{value}
3290 {}
3291
3293 value{-1}
3294 {}
3295
3297 {
3298 return this->value == data.value;
3299 }
3300 constexpr bool operator==(int data) const
3301 {
3302 return this->value == data;
3303 }
3305 {
3306 return this->value != data.value;
3307 }
3308 constexpr bool operator!=(int data) const
3309 {
3310 return this->value != data;
3311 }
3312 constexpr bool operator<(DifferentialSensorSourceValue data) const
3313 {
3314 return this->value < data.value;
3315 }
3316 constexpr bool operator<(int data) const
3317 {
3318 return this->value < data;
3319 }
3320
3321 /**
3322 * \brief Gets the string representation of this enum
3323 *
3324 * \returns String representation of this enum
3325 */
3326 std::string ToString() const
3327 {
3328 switch (value)
3329 {
3330 case DifferentialSensorSourceValue::Disabled: return "Disabled";
3331 case DifferentialSensorSourceValue::RemoteTalonFX_Diff: return "RemoteTalonFX_Diff";
3332 case DifferentialSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
3333 case DifferentialSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
3334 case DifferentialSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
3335 case DifferentialSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
3336 default: return "Invalid Value";
3337 }
3338 }
3339
3340 friend std::ostream &operator<<(std::ostream &os, DifferentialSensorSourceValue data)
3341 {
3342 os << data.ToString();
3343 return os;
3344 }
3345
3346 std::string Serialize() const
3347 {
3348 std::stringstream ss;
3349 ss << "u_" << this->value;
3350 return ss.str();
3351 }
3352};
3353
3354/**
3355 * \brief Static Feedforward Sign during position closed loop.
3356 *
3357 * This determines the sign of the applied kS during position closed-loop
3358 * modes. The default behavior uses the velocity reference sign. This
3359 * works well with velocity closed loop, Motion Magic® controls, and
3360 * position closed loop when velocity reference is specified (motion
3361 * profiling).
3362 *
3363 * However, when using position closed loop with zero velocity reference
3364 * (no motion profiling), the application may want to apply static
3365 * feedforward based on the sign of closed loop error instead. When doing
3366 * so, we recommend using the minimal amount of kS, otherwise the motor
3367 * output may dither when closed loop error is near zero.
3368 */
3370{
3371public:
3373
3374 /**
3375 * \brief Use the velocity reference sign. This works well with velocity closed
3376 * loop, Motion Magic® controls, and position closed loop when velocity
3377 * reference is specified (motion profiling).
3378 */
3379 static constexpr int UseVelocitySign = 0;
3380 /**
3381 * \brief Use the sign of closed loop error. This is useful when using position
3382 * closed loop with zero velocity reference (no motion profiling). We
3383 * recommend the minimal amount of kS, otherwise the motor output may
3384 * dither when closed loop error is near zero.
3385 */
3386 static constexpr int UseClosedLoopSign = 1;
3387
3389 value{value}
3390 {}
3391
3393 value{-1}
3394 {}
3395
3396 constexpr bool operator==(StaticFeedforwardSignValue data) const
3397 {
3398 return this->value == data.value;
3399 }
3400 constexpr bool operator==(int data) const
3401 {
3402 return this->value == data;
3403 }
3404 constexpr bool operator!=(StaticFeedforwardSignValue data) const
3405 {
3406 return this->value != data.value;
3407 }
3408 constexpr bool operator!=(int data) const
3409 {
3410 return this->value != data;
3411 }
3412 constexpr bool operator<(StaticFeedforwardSignValue data) const
3413 {
3414 return this->value < data.value;
3415 }
3416 constexpr bool operator<(int data) const
3417 {
3418 return this->value < data;
3419 }
3420
3421 /**
3422 * \brief Gets the string representation of this enum
3423 *
3424 * \returns String representation of this enum
3425 */
3426 std::string ToString() const
3427 {
3428 switch (value)
3429 {
3430 case StaticFeedforwardSignValue::UseVelocitySign: return "UseVelocitySign";
3431 case StaticFeedforwardSignValue::UseClosedLoopSign: return "UseClosedLoopSign";
3432 default: return "Invalid Value";
3433 }
3434 }
3435
3436 friend std::ostream &operator<<(std::ostream &os, StaticFeedforwardSignValue data)
3437 {
3438 os << data.ToString();
3439 return os;
3440 }
3441
3442 std::string Serialize() const
3443 {
3444 std::stringstream ss;
3445 ss << "u_" << this->value;
3446 return ss.str();
3447 }
3448};
3449
3450/**
3451 * \brief The type of motor attached to the Talon.
3452 *
3453 * \details This can be used to determine what motor is attached to the Talon
3454 * FX. Return will be "Unknown" if firmware is too old or device is
3455 * not present.
3456 */
3458{
3459public:
3461
3462 /**
3463 * \brief Talon could not determine the type of motor attached.
3464 */
3465 static constexpr int Unknown = 0;
3466 /**
3467 * \brief Talon is attached to an integrated Falcon motor.
3468 */
3469 static constexpr int Falcon500_Integrated = 1;
3470 /**
3471 * \brief Talon is attached to an integrated Kraken X60 motor.
3472 */
3473 static constexpr int KrakenX60_Integrated = 2;
3474 /**
3475 * \brief Talon is attached to an integrated Kraken X44 motor.
3476 */
3477 static constexpr int KrakenX44_Integrated = 3;
3478 /**
3479 * \brief Talon is connected to a CTR Electronics Minion® brushless three phase
3480 * motor.
3481 */
3482 static constexpr int Minion_JST = 4;
3483 /**
3484 * \brief Talon is connected to a third party brushed DC motor with leads A and
3485 * B.
3486 */
3487 static constexpr int Brushed_AB = 5;
3488 /**
3489 * \brief Talon is connected to a third party brushed DC motor with leads A and
3490 * C.
3491 */
3492 static constexpr int Brushed_AC = 6;
3493 /**
3494 * \brief Talon is connected to a third party brushed DC motor with leads B and
3495 * C.
3496 */
3497 static constexpr int Brushed_BC = 7;
3498 /**
3499 * \brief Talon is connected to a third party NEO brushless three phase motor.
3500 */
3501 static constexpr int NEO_JST = 8;
3502 /**
3503 * \brief Talon is connected to a third party NEO550 brushless three phase
3504 * motor.
3505 */
3506 static constexpr int NEO550_JST = 9;
3507 /**
3508 * \brief Talon is connected to a third party VORTEX brushless three phase
3509 * motor.
3510 */
3511 static constexpr int VORTEX_JST = 10;
3512
3514 value{value}
3515 {}
3516
3518 value{-1}
3519 {}
3520
3521 constexpr bool operator==(ConnectedMotorValue data) const
3522 {
3523 return this->value == data.value;
3524 }
3525 constexpr bool operator==(int data) const
3526 {
3527 return this->value == data;
3528 }
3529 constexpr bool operator!=(ConnectedMotorValue data) const
3530 {
3531 return this->value != data.value;
3532 }
3533 constexpr bool operator!=(int data) const
3534 {
3535 return this->value != data;
3536 }
3537 constexpr bool operator<(ConnectedMotorValue data) const
3538 {
3539 return this->value < data.value;
3540 }
3541 constexpr bool operator<(int data) const
3542 {
3543 return this->value < data;
3544 }
3545
3546 /**
3547 * \brief Gets the string representation of this enum
3548 *
3549 * \returns String representation of this enum
3550 */
3551 std::string ToString() const
3552 {
3553 switch (value)
3554 {
3555 case ConnectedMotorValue::Unknown: return "Unknown";
3556 case ConnectedMotorValue::Falcon500_Integrated: return "Falcon500_Integrated";
3557 case ConnectedMotorValue::KrakenX60_Integrated: return "KrakenX60_Integrated";
3558 case ConnectedMotorValue::KrakenX44_Integrated: return "KrakenX44_Integrated";
3559 case ConnectedMotorValue::Minion_JST: return "Minion_JST";
3560 case ConnectedMotorValue::Brushed_AB: return "Brushed_AB";
3561 case ConnectedMotorValue::Brushed_AC: return "Brushed_AC";
3562 case ConnectedMotorValue::Brushed_BC: return "Brushed_BC";
3563 case ConnectedMotorValue::NEO_JST: return "NEO_JST";
3564 case ConnectedMotorValue::NEO550_JST: return "NEO550_JST";
3565 case ConnectedMotorValue::VORTEX_JST: return "VORTEX_JST";
3566 default: return "Invalid Value";
3567 }
3568 }
3569
3570 friend std::ostream &operator<<(std::ostream &os, ConnectedMotorValue data)
3571 {
3572 os << data.ToString();
3573 return os;
3574 }
3575
3576 std::string Serialize() const
3577 {
3578 std::stringstream ss;
3579 ss << "u_" << this->value;
3580 return ss.str();
3581 }
3582};
3583
3584/**
3585 * \brief Health of the distance measurement.
3586 */
3588{
3589public:
3591
3592 /**
3593 * \brief Measurement is good.
3594 */
3595 static constexpr int Good = 0;
3596 /**
3597 * \brief Measurement is likely okay, but the target is either very far away or
3598 * moving very quickly.
3599 */
3600 static constexpr int Limited = 1;
3601 /**
3602 * \brief Measurement is compromised.
3603 */
3604 static constexpr int Bad = 2;
3605
3607 value{value}
3608 {}
3609
3611 value{-1}
3612 {}
3613
3614 constexpr bool operator==(MeasurementHealthValue data) const
3615 {
3616 return this->value == data.value;
3617 }
3618 constexpr bool operator==(int data) const
3619 {
3620 return this->value == data;
3621 }
3622 constexpr bool operator!=(MeasurementHealthValue data) const
3623 {
3624 return this->value != data.value;
3625 }
3626 constexpr bool operator!=(int data) const
3627 {
3628 return this->value != data;
3629 }
3630 constexpr bool operator<(MeasurementHealthValue data) const
3631 {
3632 return this->value < data.value;
3633 }
3634 constexpr bool operator<(int data) const
3635 {
3636 return this->value < data;
3637 }
3638
3639 /**
3640 * \brief Gets the string representation of this enum
3641 *
3642 * \returns String representation of this enum
3643 */
3644 std::string ToString() const
3645 {
3646 switch (value)
3647 {
3648 case MeasurementHealthValue::Good: return "Good";
3649 case MeasurementHealthValue::Limited: return "Limited";
3650 case MeasurementHealthValue::Bad: return "Bad";
3651 default: return "Invalid Value";
3652 }
3653 }
3654
3655 friend std::ostream &operator<<(std::ostream &os, MeasurementHealthValue data)
3656 {
3657 os << data.ToString();
3658 return os;
3659 }
3660
3661 std::string Serialize() const
3662 {
3663 std::stringstream ss;
3664 ss << "u_" << this->value;
3665 return ss.str();
3666 }
3667};
3668
3669/**
3670 * \brief Update mode of the CANrange. The CANrange supports short-range and
3671 * long-range detection at various update frequencies.
3672 */
3674{
3675public:
3677
3678 /**
3679 * \brief Updates distance/proximity at 100hz using short-range detection mode.
3680 */
3681 static constexpr int ShortRange100Hz = 0;
3682 /**
3683 * \brief Uses short-range detection mode for improved detection under high
3684 * ambient infrared light conditions. Uses user-specified update
3685 * frequency.
3686 */
3687 static constexpr int ShortRangeUserFreq = 1;
3688 /**
3689 * \brief Uses long-range detection mode and user-specified update frequency.
3690 */
3691 static constexpr int LongRangeUserFreq = 2;
3692
3693 constexpr UpdateModeValue(int value) :
3694 value{value}
3695 {}
3696
3697 constexpr UpdateModeValue() :
3698 value{-1}
3699 {}
3700
3701 constexpr bool operator==(UpdateModeValue data) const
3702 {
3703 return this->value == data.value;
3704 }
3705 constexpr bool operator==(int data) const
3706 {
3707 return this->value == data;
3708 }
3709 constexpr bool operator!=(UpdateModeValue data) const
3710 {
3711 return this->value != data.value;
3712 }
3713 constexpr bool operator!=(int data) const
3714 {
3715 return this->value != data;
3716 }
3717 constexpr bool operator<(UpdateModeValue data) const
3718 {
3719 return this->value < data.value;
3720 }
3721 constexpr bool operator<(int data) const
3722 {
3723 return this->value < data;
3724 }
3725
3726 /**
3727 * \brief Gets the string representation of this enum
3728 *
3729 * \returns String representation of this enum
3730 */
3731 std::string ToString() const
3732 {
3733 switch (value)
3734 {
3735 case UpdateModeValue::ShortRange100Hz: return "ShortRange100Hz";
3736 case UpdateModeValue::ShortRangeUserFreq: return "ShortRangeUserFreq";
3737 case UpdateModeValue::LongRangeUserFreq: return "LongRangeUserFreq";
3738 default: return "Invalid Value";
3739 }
3740 }
3741
3742 friend std::ostream &operator<<(std::ostream &os, UpdateModeValue data)
3743 {
3744 os << data.ToString();
3745 return os;
3746 }
3747
3748 std::string Serialize() const
3749 {
3750 std::stringstream ss;
3751 ss << "u_" << this->value;
3752 return ss.str();
3753 }
3754};
3755
3756/**
3757 * \brief Requires Phoenix Pro; Improves commutation and velocity measurement
3758 * for motors with hall sensors. Talon can use advanced features to
3759 * improve commutation and velocity measurement when using a motor with
3760 * hall sensors. This can improve peak efficiency by as high as 2% and
3761 * reduce noise in the measured velocity.
3762 */
3764{
3765public:
3767
3768 /**
3769 * \brief Talon will utilize hall sensors without advanced features.
3770 */
3771 static constexpr int Disabled = 0;
3772 /**
3773 * \brief Requires Phoenix Pro; Talon uses advanced features to improve
3774 * commutation and velocity measurement when using hall sensors. This
3775 * can improve peak efficiency by as high as 2% and reduce noise in the
3776 * measured velocity.
3777 */
3778 static constexpr int Enabled = 1;
3779
3781 value{value}
3782 {}
3783
3785 value{-1}
3786 {}
3787
3788 constexpr bool operator==(AdvancedHallSupportValue data) const
3789 {
3790 return this->value == data.value;
3791 }
3792 constexpr bool operator==(int data) const
3793 {
3794 return this->value == data;
3795 }
3796 constexpr bool operator!=(AdvancedHallSupportValue data) const
3797 {
3798 return this->value != data.value;
3799 }
3800 constexpr bool operator!=(int data) const
3801 {
3802 return this->value != data;
3803 }
3804 constexpr bool operator<(AdvancedHallSupportValue data) const
3805 {
3806 return this->value < data.value;
3807 }
3808 constexpr bool operator<(int data) const
3809 {
3810 return this->value < data;
3811 }
3812
3813 /**
3814 * \brief Gets the string representation of this enum
3815 *
3816 * \returns String representation of this enum
3817 */
3818 std::string ToString() const
3819 {
3820 switch (value)
3821 {
3822 case AdvancedHallSupportValue::Disabled: return "Disabled";
3823 case AdvancedHallSupportValue::Enabled: return "Enabled";
3824 default: return "Invalid Value";
3825 }
3826 }
3827
3828 friend std::ostream &operator<<(std::ostream &os, AdvancedHallSupportValue data)
3829 {
3830 os << data.ToString();
3831 return os;
3832 }
3833
3834 std::string Serialize() const
3835 {
3836 std::stringstream ss;
3837 ss << "u_" << this->value;
3838 return ss.str();
3839 }
3840};
3841
3842/**
3843 * \brief Selects the motor and motor connections used with Talon.
3844 *
3845 * This setting determines what kind of motor and sensors are used with
3846 * the Talon. This also determines what signals are used on the JST and
3847 * Gadgeteer port.
3848 *
3849 * Motor drive will not function correctly if this setting does not match
3850 * the physical setup.
3851 */
3853{
3854public:
3856
3857 /**
3858 * \brief Motor is not selected. This is the default setting to ensure the user
3859 * has an opportunity to select the correct motor arrangement before
3860 * attempting to drive motor.
3861 */
3862 static constexpr int Disabled = 0;
3863 /**
3864 * \brief CTR Electronics Minion® brushless three phase motor.
3865 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3866 * C).
3867 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3868 * on pin [5]. Motor JST cable can be plugged directly into the JST
3869 * connector.
3870 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3871 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3872 * pin [9].
3873 */
3874 static constexpr int Minion_JST = 1;
3875 /**
3876 * \brief Third party brushed DC motor with two leads.
3877 * Use the Brushed Motor Wiring config to determine which leads to use on
3878 * the Talon (motor leads may be flipped to correct for clockwise vs
3879 * counterclockwise).
3880 * Note that the invert configuration can still be used to invert rotor
3881 * orientation.
3882 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3883 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3884 * pin [9].
3885 */
3886 static constexpr int Brushed_DC = 2;
3887 /**
3888 * \brief Third party NEO brushless three phase motor (~6000 RPM at 12V).
3889 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3890 * C).
3891 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3892 * on pin [5]. Motor JST cable can be plugged directly into the JST
3893 * connector.
3894 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3895 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3896 * pin [9].
3897 */
3898 static constexpr int NEO_JST = 5;
3899 /**
3900 * \brief Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
3901 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3902 * C).
3903 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3904 * on pin [5]. Motor JST cable can be plugged directly into the JST
3905 * connector.
3906 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3907 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3908 * pin [9].
3909 */
3910 static constexpr int NEO550_JST = 6;
3911 /**
3912 * \brief Third party VORTEX brushless three phase motor.
3913 * Motor leads: red(terminal A), black (terminal B), and white (terminal
3914 * C).
3915 * JST Connector: hall [A, B, C] is on pins [4, 3, 2] and temperature is
3916 * on pin [5]. Motor JST cable can be plugged directly into the JST
3917 * connector.
3918 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
3919 * [forward, reverse] are on pins [4, 8], and pulse width position is on
3920 * pin [9].
3921 */
3922 static constexpr int VORTEX_JST = 7;
3923
3925 value{value}
3926 {}
3927
3929 value{-1}
3930 {}
3931
3932 constexpr bool operator==(MotorArrangementValue data) const
3933 {
3934 return this->value == data.value;
3935 }
3936 constexpr bool operator==(int data) const
3937 {
3938 return this->value == data;
3939 }
3940 constexpr bool operator!=(MotorArrangementValue data) const
3941 {
3942 return this->value != data.value;
3943 }
3944 constexpr bool operator!=(int data) const
3945 {
3946 return this->value != data;
3947 }
3948 constexpr bool operator<(MotorArrangementValue data) const
3949 {
3950 return this->value < data.value;
3951 }
3952 constexpr bool operator<(int data) const
3953 {
3954 return this->value < data;
3955 }
3956
3957 /**
3958 * \brief Gets the string representation of this enum
3959 *
3960 * \returns String representation of this enum
3961 */
3962 std::string ToString() const
3963 {
3964 switch (value)
3965 {
3966 case MotorArrangementValue::Disabled: return "Disabled";
3967 case MotorArrangementValue::Minion_JST: return "Minion_JST";
3968 case MotorArrangementValue::Brushed_DC: return "Brushed_DC";
3969 case MotorArrangementValue::NEO_JST: return "NEO_JST";
3970 case MotorArrangementValue::NEO550_JST: return "NEO550_JST";
3971 case MotorArrangementValue::VORTEX_JST: return "VORTEX_JST";
3972 default: return "Invalid Value";
3973 }
3974 }
3975
3976 friend std::ostream &operator<<(std::ostream &os, MotorArrangementValue data)
3977 {
3978 os << data.ToString();
3979 return os;
3980 }
3981
3982 std::string Serialize() const
3983 {
3984 std::stringstream ss;
3985 ss << "u_" << this->value;
3986 return ss.str();
3987 }
3988};
3989
3990/**
3991 * \brief State of the Signal 1 input (S1IN).
3992 */
3994{
3995public:
3997
3998 /**
3999 * \brief Input is not driven high or low, it is disconnected from load.
4000 */
4001 static constexpr int Floating = 0;
4002 /**
4003 * \brief Input is driven low (below 0.5V).
4004 */
4005 static constexpr int Low = 1;
4006 /**
4007 * \brief Input is driven high (above 3V).
4008 */
4009 static constexpr int High = 2;
4010
4011 constexpr S1StateValue(int value) :
4012 value{value}
4013 {}
4014
4015 constexpr S1StateValue() :
4016 value{-1}
4017 {}
4018
4019 constexpr bool operator==(S1StateValue data) const
4020 {
4021 return this->value == data.value;
4022 }
4023 constexpr bool operator==(int data) const
4024 {
4025 return this->value == data;
4026 }
4027 constexpr bool operator!=(S1StateValue data) const
4028 {
4029 return this->value != data.value;
4030 }
4031 constexpr bool operator!=(int data) const
4032 {
4033 return this->value != data;
4034 }
4035 constexpr bool operator<(S1StateValue data) const
4036 {
4037 return this->value < data.value;
4038 }
4039 constexpr bool operator<(int data) const
4040 {
4041 return this->value < data;
4042 }
4043
4044 /**
4045 * \brief Gets the string representation of this enum
4046 *
4047 * \returns String representation of this enum
4048 */
4049 std::string ToString() const
4050 {
4051 switch (value)
4052 {
4053 case S1StateValue::Floating: return "Floating";
4054 case S1StateValue::Low: return "Low";
4055 case S1StateValue::High: return "High";
4056 default: return "Invalid Value";
4057 }
4058 }
4059
4060 friend std::ostream &operator<<(std::ostream &os, S1StateValue data)
4061 {
4062 os << data.ToString();
4063 return os;
4064 }
4065
4066 std::string Serialize() const
4067 {
4068 std::stringstream ss;
4069 ss << "u_" << this->value;
4070 return ss.str();
4071 }
4072};
4073
4074/**
4075 * \brief State of the Signal 2 input (S2IN).
4076 */
4078{
4079public:
4081
4082 /**
4083 * \brief Input is not driven high or low, it is disconnected from load.
4084 */
4085 static constexpr int Floating = 0;
4086 /**
4087 * \brief Input is driven low (below 0.5V).
4088 */
4089 static constexpr int Low = 1;
4090 /**
4091 * \brief Input is driven high (above 3V).
4092 */
4093 static constexpr int High = 2;
4094
4095 constexpr S2StateValue(int value) :
4096 value{value}
4097 {}
4098
4099 constexpr S2StateValue() :
4100 value{-1}
4101 {}
4102
4103 constexpr bool operator==(S2StateValue data) const
4104 {
4105 return this->value == data.value;
4106 }
4107 constexpr bool operator==(int data) const
4108 {
4109 return this->value == data;
4110 }
4111 constexpr bool operator!=(S2StateValue data) const
4112 {
4113 return this->value != data.value;
4114 }
4115 constexpr bool operator!=(int data) const
4116 {
4117 return this->value != data;
4118 }
4119 constexpr bool operator<(S2StateValue data) const
4120 {
4121 return this->value < data.value;
4122 }
4123 constexpr bool operator<(int data) const
4124 {
4125 return this->value < data;
4126 }
4127
4128 /**
4129 * \brief Gets the string representation of this enum
4130 *
4131 * \returns String representation of this enum
4132 */
4133 std::string ToString() const
4134 {
4135 switch (value)
4136 {
4137 case S2StateValue::Floating: return "Floating";
4138 case S2StateValue::Low: return "Low";
4139 case S2StateValue::High: return "High";
4140 default: return "Invalid Value";
4141 }
4142 }
4143
4144 friend std::ostream &operator<<(std::ostream &os, S2StateValue data)
4145 {
4146 os << data.ToString();
4147 return os;
4148 }
4149
4150 std::string Serialize() const
4151 {
4152 std::stringstream ss;
4153 ss << "u_" << this->value;
4154 return ss.str();
4155 }
4156};
4157
4158/**
4159 * \brief The floating state of the Signal 1 input (S1IN).
4160 */
4162{
4163public:
4165
4166 /**
4167 * \brief The input will attempt to detect when it is floating. This is enabled
4168 * by default.
4169 */
4170 static constexpr int FloatDetect = 0;
4171 /**
4172 * \brief The input will be pulled high when not loaded by an outside device.
4173 * This is useful for NPN-style devices.
4174 */
4175 static constexpr int PullHigh = 1;
4176 /**
4177 * \brief The input will be pulled low when not loaded by an outside device.
4178 * This is useful for PNP-style devices.
4179 */
4180 static constexpr int PullLow = 2;
4181 /**
4182 * \brief The input will pull in the direction of the last measured state. This
4183 * may be useful for devices that can enter into a high-Z tri-state.
4184 */
4185 static constexpr int BusKeeper = 3;
4186
4187 constexpr S1FloatStateValue(int value) :
4188 value{value}
4189 {}
4190
4191 constexpr S1FloatStateValue() :
4192 value{-1}
4193 {}
4194
4195 constexpr bool operator==(S1FloatStateValue data) const
4196 {
4197 return this->value == data.value;
4198 }
4199 constexpr bool operator==(int data) const
4200 {
4201 return this->value == data;
4202 }
4203 constexpr bool operator!=(S1FloatStateValue data) const
4204 {
4205 return this->value != data.value;
4206 }
4207 constexpr bool operator!=(int data) const
4208 {
4209 return this->value != data;
4210 }
4211 constexpr bool operator<(S1FloatStateValue data) const
4212 {
4213 return this->value < data.value;
4214 }
4215 constexpr bool operator<(int data) const
4216 {
4217 return this->value < data;
4218 }
4219
4220 /**
4221 * \brief Gets the string representation of this enum
4222 *
4223 * \returns String representation of this enum
4224 */
4225 std::string ToString() const
4226 {
4227 switch (value)
4228 {
4229 case S1FloatStateValue::FloatDetect: return "Float Detect";
4230 case S1FloatStateValue::PullHigh: return "Pull High";
4231 case S1FloatStateValue::PullLow: return "Pull Low";
4232 case S1FloatStateValue::BusKeeper: return "Bus Keeper";
4233 default: return "Invalid Value";
4234 }
4235 }
4236
4237 friend std::ostream &operator<<(std::ostream &os, S1FloatStateValue data)
4238 {
4239 os << data.ToString();
4240 return os;
4241 }
4242
4243 std::string Serialize() const
4244 {
4245 std::stringstream ss;
4246 ss << "u_" << this->value;
4247 return ss.str();
4248 }
4249};
4250
4251/**
4252 * \brief The floating state of the Signal 2 input (S2IN).
4253 */
4255{
4256public:
4258
4259 /**
4260 * \brief The input will attempt to detect when it is floating. This is enabled
4261 * by default.
4262 */
4263 static constexpr int FloatDetect = 0;
4264 /**
4265 * \brief The input will be pulled high when not loaded by an outside device.
4266 * This is useful for NPN-style devices.
4267 */
4268 static constexpr int PullHigh = 1;
4269 /**
4270 * \brief The input will be pulled low when not loaded by an outside device.
4271 * This is useful for PNP-style devices.
4272 */
4273 static constexpr int PullLow = 2;
4274 /**
4275 * \brief The input will pull in the direction of the last measured state. This
4276 * may be useful for devices that can enter into a high-Z tri-state.
4277 */
4278 static constexpr int BusKeeper = 3;
4279
4280 constexpr S2FloatStateValue(int value) :
4281 value{value}
4282 {}
4283
4284 constexpr S2FloatStateValue() :
4285 value{-1}
4286 {}
4287
4288 constexpr bool operator==(S2FloatStateValue data) const
4289 {
4290 return this->value == data.value;
4291 }
4292 constexpr bool operator==(int data) const
4293 {
4294 return this->value == data;
4295 }
4296 constexpr bool operator!=(S2FloatStateValue data) const
4297 {
4298 return this->value != data.value;
4299 }
4300 constexpr bool operator!=(int data) const
4301 {
4302 return this->value != data;
4303 }
4304 constexpr bool operator<(S2FloatStateValue data) const
4305 {
4306 return this->value < data.value;
4307 }
4308 constexpr bool operator<(int data) const
4309 {
4310 return this->value < data;
4311 }
4312
4313 /**
4314 * \brief Gets the string representation of this enum
4315 *
4316 * \returns String representation of this enum
4317 */
4318 std::string ToString() const
4319 {
4320 switch (value)
4321 {
4322 case S2FloatStateValue::FloatDetect: return "Float Detect";
4323 case S2FloatStateValue::PullHigh: return "Pull High";
4324 case S2FloatStateValue::PullLow: return "Pull Low";
4325 case S2FloatStateValue::BusKeeper: return "Bus Keeper";
4326 default: return "Invalid Value";
4327 }
4328 }
4329
4330 friend std::ostream &operator<<(std::ostream &os, S2FloatStateValue data)
4331 {
4332 os << data.ToString();
4333 return os;
4334 }
4335
4336 std::string Serialize() const
4337 {
4338 std::stringstream ss;
4339 ss << "u_" << this->value;
4340 return ss.str();
4341 }
4342};
4343
4344/**
4345 * \brief Choose what sensor source is reported via API and used by closed-loop
4346 * and limit features. The default is Commutation, which uses the
4347 * external sensor used for motor commutation.
4348 *
4349 * Choose Remote* to use another sensor on the same CAN bus (this also
4350 * requires setting FeedbackRemoteSensorID). Talon will update its
4351 * position and velocity whenever the remote sensor publishes its
4352 * information on CAN bus, and the Talon commutation sensor will not be
4353 * used.
4354 *
4355 * Choose Fused* (requires Phoenix Pro) and Talon will fuse another
4356 * sensor's information with the commutation sensor, which provides the
4357 * best possible position and velocity for accuracy and bandwidth (this
4358 * also requires setting FeedbackRemoteSensorID). This was developed for
4359 * applications such as swerve-azimuth.
4360 *
4361 * Choose Sync* (requires Phoenix Pro) and Talon will synchronize its
4362 * commutation sensor position against another sensor, then continue to
4363 * use the rotor sensor for closed loop control (this also requires
4364 * setting FeedbackRemoteSensorID). The Talon will report if its
4365 * internal position differs significantly from the reported remote
4366 * sensor position. This was developed for mechanisms where there is a
4367 * risk of the sensor failing in such a way that it reports a position
4368 * that does not match the mechanism, such as the sensor mounting
4369 * assembly breaking off.
4370 *
4371 * Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll
4372 * to use another Pigeon2 on the same CAN bus (this also requires setting
4373 * FeedbackRemoteSensorID). Talon will update its position to match the
4374 * selected value whenever Pigeon2 publishes its information on CAN bus.
4375 * Note that the Talon position will be in rotations and not degrees.
4376 *
4377 * Choose Quadrature to use a quadrature encoder directly attached to the
4378 * Talon data port. This provides velocity and relative position
4379 * measurements.
4380 *
4381 * Choose PulseWidth to use a pulse-width encoder directly attached to
4382 * the Talon data port. This provides velocity and absolute position
4383 * measurements.
4384 *
4385 * \details Note: When the feedback source is changed to Fused* or Sync*, the
4386 * Talon needs a period of time to fuse before sensor-based
4387 * (soft-limit, closed loop, etc.) features are used. This period of
4388 * time is determined by the update frequency of the remote sensor's
4389 * Position signal.
4390 */
4392{
4393public:
4395
4396 /**
4397 * \brief Use the external sensor used for motor commutation.
4398 */
4399 static constexpr int Commutation = 0;
4400 /**
4401 * \brief Use another CANcoder on the same CAN bus (this also requires setting
4402 * FeedbackRemoteSensorID). Talon will update its position and velocity
4403 * whenever CANcoder publishes its information on CAN bus, and the Talon
4404 * commutation sensor will not be used.
4405 */
4406 static constexpr int RemoteCANcoder = 1;
4407 /**
4408 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4409 * FeedbackRemoteSensorID). Talon will update its position to match the
4410 * Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus.
4411 * Note that the Talon position will be in rotations and not degrees.
4412 */
4413 static constexpr int RemotePigeon2_Yaw = 2;
4414 /**
4415 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4416 * FeedbackRemoteSensorID). Talon will update its position to match the
4417 * Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus.
4418 * Note that the Talon position will be in rotations and not degrees.
4419 */
4420 static constexpr int RemotePigeon2_Pitch = 3;
4421 /**
4422 * \brief Use another Pigeon2 on the same CAN bus (this also requires setting
4423 * FeedbackRemoteSensorID). Talon will update its position to match the
4424 * Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus.
4425 * Note that the Talon position will be in rotations and not degrees.
4426 */
4427 static constexpr int RemotePigeon2_Roll = 4;
4428 /**
4429 * \brief Requires Phoenix Pro; Talon will fuse another CANcoder's information
4430 * with the commutation sensor, which provides the best possible position
4431 * and velocity for accuracy and bandwidth (this also requires setting
4432 * FeedbackRemoteSensorID). FusedCANcoder was developed for applications
4433 * such as swerve-azimuth.
4434 */
4435 static constexpr int FusedCANcoder = 5;
4436 /**
4437 * \brief Requires Phoenix Pro; Talon will synchronize its commutation sensor
4438 * position against another CANcoder, then continue to use the rotor
4439 * sensor for closed loop control (this also requires setting
4440 * FeedbackRemoteSensorID). The Talon will report if its internal
4441 * position differs significantly from the reported CANcoder position.
4442 * SyncCANcoder was developed for mechanisms where there is a risk of the
4443 * CANcoder failing in such a way that it reports a position that does
4444 * not match the mechanism, such as the sensor mounting assembly breaking
4445 * off.
4446 */
4447 static constexpr int SyncCANcoder = 6;
4448 /**
4449 * \brief Use a quadrature encoder directly attached to the Talon data port.
4450 * This provides velocity and relative position measurements.
4451 */
4452 static constexpr int Quadrature = 7;
4453 /**
4454 * \brief Use a pulse-width encoder directly attached to the Talon data port.
4455 * This provides velocity and absolute position measurements.
4456 */
4457 static constexpr int PulseWidth = 8;
4458 /**
4459 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 1
4460 * (S1IN) on CANdi™. Talon will update its position and velocity whenever
4461 * CANdi™ publishes its information on CAN bus, and the Talon internal
4462 * rotor will not be used.
4463 */
4464 static constexpr int RemoteCANdiPWM1 = 9;
4465 /**
4466 * \brief Use a pulse-width encoder remotely attached to the Sensor Input 2
4467 * (S2IN) on CANdi™. Talon will update its position and velocity whenever
4468 * CANdi™ publishes its information on CAN bus, and the Talon internal
4469 * rotor will not be used.
4470 */
4471 static constexpr int RemoteCANdiPWM2 = 10;
4472 /**
4473 * \brief Use a quadrature encoder remotely attached to the two Sensor Inputs on
4474 * CANdi™. Talon will update its position and velocity whenever CANdi™
4475 * publishes its information on CAN bus, and the Talon internal rotor
4476 * will not be used.
4477 */
4478 static constexpr int RemoteCANdiQuadrature = 11;
4479 /**
4480 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
4481 * attached to the Sensor Input 1 (S1IN) on CANdi™, which provides the
4482 * best possible position and velocity for accuracy and bandwidth (this
4483 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
4484 * developed for applications such as swerve-azimuth.
4485 */
4486 static constexpr int FusedCANdiPWM1 = 12;
4487 /**
4488 * \brief Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely
4489 * attached to the Sensor Input 2 (S2IN) on CANdi™, which provides the
4490 * best possible position and velocity for accuracy and bandwidth (this
4491 * also requires setting FeedbackRemoteSensorID). FusedCANdi was
4492 * developed for applications such as swerve-azimuth.
4493 */
4494 static constexpr int FusedCANdiPWM2 = 13;
4495 /**
4496 * \brief Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely
4497 * attached to the two Sensor Inputs on CANdi™. This provides velocity
4498 * and relative position measurements. This also requires setting
4499 * FeedbackRemoteSensorID.
4500 */
4501 static constexpr int FusedCANdiQuadrature = 14;
4502 /**
4503 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
4504 * position against the pulse-width encoder attached to Sensor Input 1
4505 * (S1IN), then continue to use the rotor sensor for closed loop control
4506 * (this also requires setting FeedbackRemoteSensorID). The Talon will
4507 * report if its internal position differs significantly from the
4508 * reported PWM position. SyncCANdi was developed for mechanisms where
4509 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
4510 * that it reports a position that does not match the mechanism, such as
4511 * the sensor mounting assembly breaking off.
4512 */
4513 static constexpr int SyncCANdiPWM1 = 15;
4514 /**
4515 * \brief Requires Phoenix Pro; Talon will synchronize its internal rotor
4516 * position against the pulse-width encoder attached to Sensor Input 1
4517 * (S1IN), then continue to use the rotor sensor for closed loop control
4518 * (this also requires setting FeedbackRemoteSensorID). The Talon will
4519 * report if its internal position differs significantly from the
4520 * reported PWM position. SyncCANdi was developed for mechanisms where
4521 * there is a risk of the CTR Electronics' CANdi™ failing in such a way
4522 * that it reports a position that does not match the mechanism, such as
4523 * the sensor mounting assembly breaking off.
4524 */
4525 static constexpr int SyncCANdiPWM2 = 16;
4526
4528 value{value}
4529 {}
4530
4532 value{-1}
4533 {}
4534
4536 {
4537 return this->value == data.value;
4538 }
4539 constexpr bool operator==(int data) const
4540 {
4541 return this->value == data;
4542 }
4544 {
4545 return this->value != data.value;
4546 }
4547 constexpr bool operator!=(int data) const
4548 {
4549 return this->value != data;
4550 }
4552 {
4553 return this->value < data.value;
4554 }
4555 constexpr bool operator<(int data) const
4556 {
4557 return this->value < data;
4558 }
4559
4560 /**
4561 * \brief Gets the string representation of this enum
4562 *
4563 * \returns String representation of this enum
4564 */
4565 std::string ToString() const
4566 {
4567 switch (value)
4568 {
4569 case ExternalFeedbackSensorSourceValue::Commutation: return "Commutation";
4570 case ExternalFeedbackSensorSourceValue::RemoteCANcoder: return "RemoteCANcoder";
4571 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Yaw: return "RemotePigeon2_Yaw";
4572 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Pitch: return "RemotePigeon2_Pitch";
4573 case ExternalFeedbackSensorSourceValue::RemotePigeon2_Roll: return "RemotePigeon2_Roll";
4574 case ExternalFeedbackSensorSourceValue::FusedCANcoder: return "FusedCANcoder";
4575 case ExternalFeedbackSensorSourceValue::SyncCANcoder: return "SyncCANcoder";
4576 case ExternalFeedbackSensorSourceValue::Quadrature: return "Quadrature";
4577 case ExternalFeedbackSensorSourceValue::PulseWidth: return "PulseWidth";
4578 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM1: return "RemoteCANdiPWM1";
4579 case ExternalFeedbackSensorSourceValue::RemoteCANdiPWM2: return "RemoteCANdiPWM2";
4580 case ExternalFeedbackSensorSourceValue::RemoteCANdiQuadrature: return "RemoteCANdiQuadrature";
4581 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM1: return "FusedCANdiPWM1";
4582 case ExternalFeedbackSensorSourceValue::FusedCANdiPWM2: return "FusedCANdiPWM2";
4583 case ExternalFeedbackSensorSourceValue::FusedCANdiQuadrature: return "FusedCANdiQuadrature";
4584 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM1: return "SyncCANdiPWM1";
4585 case ExternalFeedbackSensorSourceValue::SyncCANdiPWM2: return "SyncCANdiPWM2";
4586 default: return "Invalid Value";
4587 }
4588 }
4589
4590 friend std::ostream &operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data)
4591 {
4592 os << data.ToString();
4593 return os;
4594 }
4595
4596 std::string Serialize() const
4597 {
4598 std::stringstream ss;
4599 ss << "u_" << this->value;
4600 return ss.str();
4601 }
4602};
4603
4604/**
4605 * \brief The relationship between the motor controlled by a Talon and the
4606 * external sensor connected to the data port. This does not affect the
4607 * commutation sensor or remote sensors.
4608 *
4609 * To determine the sensor phase, set this config to Aligned and drive
4610 * the motor with positive output. If the reported sensor velocity is
4611 * positive, then the phase is Aligned. If the reported sensor velocity
4612 * is negative, then the phase is Opposed.
4613 *
4614 * The sensor direction is automatically inverted along with motor
4615 * invert, so the sensor phase does not need to be changed when motor
4616 * invert changes.
4617 */
4619{
4620public:
4622
4623 /**
4624 * \brief The sensor direction is normally aligned with the motor.
4625 */
4626 static constexpr int Aligned = 0;
4627 /**
4628 * \brief The sensor direction is normally opposed to the motor.
4629 */
4630 static constexpr int Opposed = 1;
4631
4632 constexpr SensorPhaseValue(int value) :
4633 value{value}
4634 {}
4635
4636 constexpr SensorPhaseValue() :
4637 value{-1}
4638 {}
4639
4640 constexpr bool operator==(SensorPhaseValue data) const
4641 {
4642 return this->value == data.value;
4643 }
4644 constexpr bool operator==(int data) const
4645 {
4646 return this->value == data;
4647 }
4648 constexpr bool operator!=(SensorPhaseValue data) const
4649 {
4650 return this->value != data.value;
4651 }
4652 constexpr bool operator!=(int data) const
4653 {
4654 return this->value != data;
4655 }
4656 constexpr bool operator<(SensorPhaseValue data) const
4657 {
4658 return this->value < data.value;
4659 }
4660 constexpr bool operator<(int data) const
4661 {
4662 return this->value < data;
4663 }
4664
4665 /**
4666 * \brief Gets the string representation of this enum
4667 *
4668 * \returns String representation of this enum
4669 */
4670 std::string ToString() const
4671 {
4672 switch (value)
4673 {
4674 case SensorPhaseValue::Aligned: return "Aligned";
4675 case SensorPhaseValue::Opposed: return "Opposed";
4676 default: return "Invalid Value";
4677 }
4678 }
4679
4680 friend std::ostream &operator<<(std::ostream &os, SensorPhaseValue data)
4681 {
4682 os << data.ToString();
4683 return os;
4684 }
4685
4686 std::string Serialize() const
4687 {
4688 std::stringstream ss;
4689 ss << "u_" << this->value;
4690 return ss.str();
4691 }
4692};
4693
4694/**
4695 * \brief What value the Signal 1 input (S1IN) needs to be for the CTR
4696 * Electronics' CANdi™ to detect as Closed.
4697 *
4698 * \details Devices using the S1 input as a remote limit switch will treat the
4699 * switch as closed when the S1 input is this state.
4700 */
4702{
4703public:
4705
4706 /**
4707 * \brief The S1 input will be treated as closed when it is not floating.
4708 */
4709 static constexpr int CloseWhenNotFloating = 0;
4710 /**
4711 * \brief The S1 input will be treated as closed when it is floating.
4712 */
4713 static constexpr int CloseWhenFloating = 1;
4714 /**
4715 * \brief The S1 input will be treated as closed when it is not High.
4716 */
4717 static constexpr int CloseWhenNotHigh = 2;
4718 /**
4719 * \brief The S1 input will be treated as closed when it is High.
4720 */
4721 static constexpr int CloseWhenHigh = 3;
4722 /**
4723 * \brief The S1 input will be treated as closed when it is not Low.
4724 */
4725 static constexpr int CloseWhenNotLow = 4;
4726 /**
4727 * \brief The S1 input will be treated as closed when it is Low.
4728 */
4729 static constexpr int CloseWhenLow = 5;
4730
4731 constexpr S1CloseStateValue(int value) :
4732 value{value}
4733 {}
4734
4735 constexpr S1CloseStateValue() :
4736 value{-1}
4737 {}
4738
4739 constexpr bool operator==(S1CloseStateValue data) const
4740 {
4741 return this->value == data.value;
4742 }
4743 constexpr bool operator==(int data) const
4744 {
4745 return this->value == data;
4746 }
4747 constexpr bool operator!=(S1CloseStateValue data) const
4748 {
4749 return this->value != data.value;
4750 }
4751 constexpr bool operator!=(int data) const
4752 {
4753 return this->value != data;
4754 }
4755 constexpr bool operator<(S1CloseStateValue data) const
4756 {
4757 return this->value < data.value;
4758 }
4759 constexpr bool operator<(int data) const
4760 {
4761 return this->value < data;
4762 }
4763
4764 /**
4765 * \brief Gets the string representation of this enum
4766 *
4767 * \returns String representation of this enum
4768 */
4769 std::string ToString() const
4770 {
4771 switch (value)
4772 {
4773 case S1CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
4774 case S1CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
4775 case S1CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
4776 case S1CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
4777 case S1CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
4778 case S1CloseStateValue::CloseWhenLow: return "CloseWhenLow";
4779 default: return "Invalid Value";
4780 }
4781 }
4782
4783 friend std::ostream &operator<<(std::ostream &os, S1CloseStateValue data)
4784 {
4785 os << data.ToString();
4786 return os;
4787 }
4788
4789 std::string Serialize() const
4790 {
4791 std::stringstream ss;
4792 ss << "u_" << this->value;
4793 return ss.str();
4794 }
4795};
4796
4797/**
4798 * \brief What value the Signal 2 input (S2IN) needs to be for the CTR
4799 * Electronics' CANdi™ to detect as Closed.
4800 *
4801 * \details Devices using the S2 input as a remote limit switch will treat the
4802 * switch as closed when the S2 input is this state.
4803 */
4805{
4806public:
4808
4809 /**
4810 * \brief The S2 input will be treated as closed when it is not floating.
4811 */
4812 static constexpr int CloseWhenNotFloating = 0;
4813 /**
4814 * \brief The S2 input will be treated as closed when it is floating.
4815 */
4816 static constexpr int CloseWhenFloating = 1;
4817 /**
4818 * \brief The S2 input will be treated as closed when it is not High.
4819 */
4820 static constexpr int CloseWhenNotHigh = 2;
4821 /**
4822 * \brief The S2 input will be treated as closed when it is High.
4823 */
4824 static constexpr int CloseWhenHigh = 3;
4825 /**
4826 * \brief The S2 input will be treated as closed when it is not Low.
4827 */
4828 static constexpr int CloseWhenNotLow = 4;
4829 /**
4830 * \brief The S2 input will be treated as closed when it is Low.
4831 */
4832 static constexpr int CloseWhenLow = 5;
4833
4834 constexpr S2CloseStateValue(int value) :
4835 value{value}
4836 {}
4837
4838 constexpr S2CloseStateValue() :
4839 value{-1}
4840 {}
4841
4842 constexpr bool operator==(S2CloseStateValue data) const
4843 {
4844 return this->value == data.value;
4845 }
4846 constexpr bool operator==(int data) const
4847 {
4848 return this->value == data;
4849 }
4850 constexpr bool operator!=(S2CloseStateValue data) const
4851 {
4852 return this->value != data.value;
4853 }
4854 constexpr bool operator!=(int data) const
4855 {
4856 return this->value != data;
4857 }
4858 constexpr bool operator<(S2CloseStateValue data) const
4859 {
4860 return this->value < data.value;
4861 }
4862 constexpr bool operator<(int data) const
4863 {
4864 return this->value < data;
4865 }
4866
4867 /**
4868 * \brief Gets the string representation of this enum
4869 *
4870 * \returns String representation of this enum
4871 */
4872 std::string ToString() const
4873 {
4874 switch (value)
4875 {
4876 case S2CloseStateValue::CloseWhenNotFloating: return "CloseWhenNotFloating";
4877 case S2CloseStateValue::CloseWhenFloating: return "CloseWhenFloating";
4878 case S2CloseStateValue::CloseWhenNotHigh: return "CloseWhenNotHigh";
4879 case S2CloseStateValue::CloseWhenHigh: return "CloseWhenHigh";
4880 case S2CloseStateValue::CloseWhenNotLow: return "CloseWhenNotLow";
4881 case S2CloseStateValue::CloseWhenLow: return "CloseWhenLow";
4882 default: return "Invalid Value";
4883 }
4884 }
4885
4886 friend std::ostream &operator<<(std::ostream &os, S2CloseStateValue data)
4887 {
4888 os << data.ToString();
4889 return os;
4890 }
4891
4892 std::string Serialize() const
4893 {
4894 std::stringstream ss;
4895 ss << "u_" << this->value;
4896 return ss.str();
4897 }
4898};
4899
4900/**
4901 * \brief If a brushed motor is selected with Motor Arrangement, this config
4902 * determines which of three leads to use.
4903 */
4905{
4906public:
4908
4909 /**
4910 * \brief Third party brushed DC motor with two leads.
4911 * Motor leads: Use terminal A for the motor red lead and terminal B for
4912 * the motor black lead (motor leads may be flipped to correct for
4913 * clockwise vs counterclockwise).
4914 * Note that the invert configuration can still be used to invert rotor
4915 * orientation.
4916 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4917 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4918 * pin [9].
4919 */
4920 static constexpr int Leads_A_and_B = 0;
4921 /**
4922 * \brief Third party brushed DC motor with two leads.
4923 * Motor leads: Use terminal A for the motor red lead and terminal C for
4924 * the motor black lead (motor leads may be flipped to correct for
4925 * clockwise vs counterclockwise).
4926 * Note that the invert configuration can still be used to reverse rotor
4927 * orientation.
4928 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4929 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4930 * pin [9].
4931 */
4932 static constexpr int Leads_A_and_C = 1;
4933 /**
4934 * \brief Third party brushed DC motor with two leads.
4935 * Motor leads: Use terminal B for the motor red lead and terminal C for
4936 * the motor black lead (motor leads may be flipped to correct for
4937 * clockwise vs counterclockwise).
4938 * Note that the invert configuration can still be used to reverse rotor
4939 * orientation.
4940 * Gadgeteer Connector: quadrature [A, B] are on pins [7, 5], limit
4941 * [forward, reverse] are on pins [4, 8], and pulse width position is on
4942 * pin [9].
4943 */
4944 static constexpr int Leads_B_and_C = 2;
4945
4947 value{value}
4948 {}
4949
4951 value{-1}
4952 {}
4953
4954 constexpr bool operator==(BrushedMotorWiringValue data) const
4955 {
4956 return this->value == data.value;
4957 }
4958 constexpr bool operator==(int data) const
4959 {
4960 return this->value == data;
4961 }
4962 constexpr bool operator!=(BrushedMotorWiringValue data) const
4963 {
4964 return this->value != data.value;
4965 }
4966 constexpr bool operator!=(int data) const
4967 {
4968 return this->value != data;
4969 }
4970 constexpr bool operator<(BrushedMotorWiringValue data) const
4971 {
4972 return this->value < data.value;
4973 }
4974 constexpr bool operator<(int data) const
4975 {
4976 return this->value < data;
4977 }
4978
4979 /**
4980 * \brief Gets the string representation of this enum
4981 *
4982 * \returns String representation of this enum
4983 */
4984 std::string ToString() const
4985 {
4986 switch (value)
4987 {
4988 case BrushedMotorWiringValue::Leads_A_and_B: return "Leads_A_and_B";
4989 case BrushedMotorWiringValue::Leads_A_and_C: return "Leads_A_and_C";
4990 case BrushedMotorWiringValue::Leads_B_and_C: return "Leads_B_and_C";
4991 default: return "Invalid Value";
4992 }
4993 }
4994
4995 friend std::ostream &operator<<(std::ostream &os, BrushedMotorWiringValue data)
4996 {
4997 os << data.ToString();
4998 return os;
4999 }
5000
5001 std::string Serialize() const
5002 {
5003 std::stringstream ss;
5004 ss << "u_" << this->value;
5005 return ss.str();
5006 }
5007};
5008
5009
5010}
5011}
5012}
Definition Serializable.hpp:15
Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors.
Definition SpnEnums.hpp:3764
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3808
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3818
std::string Serialize() const
Definition SpnEnums.hpp:3834
friend std::ostream & operator<<(std::ostream &os, AdvancedHallSupportValue data)
Definition SpnEnums.hpp:3828
constexpr AdvancedHallSupportValue()
Definition SpnEnums.hpp:3784
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3792
constexpr bool operator==(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3788
static constexpr int Enabled
Requires Phoenix Pro; Talon uses advanced features to improve commutation and velocity measurement wh...
Definition SpnEnums.hpp:3778
static constexpr int Disabled
Talon will utilize hall sensors without advanced features.
Definition SpnEnums.hpp:3771
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3800
constexpr bool operator!=(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3796
constexpr bool operator<(AdvancedHallSupportValue data) const
Definition SpnEnums.hpp:3804
constexpr AdvancedHallSupportValue(int value)
Definition SpnEnums.hpp:3780
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:3128
constexpr bool operator<(BridgeOutputValue data) const
Definition SpnEnums.hpp:3167
constexpr bool operator==(BridgeOutputValue data) const
Definition SpnEnums.hpp:3151
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3171
static constexpr int BridgeReq_VariableBrake
Definition SpnEnums.hpp:3141
constexpr bool operator!=(BridgeOutputValue data) const
Definition SpnEnums.hpp:3159
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3155
friend std::ostream & operator<<(std::ostream &os, BridgeOutputValue data)
Definition SpnEnums.hpp:3199
static constexpr int BridgeReq_FaultCoast
Definition SpnEnums.hpp:3139
static constexpr int BridgeReq_FOCEasy
Definition SpnEnums.hpp:3137
std::string Serialize() const
Definition SpnEnums.hpp:3205
static constexpr int BridgeReq_Trapez
Definition SpnEnums.hpp:3134
static constexpr int BridgeReq_ActiveBrake
Definition SpnEnums.hpp:3140
constexpr BridgeOutputValue(int value)
Definition SpnEnums.hpp:3143
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3181
static constexpr int BridgeReq_MusicTone
Definition SpnEnums.hpp:3136
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3163
static constexpr int BridgeReq_Brake
Definition SpnEnums.hpp:3133
static constexpr int BridgeReq_FOCTorque
Definition SpnEnums.hpp:3135
constexpr BridgeOutputValue()
Definition SpnEnums.hpp:3147
int value
Definition SpnEnums.hpp:3130
static constexpr int BridgeReq_FaultBrake
Definition SpnEnums.hpp:3138
static constexpr int BridgeReq_Coast
Definition SpnEnums.hpp:3132
If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to...
Definition SpnEnums.hpp:4905
constexpr bool operator==(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4954
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4984
int value
Definition SpnEnums.hpp:4907
constexpr BrushedMotorWiringValue(int value)
Definition SpnEnums.hpp:4946
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4966
static constexpr int Leads_A_and_B
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4920
friend std::ostream & operator<<(std::ostream &os, BrushedMotorWiringValue data)
Definition SpnEnums.hpp:4995
std::string Serialize() const
Definition SpnEnums.hpp:5001
constexpr bool operator<(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4970
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4958
constexpr bool operator!=(BrushedMotorWiringValue data) const
Definition SpnEnums.hpp:4962
static constexpr int Leads_B_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4944
static constexpr int Leads_A_and_C
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:4932
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4974
constexpr BrushedMotorWiringValue()
Definition SpnEnums.hpp:4950
The type of motor attached to the Talon.
Definition SpnEnums.hpp:3458
int value
Definition SpnEnums.hpp:3460
static constexpr int Falcon500_Integrated
Talon is attached to an integrated Falcon motor.
Definition SpnEnums.hpp:3469
static constexpr int NEO550_JST
Talon is connected to a third party NEO550 brushless three phase motor.
Definition SpnEnums.hpp:3506
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3541
static constexpr int KrakenX44_Integrated
Talon is attached to an integrated Kraken X44 motor.
Definition SpnEnums.hpp:3477
std::string Serialize() const
Definition SpnEnums.hpp:3576
static constexpr int Brushed_AC
Talon is connected to a third party brushed DC motor with leads A and C.
Definition SpnEnums.hpp:3492
constexpr bool operator!=(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3529
static constexpr int NEO_JST
Talon is connected to a third party NEO brushless three phase motor.
Definition SpnEnums.hpp:3501
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3533
static constexpr int Brushed_AB
Talon is connected to a third party brushed DC motor with leads A and B.
Definition SpnEnums.hpp:3487
static constexpr int Brushed_BC
Talon is connected to a third party brushed DC motor with leads B and C.
Definition SpnEnums.hpp:3497
constexpr ConnectedMotorValue(int value)
Definition SpnEnums.hpp:3513
static constexpr int Minion_JST
Talon is connected to a CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:3482
constexpr bool operator<(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3537
constexpr bool operator==(ConnectedMotorValue data) const
Definition SpnEnums.hpp:3521
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3551
static constexpr int KrakenX60_Integrated
Talon is attached to an integrated Kraken X60 motor.
Definition SpnEnums.hpp:3473
friend std::ostream & operator<<(std::ostream &os, ConnectedMotorValue data)
Definition SpnEnums.hpp:3570
constexpr ConnectedMotorValue()
Definition SpnEnums.hpp:3517
static constexpr int VORTEX_JST
Talon is connected to a third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:3511
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3525
static constexpr int Unknown
Talon could not determine the type of motor attached.
Definition SpnEnums.hpp:3465
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:3240
static constexpr int Disabled
Disable differential control.
Definition SpnEnums.hpp:3247
static constexpr int RemoteTalonFX_Diff
Use another TalonFX on the same CAN bus.
Definition SpnEnums.hpp:3255
constexpr bool operator<(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3312
constexpr bool operator==(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3296
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3286
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3300
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3316
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3271
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3279
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID).
Definition SpnEnums.hpp:3263
constexpr bool operator!=(DifferentialSensorSourceValue data) const
Definition SpnEnums.hpp:3304
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3308
std::string Serialize() const
Definition SpnEnums.hpp:3346
friend std::ostream & operator<<(std::ostream &os, DifferentialSensorSourceValue data)
Definition SpnEnums.hpp:3340
constexpr DifferentialSensorSourceValue()
Definition SpnEnums.hpp:3292
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3326
constexpr DifferentialSensorSourceValue(int value)
Definition SpnEnums.hpp:3288
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition SpnEnums.hpp:4392
static constexpr int RemoteCANdiQuadrature
Use a quadrature encoder remotely attached to the two Sensor Inputs on CANdi™.
Definition SpnEnums.hpp:4478
std::string Serialize() const
Definition SpnEnums.hpp:4596
static constexpr int SyncCANcoder
Requires Phoenix Pro; Talon will synchronize its commutation sensor position against another CANcoder...
Definition SpnEnums.hpp:4447
static constexpr int RemotePigeon2_Roll
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4427
static constexpr int FusedCANdiPWM2
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (...
Definition SpnEnums.hpp:4494
constexpr bool operator<(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4551
static constexpr int RemotePigeon2_Yaw
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4413
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4555
static constexpr int SyncCANdiPWM1
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:4513
static constexpr int FusedCANdiQuadrature
Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs...
Definition SpnEnums.hpp:4501
static constexpr int RemoteCANdiPWM1
Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on CANdi™.
Definition SpnEnums.hpp:4464
static constexpr int SyncCANdiPWM2
Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width enco...
Definition SpnEnums.hpp:4525
constexpr ExternalFeedbackSensorSourceValue()
Definition SpnEnums.hpp:4531
constexpr bool operator!=(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4543
static constexpr int RemotePigeon2_Pitch
Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4420
static constexpr int Commutation
Use the external sensor used for motor commutation.
Definition SpnEnums.hpp:4399
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
Definition SpnEnums.hpp:4406
static constexpr int FusedCANdiPWM1
Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (...
Definition SpnEnums.hpp:4486
constexpr bool operator==(ExternalFeedbackSensorSourceValue data) const
Definition SpnEnums.hpp:4535
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4539
constexpr ExternalFeedbackSensorSourceValue(int value)
Definition SpnEnums.hpp:4527
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4565
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4547
static constexpr int FusedCANcoder
Requires Phoenix Pro; Talon will fuse another CANcoder's information with the commutation sensor,...
Definition SpnEnums.hpp:4435
friend std::ostream & operator<<(std::ostream &os, ExternalFeedbackSensorSourceValue data)
Definition SpnEnums.hpp:4590
static constexpr int RemoteCANdiPWM2
Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on CANdi™.
Definition SpnEnums.hpp:4471
static constexpr int Quadrature
Use a quadrature encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:4452
static constexpr int PulseWidth
Use a pulse-width encoder directly attached to the Talon data port.
Definition SpnEnums.hpp:4457
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 the CTR Electronics' CANd...
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 the CTR Electronics' 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 the CTR Electronics' CANd...
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:2769
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:2813
static constexpr int RemoteCANdiS1
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2740
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:2761
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2773
constexpr ForwardLimitSourceValue(int value)
Definition SpnEnums.hpp:2753
constexpr ForwardLimitSourceValue()
Definition SpnEnums.hpp:2757
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2791
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2781
constexpr bool operator<(ForwardLimitSourceValue data) const
Definition SpnEnums.hpp:2777
friend std::ostream & operator<<(std::ostream &os, ForwardLimitSourceValue data)
Definition SpnEnums.hpp:2807
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2765
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 CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2747
int value
Definition SpnEnums.hpp:2705
static constexpr int Disabled
Disable the forward limit switch.
Definition SpnEnums.hpp:2751
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 counter-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 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:3039
friend std::ostream & operator<<(std::ostream &os, MagnetHealthValue data)
Definition SpnEnums.hpp:3110
static constexpr int Magnet_Orange
Magnet health is adequate but with reduced accuracy.
Definition SpnEnums.hpp:3050
constexpr bool operator!=(MagnetHealthValue data) const
Definition SpnEnums.hpp:3076
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3098
static constexpr int Magnet_Red
The magnet is too close or too far from the CANcoder.
Definition SpnEnums.hpp:3046
constexpr bool operator==(MagnetHealthValue data) const
Definition SpnEnums.hpp:3068
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3072
static constexpr int Magnet_Green
Magnet health is ideal.
Definition SpnEnums.hpp:3054
std::string Serialize() const
Definition SpnEnums.hpp:3116
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3080
constexpr MagnetHealthValue()
Definition SpnEnums.hpp:3064
int value
Definition SpnEnums.hpp:3041
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3088
static constexpr int Magnet_Invalid
The accuracy cannot be determined.
Definition SpnEnums.hpp:3058
constexpr MagnetHealthValue(int value)
Definition SpnEnums.hpp:3060
constexpr bool operator<(MagnetHealthValue data) const
Definition SpnEnums.hpp:3084
Health of the distance measurement.
Definition SpnEnums.hpp:3588
constexpr bool operator==(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3614
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3626
static constexpr int Good
Measurement is good.
Definition SpnEnums.hpp:3595
constexpr MeasurementHealthValue(int value)
Definition SpnEnums.hpp:3606
static constexpr int Limited
Measurement is likely okay, but the target is either very far away or moving very quickly.
Definition SpnEnums.hpp:3600
constexpr bool operator<(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3630
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3634
std::string Serialize() const
Definition SpnEnums.hpp:3661
static constexpr int Bad
Measurement is compromised.
Definition SpnEnums.hpp:3604
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3618
constexpr bool operator!=(MeasurementHealthValue data) const
Definition SpnEnums.hpp:3622
friend std::ostream & operator<<(std::ostream &os, MeasurementHealthValue data)
Definition SpnEnums.hpp:3655
constexpr MeasurementHealthValue()
Definition SpnEnums.hpp:3610
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3644
int value
Definition SpnEnums.hpp:3590
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:3853
constexpr bool operator<(MotorArrangementValue data) const
Definition SpnEnums.hpp:3948
int value
Definition SpnEnums.hpp:3855
static constexpr int NEO_JST
Third party NEO brushless three phase motor (~6000 RPM at 12V).
Definition SpnEnums.hpp:3898
friend std::ostream & operator<<(std::ostream &os, MotorArrangementValue data)
Definition SpnEnums.hpp:3976
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3944
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3952
static constexpr int NEO550_JST
Third party NEO550 brushless three phase motor (~11000 RPM at 12V).
Definition SpnEnums.hpp:3910
static constexpr int Brushed_DC
Third party brushed DC motor with two leads.
Definition SpnEnums.hpp:3886
static constexpr int Minion_JST
CTR Electronics Minion® brushless three phase motor.
Definition SpnEnums.hpp:3874
std::string Serialize() const
Definition SpnEnums.hpp:3982
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3936
constexpr MotorArrangementValue(int value)
Definition SpnEnums.hpp:3924
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3962
constexpr bool operator!=(MotorArrangementValue data) const
Definition SpnEnums.hpp:3940
constexpr bool operator==(MotorArrangementValue data) const
Definition SpnEnums.hpp:3932
static constexpr int VORTEX_JST
Third party VORTEX brushless three phase motor.
Definition SpnEnums.hpp:3922
constexpr MotorArrangementValue()
Definition SpnEnums.hpp:3928
static constexpr int Disabled
Motor is not selected.
Definition SpnEnums.hpp:3862
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:2913
static constexpr int RemoteCANdiS2
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2957
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:2925
constexpr ReverseLimitSourceValue(int value)
Definition SpnEnums.hpp:2963
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3001
static constexpr int RemoteCANrange
Use another CANrange on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2943
static constexpr int RemoteCANcoder
Use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Definition SpnEnums.hpp:2937
static constexpr int RemoteCANdiS1
Use another CTR Electronics' CANdi™ on the same CAN bus (this also requires setting ForwardLimitRemot...
Definition SpnEnums.hpp:2950
std::string Serialize() const
Definition SpnEnums.hpp:3023
int value
Definition SpnEnums.hpp:2915
friend std::ostream & operator<<(std::ostream &os, ReverseLimitSourceValue data)
Definition SpnEnums.hpp:3017
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:2930
constexpr bool operator==(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2971
constexpr bool operator<(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2987
constexpr bool operator!=(ReverseLimitSourceValue data) const
Definition SpnEnums.hpp:2979
static constexpr int LimitSwitchPin
Use the reverse limit switch pin on the limit switch connector.
Definition SpnEnums.hpp:2920
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2991
constexpr ReverseLimitSourceValue()
Definition SpnEnums.hpp:2967
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2983
static constexpr int Disabled
Disable the reverse limit switch.
Definition SpnEnums.hpp:2961
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2975
Determines if the reverse limit switch is normally-open (default) or normally-closed.
Definition SpnEnums.hpp:2826
friend std::ostream & operator<<(std::ostream &os, ReverseLimitTypeValue data)
Definition SpnEnums.hpp:2881
static constexpr int NormallyClosed
Definition SpnEnums.hpp:2831
constexpr bool operator!=(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2849
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:2861
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:2871
constexpr ReverseLimitTypeValue()
Definition SpnEnums.hpp:2837
constexpr bool operator<(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2857
constexpr bool operator==(ReverseLimitTypeValue data) const
Definition SpnEnums.hpp:2841
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:2845
static constexpr int NormallyOpen
Definition SpnEnums.hpp:2830
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:2853
std::string Serialize() const
Definition SpnEnums.hpp:2887
int value
Definition SpnEnums.hpp:2828
constexpr ReverseLimitTypeValue(int value)
Definition SpnEnums.hpp:2833
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 CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:4702
int value
Definition SpnEnums.hpp:4704
constexpr bool operator==(S1CloseStateValue data) const
Definition SpnEnums.hpp:4739
static constexpr int CloseWhenNotHigh
The S1 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:4717
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4743
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4759
static constexpr int CloseWhenNotFloating
The S1 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:4709
static constexpr int CloseWhenFloating
The S1 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:4713
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4769
static constexpr int CloseWhenNotLow
The S1 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:4725
static constexpr int CloseWhenLow
The S1 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:4729
constexpr S1CloseStateValue(int value)
Definition SpnEnums.hpp:4731
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4751
std::string Serialize() const
Definition SpnEnums.hpp:4789
friend std::ostream & operator<<(std::ostream &os, S1CloseStateValue data)
Definition SpnEnums.hpp:4783
constexpr bool operator<(S1CloseStateValue data) const
Definition SpnEnums.hpp:4755
constexpr S1CloseStateValue()
Definition SpnEnums.hpp:4735
constexpr bool operator!=(S1CloseStateValue data) const
Definition SpnEnums.hpp:4747
static constexpr int CloseWhenHigh
The S1 input will be treated as closed when it is High.
Definition SpnEnums.hpp:4721
The floating state of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:4162
std::string Serialize() const
Definition SpnEnums.hpp:4243
int value
Definition SpnEnums.hpp:4164
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:4175
constexpr S1FloatStateValue()
Definition SpnEnums.hpp:4191
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4215
friend std::ostream & operator<<(std::ostream &os, S1FloatStateValue data)
Definition SpnEnums.hpp:4237
constexpr S1FloatStateValue(int value)
Definition SpnEnums.hpp:4187
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4225
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4207
constexpr bool operator==(S1FloatStateValue data) const
Definition SpnEnums.hpp:4195
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:4185
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:4180
constexpr bool operator<(S1FloatStateValue data) const
Definition SpnEnums.hpp:4211
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4199
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:4170
constexpr bool operator!=(S1FloatStateValue data) const
Definition SpnEnums.hpp:4203
State of the Signal 1 input (S1IN).
Definition SpnEnums.hpp:3994
constexpr S1StateValue(int value)
Definition SpnEnums.hpp:4011
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:4005
constexpr S1StateValue()
Definition SpnEnums.hpp:4015
std::string Serialize() const
Definition SpnEnums.hpp:4066
constexpr bool operator==(S1StateValue data) const
Definition SpnEnums.hpp:4019
int value
Definition SpnEnums.hpp:3996
constexpr bool operator!=(S1StateValue data) const
Definition SpnEnums.hpp:4027
constexpr bool operator<(S1StateValue data) const
Definition SpnEnums.hpp:4035
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:4009
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4023
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4039
friend std::ostream & operator<<(std::ostream &os, S1StateValue data)
Definition SpnEnums.hpp:4060
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:4001
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4049
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4031
What value the Signal 2 input (S2IN) needs to be for the CTR Electronics' CANdi™ to detect as Closed.
Definition SpnEnums.hpp:4805
constexpr S2CloseStateValue()
Definition SpnEnums.hpp:4838
static constexpr int CloseWhenNotLow
The S2 input will be treated as closed when it is not Low.
Definition SpnEnums.hpp:4828
int value
Definition SpnEnums.hpp:4807
std::string Serialize() const
Definition SpnEnums.hpp:4892
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4846
constexpr bool operator==(S2CloseStateValue data) const
Definition SpnEnums.hpp:4842
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4854
static constexpr int CloseWhenNotHigh
The S2 input will be treated as closed when it is not High.
Definition SpnEnums.hpp:4820
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4862
constexpr bool operator!=(S2CloseStateValue data) const
Definition SpnEnums.hpp:4850
constexpr S2CloseStateValue(int value)
Definition SpnEnums.hpp:4834
constexpr bool operator<(S2CloseStateValue data) const
Definition SpnEnums.hpp:4858
static constexpr int CloseWhenLow
The S2 input will be treated as closed when it is Low.
Definition SpnEnums.hpp:4832
static constexpr int CloseWhenHigh
The S2 input will be treated as closed when it is High.
Definition SpnEnums.hpp:4824
static constexpr int CloseWhenFloating
The S2 input will be treated as closed when it is floating.
Definition SpnEnums.hpp:4816
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4872
friend std::ostream & operator<<(std::ostream &os, S2CloseStateValue data)
Definition SpnEnums.hpp:4886
static constexpr int CloseWhenNotFloating
The S2 input will be treated as closed when it is not floating.
Definition SpnEnums.hpp:4812
The floating state of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:4255
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4308
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4300
static constexpr int PullHigh
The input will be pulled high when not loaded by an outside device.
Definition SpnEnums.hpp:4268
constexpr bool operator<(S2FloatStateValue data) const
Definition SpnEnums.hpp:4304
constexpr bool operator==(S2FloatStateValue data) const
Definition SpnEnums.hpp:4288
constexpr bool operator!=(S2FloatStateValue data) const
Definition SpnEnums.hpp:4296
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4318
static constexpr int BusKeeper
The input will pull in the direction of the last measured state.
Definition SpnEnums.hpp:4278
constexpr S2FloatStateValue(int value)
Definition SpnEnums.hpp:4280
static constexpr int PullLow
The input will be pulled low when not loaded by an outside device.
Definition SpnEnums.hpp:4273
std::string Serialize() const
Definition SpnEnums.hpp:4336
int value
Definition SpnEnums.hpp:4257
constexpr S2FloatStateValue()
Definition SpnEnums.hpp:4284
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4292
friend std::ostream & operator<<(std::ostream &os, S2FloatStateValue data)
Definition SpnEnums.hpp:4330
static constexpr int FloatDetect
The input will attempt to detect when it is floating.
Definition SpnEnums.hpp:4263
State of the Signal 2 input (S2IN).
Definition SpnEnums.hpp:4078
friend std::ostream & operator<<(std::ostream &os, S2StateValue data)
Definition SpnEnums.hpp:4144
constexpr bool operator==(S2StateValue data) const
Definition SpnEnums.hpp:4103
static constexpr int High
Input is driven high (above 3V).
Definition SpnEnums.hpp:4093
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4115
std::string Serialize() const
Definition SpnEnums.hpp:4150
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4133
int value
Definition SpnEnums.hpp:4080
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4123
constexpr S2StateValue(int value)
Definition SpnEnums.hpp:4095
constexpr bool operator<(S2StateValue data) const
Definition SpnEnums.hpp:4119
constexpr S2StateValue()
Definition SpnEnums.hpp:4099
constexpr bool operator!=(S2StateValue data) const
Definition SpnEnums.hpp:4111
static constexpr int Floating
Input is not driven high or low, it is disconnected from load.
Definition SpnEnums.hpp:4085
static constexpr int Low
Input is driven low (below 0.5V).
Definition SpnEnums.hpp:4089
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4107
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:4619
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:4644
int value
Definition SpnEnums.hpp:4621
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:4652
constexpr bool operator!=(SensorPhaseValue data) const
Definition SpnEnums.hpp:4648
constexpr bool operator<(SensorPhaseValue data) const
Definition SpnEnums.hpp:4656
constexpr SensorPhaseValue(int value)
Definition SpnEnums.hpp:4632
std::string Serialize() const
Definition SpnEnums.hpp:4686
static constexpr int Aligned
The sensor direction is normally aligned with the motor.
Definition SpnEnums.hpp:4626
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:4670
static constexpr int Opposed
The sensor direction is normally opposed to the motor.
Definition SpnEnums.hpp:4630
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:4660
constexpr bool operator==(SensorPhaseValue data) const
Definition SpnEnums.hpp:4640
friend std::ostream & operator<<(std::ostream &os, SensorPhaseValue data)
Definition SpnEnums.hpp:4680
constexpr SensorPhaseValue()
Definition SpnEnums.hpp:4636
Static Feedforward Sign during position closed loop.
Definition SpnEnums.hpp:3370
std::string Serialize() const
Definition SpnEnums.hpp:3442
friend std::ostream & operator<<(std::ostream &os, StaticFeedforwardSignValue data)
Definition SpnEnums.hpp:3436
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3400
constexpr bool operator!=(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3404
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3426
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3416
static constexpr int UseVelocitySign
Use the velocity reference sign.
Definition SpnEnums.hpp:3379
constexpr StaticFeedforwardSignValue()
Definition SpnEnums.hpp:3392
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3408
constexpr bool operator==(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3396
static constexpr int UseClosedLoopSign
Use the sign of closed loop error.
Definition SpnEnums.hpp:3386
constexpr bool operator<(StaticFeedforwardSignValue data) const
Definition SpnEnums.hpp:3412
constexpr StaticFeedforwardSignValue(int value)
Definition SpnEnums.hpp:3388
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:3674
constexpr UpdateModeValue()
Definition SpnEnums.hpp:3697
std::string ToString() const
Gets the string representation of this enum.
Definition SpnEnums.hpp:3731
int value
Definition SpnEnums.hpp:3676
constexpr bool operator<(int data) const
Definition SpnEnums.hpp:3721
static constexpr int ShortRangeUserFreq
Uses short-range detection mode for improved detection under high ambient infrared light conditions.
Definition SpnEnums.hpp:3687
std::string Serialize() const
Definition SpnEnums.hpp:3748
constexpr bool operator!=(int data) const
Definition SpnEnums.hpp:3713
friend std::ostream & operator<<(std::ostream &os, UpdateModeValue data)
Definition SpnEnums.hpp:3742
constexpr bool operator<(UpdateModeValue data) const
Definition SpnEnums.hpp:3717
constexpr bool operator==(UpdateModeValue data) const
Definition SpnEnums.hpp:3701
static constexpr int ShortRange100Hz
Updates distance/proximity at 100hz using short-range detection mode.
Definition SpnEnums.hpp:3681
constexpr UpdateModeValue(int value)
Definition SpnEnums.hpp:3693
constexpr bool operator!=(UpdateModeValue data) const
Definition SpnEnums.hpp:3709
static constexpr int LongRangeUserFreq
Uses long-range detection mode and user-specified update frequency.
Definition SpnEnums.hpp:3691
constexpr bool operator==(int data) const
Definition SpnEnums.hpp:3705
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18