CTRE Phoenix Pro C++ 23.0.12
Configs.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
14#include <sstream>
15#include <string>
16
17namespace ctre {
18namespace phoenixpro {
19namespace configs {
20
22{
23public:
24 virtual std::string ToString() const = 0;
25 friend std::ostream &operator<<(std::ostream &str, const ParentConfiguration &v)
26 {
27 str << v.ToString();
28 return str;
29 }
30 virtual ctre::phoenix::StatusCode Deserialize(const std::string &string) = 0;
31};
32
33
34/**
35 * \brief Configs that affect the magnet sensor and how to interpret
36 * it.
37 *
38 * \details Includes sensor range and other configs related to
39 * sensor.
40 */
42{
43public:
44 /**
45 * \brief Direction of the sensor to determine positive facing the LED
46 * side of the CANcoder.
47 *
48 */
50 /**
51 * \brief This offset is added to the reported position, allowing the
52 * application to trim the zero position. When set to the default
53 * value of zero, position reports zero when magnet north pole aligns
54 * with the LED.
55 *
56 * Minimum Value: -1
57 * Maximum Value: 1
58 * Default Value: 0
59 * Units: rotations
60 */
61 double MagnetOffset = 0;
62 /**
63 * \brief The range of the absolute sensor, either [0, 1) or [-0.5,
64 * 0.5).
65 *
66 */
68
69 std::string ToString() const
70 {
71 std::stringstream ss;
72 ss << "{" << std::endl;
73 ss << "Config Group: MagnetSensor" << std::endl;
74 ss << "Name: \"SensorDirection\" Value: \"" << SensorDirection << "\"" << std::endl;
75 ss << "Name: \"MagnetOffset\" Value: \"" << MagnetOffset << "rotations\"" << std::endl;
76 ss << "Name: \"AbsoluteSensorRange\" Value: \"" << AbsoluteSensorRange << "\"" << std::endl;
77 ss << "}" << std::endl;
78 return ss.str();
79 }
80
81 std::string Serialize() const
82 {
83 std::stringstream ss;
84 char *ref;
85 c_ctre_phoenixpro_serialize_int(821, SensorDirection.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
86 c_ctre_phoenixpro_serialize_double(1003, MagnetOffset, &ref); if(ref != nullptr) { ss << ref; free(ref); }
87 c_ctre_phoenixpro_serialize_int(1004, AbsoluteSensorRange.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
88 return ss.str();
89 }
90
91 ctre::phoenix::StatusCode Deserialize(const std::string& string)
92 {
93 const char *string_c_str = string.c_str();
94 size_t string_length = string.length();
98 return 0;
99 }
100};
101
102
103/**
104 * \brief Configs for Pigeon 2's Mount Pose configuration.
105 *
106 * \details These configs allow the Pigeon2 to be mounted in whatever
107 * orientation that's desired and ensure the reported
108 * Yaw/Pitch/Roll is from the robot's reference.
109 */
111{
112public:
113 /**
114 * \brief The mounting calibration yaw-component
115 *
116 * Minimum Value: -360
117 * Maximum Value: 360
118 * Default Value: 0
119 * Units: deg
120 */
121 double MountPoseYaw = 0;
122 /**
123 * \brief The mounting calibration pitch-component
124 *
125 * Minimum Value: -360
126 * Maximum Value: 360
127 * Default Value: 0
128 * Units: deg
129 */
130 double MountPosePitch = 0;
131 /**
132 * \brief The mounting calibration roll-component
133 *
134 * Minimum Value: -360
135 * Maximum Value: 360
136 * Default Value: 0
137 * Units: deg
138 */
139 double MountPoseRoll = 0;
140
141 std::string ToString() const
142 {
143 std::stringstream ss;
144 ss << "{" << std::endl;
145 ss << "Config Group: MountPose" << std::endl;
146 ss << "Name: \"MountPoseYaw\" Value: \"" << MountPoseYaw << "deg\"" << std::endl;
147 ss << "Name: \"MountPosePitch\" Value: \"" << MountPosePitch << "deg\"" << std::endl;
148 ss << "Name: \"MountPoseRoll\" Value: \"" << MountPoseRoll << "deg\"" << std::endl;
149 ss << "}" << std::endl;
150 return ss.str();
151 }
152
153 std::string Serialize() const
154 {
155 std::stringstream ss;
156 char *ref;
157 c_ctre_phoenixpro_serialize_double(952, MountPoseYaw, &ref); if(ref != nullptr) { ss << ref; free(ref); }
158 c_ctre_phoenixpro_serialize_double(953, MountPosePitch, &ref); if(ref != nullptr) { ss << ref; free(ref); }
159 c_ctre_phoenixpro_serialize_double(954, MountPoseRoll, &ref); if(ref != nullptr) { ss << ref; free(ref); }
160 return ss.str();
161 }
162
163 ctre::phoenix::StatusCode Deserialize(const std::string& string)
164 {
165 const char *string_c_str = string.c_str();
166 size_t string_length = string.length();
170 return 0;
171 }
172};
173
174
175/**
176 * \brief Configs to trim the Pigeon2's gyroscope.
177 *
178 * \details Pigeon2 allows the user to trim the gyroscope's
179 * sensitivity. While this isn't necessary for the Pigeon2,
180 * as it comes calibrated out-of-the-box, users can make use
181 * of this to make the Pigeon2 even more accurate for their
182 * application.
183 */
185{
186public:
187 /**
188 * \brief The gyro scalar component for the X axis
189 *
190 * Minimum Value: -180
191 * Maximum Value: 180
192 * Default Value: 0
193 * Units: deg per rotation
194 */
195 double GyroScalarX = 0;
196 /**
197 * \brief The gyro scalar component for the Y axis
198 *
199 * Minimum Value: -180
200 * Maximum Value: 180
201 * Default Value: 0
202 * Units: deg per rotation
203 */
204 double GyroScalarY = 0;
205 /**
206 * \brief The gyro scalar component for the Z axis
207 *
208 * Minimum Value: -180
209 * Maximum Value: 180
210 * Default Value: 0
211 * Units: deg per rotation
212 */
213 double GyroScalarZ = 0;
214
215 std::string ToString() const
216 {
217 std::stringstream ss;
218 ss << "{" << std::endl;
219 ss << "Config Group: GyroTrim" << std::endl;
220 ss << "Name: \"GyroScalarX\" Value: \"" << GyroScalarX << "deg per rotation\"" << std::endl;
221 ss << "Name: \"GyroScalarY\" Value: \"" << GyroScalarY << "deg per rotation\"" << std::endl;
222 ss << "Name: \"GyroScalarZ\" Value: \"" << GyroScalarZ << "deg per rotation\"" << std::endl;
223 ss << "}" << std::endl;
224 return ss.str();
225 }
226
227 std::string Serialize() const
228 {
229 std::stringstream ss;
230 char *ref;
231 c_ctre_phoenixpro_serialize_double(958, GyroScalarX, &ref); if(ref != nullptr) { ss << ref; free(ref); }
232 c_ctre_phoenixpro_serialize_double(959, GyroScalarY, &ref); if(ref != nullptr) { ss << ref; free(ref); }
233 c_ctre_phoenixpro_serialize_double(960, GyroScalarZ, &ref); if(ref != nullptr) { ss << ref; free(ref); }
234 return ss.str();
235 }
236
237 ctre::phoenix::StatusCode Deserialize(const std::string& string)
238 {
239 const char *string_c_str = string.c_str();
240 size_t string_length = string.length();
244 return 0;
245 }
246};
247
248
249/**
250 * \brief Configs to enable/disable various features of the Pigeon2.
251 *
252 * \details These configs allow the user to enable or disable various
253 * aspects of the Pigeon2.
254 */
256{
257public:
258 /**
259 * \brief Turns on or off the magnetometer fusing for 9-axis. FRC
260 * users are not recommended to turn this on, as the magnetic
261 * influence of the robot will likely negatively affect the
262 * performance of the Pigeon2.
263 *
264 * Default Value: False
265 */
266 bool EnableCompass = false;
267 /**
268 * \brief Disables using the temperature compensation feature
269 *
270 * Default Value: False
271 */
273 /**
274 * \brief Disables using the no-motion calibration feature
275 *
276 * Default Value: False
277 */
279
280 std::string ToString() const
281 {
282 std::stringstream ss;
283 ss << "{" << std::endl;
284 ss << "Config Group: Pigeon2Features" << std::endl;
285 ss << "Name: \"EnableCompass\" Value: \"" << EnableCompass << "\"" << std::endl;
286 ss << "Name: \"DisableTemperatureCompensation\" Value: \"" << DisableTemperatureCompensation << "\"" << std::endl;
287 ss << "Name: \"DisableNoMotionCalibration\" Value: \"" << DisableNoMotionCalibration << "\"" << std::endl;
288 ss << "}" << std::endl;
289 return ss.str();
290 }
291
292 std::string Serialize() const
293 {
294 std::stringstream ss;
295 char *ref;
296 c_ctre_phoenixpro_serialize_bool(910, EnableCompass, &ref); if(ref != nullptr) { ss << ref; free(ref); }
297 c_ctre_phoenixpro_serialize_bool(945, DisableTemperatureCompensation, &ref); if(ref != nullptr) { ss << ref; free(ref); }
298 c_ctre_phoenixpro_serialize_bool(947, DisableNoMotionCalibration, &ref); if(ref != nullptr) { ss << ref; free(ref); }
299 return ss.str();
300 }
301
302 ctre::phoenix::StatusCode Deserialize(const std::string& string)
303 {
304 const char *string_c_str = string.c_str();
305 size_t string_length = string.length();
309 return 0;
310 }
311};
312
313
314/**
315 * \brief What the gains for slot 0 are
316 *
317 * \details If this slot is selected, these gains are used in closed
318 * loop control requests.
319 */
321{
322public:
323 /**
324 * \brief Proportional Gain
325 *
326 * \details The units for this gain is dependent on the control mode.
327 * Since this gain is multiplied by error in the input, the units
328 * should be defined as units of output per unit of input error. For
329 * example, when controlling velocity using a duty cycle closed loop,
330 * the units for the proportional gain will be duty cycle per rps of
331 * error, or 1/rps.
332 *
333 * Minimum Value: 0
334 * Maximum Value: 3.4e+38
335 * Default Value: 0
336 * Units:
337 */
338 double kP = 0;
339 /**
340 * \brief Integral Gain
341 *
342 * \details The units for this gain is dependent on the control mode.
343 * Since this gain is multiplied by error in the input integrated over
344 * time (in units of seconds), the units should be defined as units of
345 * output per unit of integrated input error. For example, when
346 * controlling velocity using a duty cycle closed loop, integrating
347 * velocity over time results in rps * s = rotations. Therefore, the
348 * units for the integral gain will be duty cycle per rotation of
349 * accumulated error, or 1/rot.
350 *
351 * Minimum Value: 0
352 * Maximum Value: 3.4e+38
353 * Default Value: 0
354 * Units:
355 */
356 double kI = 0;
357 /**
358 * \brief Derivative Gain
359 *
360 * \details The units for this gain is dependent on the control mode.
361 * Since this gain is multiplied by the derivative of error in the
362 * input with respect to time (in units of seconds), the units should
363 * be defined as units of output per unit of the differentiated input
364 * error. For example, when controlling velocity using a duty cycle
365 * closed loop, the derivative of velocity with respect to time is
366 * rps/s, which is acceleration. Therefore, the units for the
367 * derivative gain will be duty cycle per unit of acceleration error,
368 * or 1/(rps/s).
369 *
370 * Minimum Value: 0
371 * Maximum Value: 3.4e+38
372 * Default Value: 0
373 * Units:
374 */
375 double kD = 0;
376 /**
377 * \brief Velocity Feed Forward Gain
378 *
379 * \details The units for this gain is dependent on the control mode.
380 * Since this gain is multiplied by the requested velocity, the units
381 * should be defined as units of output per unit of requested input
382 * velocity. For example, when controlling velocity using a duty cycle
383 * closed loop, the units for the velocity feed foward gain will be
384 * duty cycle per requested rps, or 1/rps.
385 *
386 * Minimum Value: 0
387 * Maximum Value: 3.4e+38
388 * Default Value: 0
389 * Units:
390 */
391 double kV = 0;
392 /**
393 * \brief Static Constant
394 *
395 * \details This is added to the closed loop output. The sign is
396 * determined by target velocity. The unit for this constant is
397 * dependent on the control mode, typically fractional duty cycle,
398 * voltage, or torque current.
399 *
400 * Minimum Value: -512
401 * Maximum Value: 511
402 * Default Value: 0
403 * Units:
404 */
405 double kS = 0;
406
407 std::string ToString() const
408 {
409 std::stringstream ss;
410 ss << "{" << std::endl;
411 ss << "Config Group: Slot0" << std::endl;
412 ss << "Name: \"kP\" Value: \"" << kP << "\"" << std::endl;
413 ss << "Name: \"kI\" Value: \"" << kI << "\"" << std::endl;
414 ss << "Name: \"kD\" Value: \"" << kD << "\"" << std::endl;
415 ss << "Name: \"kV\" Value: \"" << kV << "\"" << std::endl;
416 ss << "Name: \"kS\" Value: \"" << kS << "\"" << std::endl;
417 ss << "}" << std::endl;
418 return ss.str();
419 }
420
421 std::string Serialize() const
422 {
423 std::stringstream ss;
424 char *ref;
425 c_ctre_phoenixpro_serialize_double(1407, kP, &ref); if(ref != nullptr) { ss << ref; free(ref); }
426 c_ctre_phoenixpro_serialize_double(1408, kI, &ref); if(ref != nullptr) { ss << ref; free(ref); }
427 c_ctre_phoenixpro_serialize_double(1409, kD, &ref); if(ref != nullptr) { ss << ref; free(ref); }
428 c_ctre_phoenixpro_serialize_double(1410, kV, &ref); if(ref != nullptr) { ss << ref; free(ref); }
429 c_ctre_phoenixpro_serialize_double(1411, kS, &ref); if(ref != nullptr) { ss << ref; free(ref); }
430 return ss.str();
431 }
432
433 ctre::phoenix::StatusCode Deserialize(const std::string& string)
434 {
435 const char *string_c_str = string.c_str();
436 size_t string_length = string.length();
442 return 0;
443 }
444};
445
446
447/**
448 * \brief What the gains for slot 1 are
449 *
450 * \details If this slot is selected, these gains are used in closed
451 * loop control requests.
452 */
454{
455public:
456 /**
457 * \brief Proportional Gain
458 *
459 * \details The units for this gain is dependent on the control mode.
460 * Since this gain is multiplied by error in the input, the units
461 * should be defined as units of output per unit of input error. For
462 * example, when controlling velocity using a duty cycle closed loop,
463 * the units for the proportional gain will be duty cycle per rps, or
464 * 1/rps.
465 *
466 * Minimum Value: 0
467 * Maximum Value: 3.4e+38
468 * Default Value: 0
469 * Units:
470 */
471 double kP = 0;
472 /**
473 * \brief Integral Gain
474 *
475 * \details The units for this gain is dependent on the control mode.
476 * Since this gain is multiplied by error in the input integrated over
477 * time (in units of seconds), the units should be defined as units of
478 * output per unit of integrated input error. For example, when
479 * controlling velocity using a duty cycle closed loop, integrating
480 * velocity over time results in rps * s = rotations. Therefore, the
481 * units for the integral gain will be duty cycle per rotation of
482 * accumulated error, or 1/rot.
483 *
484 * Minimum Value: 0
485 * Maximum Value: 3.4e+38
486 * Default Value: 0
487 * Units:
488 */
489 double kI = 0;
490 /**
491 * \brief Derivative Gain
492 *
493 * \details The units for this gain is dependent on the control mode.
494 * Since this gain is multiplied by the derivative of error in the
495 * input with respect to time (in units of seconds), the units should
496 * be defined as units of output per unit of the differentiated input
497 * error. For example, when controlling velocity using a duty cycle
498 * closed loop, the derivative of velocity with respect to time is
499 * rps/s, which is acceleration. Therefore, the units for the
500 * derivative gain will be duty cycle per unit of acceleration error,
501 * or 1/(rps/s).
502 *
503 * Minimum Value: 0
504 * Maximum Value: 3.4e+38
505 * Default Value: 0
506 * Units:
507 */
508 double kD = 0;
509 /**
510 * \brief Velocity Feed Forward Gain
511 *
512 * \details The units for this gain is dependent on the control mode.
513 * Since this gain is multiplied by the requested velocity, the units
514 * should be defined as units of output per unit of requested input
515 * velocity. For example, when controlling velocity using a duty cycle
516 * closed loop, the units for the velocity feed foward gain will be
517 * duty cycle per requested rps, or 1/rps.
518 *
519 * Minimum Value: 0
520 * Maximum Value: 3.4e+38
521 * Default Value: 0
522 * Units:
523 */
524 double kV = 0;
525 /**
526 * \brief Static Constant
527 *
528 * \details This is added to the closed loop output. The sign is
529 * determined by target velocity. The unit for this constant is
530 * dependent on the control mode, typically fractional duty cycle,
531 * voltage, or torque current.
532 *
533 * Minimum Value: -512
534 * Maximum Value: 511
535 * Default Value: 0
536 * Units:
537 */
538 double kS = 0;
539
540 std::string ToString() const
541 {
542 std::stringstream ss;
543 ss << "{" << std::endl;
544 ss << "Config Group: Slot1" << std::endl;
545 ss << "Name: \"kP\" Value: \"" << kP << "\"" << std::endl;
546 ss << "Name: \"kI\" Value: \"" << kI << "\"" << std::endl;
547 ss << "Name: \"kD\" Value: \"" << kD << "\"" << std::endl;
548 ss << "Name: \"kV\" Value: \"" << kV << "\"" << std::endl;
549 ss << "Name: \"kS\" Value: \"" << kS << "\"" << std::endl;
550 ss << "}" << std::endl;
551 return ss.str();
552 }
553
554 std::string Serialize() const
555 {
556 std::stringstream ss;
557 char *ref;
558 c_ctre_phoenixpro_serialize_double(1412, kP, &ref); if(ref != nullptr) { ss << ref; free(ref); }
559 c_ctre_phoenixpro_serialize_double(1413, kI, &ref); if(ref != nullptr) { ss << ref; free(ref); }
560 c_ctre_phoenixpro_serialize_double(1414, kD, &ref); if(ref != nullptr) { ss << ref; free(ref); }
561 c_ctre_phoenixpro_serialize_double(1415, kV, &ref); if(ref != nullptr) { ss << ref; free(ref); }
562 c_ctre_phoenixpro_serialize_double(1416, kS, &ref); if(ref != nullptr) { ss << ref; free(ref); }
563 return ss.str();
564 }
565
566 ctre::phoenix::StatusCode Deserialize(const std::string& string)
567 {
568 const char *string_c_str = string.c_str();
569 size_t string_length = string.length();
575 return 0;
576 }
577};
578
579
580/**
581 * \brief What the gains for slot 2 are
582 *
583 * \details If this slot is selected, these gains are used in closed
584 * loop control requests.
585 */
587{
588public:
589 /**
590 * \brief Proportional Gain
591 *
592 * \details The units for this gain is dependent on the control mode.
593 * Since this gain is multiplied by error in the input, the units
594 * should be defined as units of output per unit of input error. For
595 * example, when controlling velocity using a duty cycle closed loop,
596 * the units for the proportional gain will be duty cycle per rps, or
597 * 1/rps.
598 *
599 * Minimum Value: 0
600 * Maximum Value: 3.4e+38
601 * Default Value: 0
602 * Units:
603 */
604 double kP = 0;
605 /**
606 * \brief Integral Gain
607 *
608 * \details The units for this gain is dependent on the control mode.
609 * Since this gain is multiplied by error in the input integrated over
610 * time (in units of seconds), the units should be defined as units of
611 * output per unit of integrated input error. For example, when
612 * controlling velocity using a duty cycle closed loop, integrating
613 * velocity over time results in rps * s = rotations. Therefore, the
614 * units for the integral gain will be duty cycle per rotation of
615 * accumulated error, or 1/rot.
616 *
617 * Minimum Value: 0
618 * Maximum Value: 3.4e+38
619 * Default Value: 0
620 * Units:
621 */
622 double kI = 0;
623 /**
624 * \brief Derivative Gain
625 *
626 * \details The units for this gain is dependent on the control mode.
627 * Since this gain is multiplied by the derivative of error in the
628 * input with respect to time (in units of seconds), the units should
629 * be defined as units of output per unit of the differentiated input
630 * error. For example, when controlling velocity using a duty cycle
631 * closed loop, the derivative of velocity with respect to time is
632 * rps/s, which is acceleration. Therefore, the units for the
633 * derivative gain will be duty cycle per unit of acceleration error,
634 * or 1/(rps/s).
635 *
636 * Minimum Value: 0
637 * Maximum Value: 3.4e+38
638 * Default Value: 0
639 * Units:
640 */
641 double kD = 0;
642 /**
643 * \brief Velocity Feed Forward Gain
644 *
645 * \details The units for this gain is dependent on the control mode.
646 * Since this gain is multiplied by the requested velocity, the units
647 * should be defined as units of output per unit of requested input
648 * velocity. For example, when controlling velocity using a duty cycle
649 * closed loop, the units for the velocity feed foward gain will be
650 * duty cycle per requested rps, or 1/rps.
651 *
652 * Minimum Value: 0
653 * Maximum Value: 3.4e+38
654 * Default Value: 0
655 * Units:
656 */
657 double kV = 0;
658 /**
659 * \brief Static Constant
660 *
661 * \details This is added to the closed loop output. The sign is
662 * determined by target velocity. The unit for this constant is
663 * dependent on the control mode, typically fractional duty cycle,
664 * voltage, or torque current.
665 *
666 * Minimum Value: -512
667 * Maximum Value: 511
668 * Default Value: 0
669 * Units:
670 */
671 double kS = 0;
672
673 std::string ToString() const
674 {
675 std::stringstream ss;
676 ss << "{" << std::endl;
677 ss << "Config Group: Slot2" << std::endl;
678 ss << "Name: \"kP\" Value: \"" << kP << "\"" << std::endl;
679 ss << "Name: \"kI\" Value: \"" << kI << "\"" << std::endl;
680 ss << "Name: \"kD\" Value: \"" << kD << "\"" << std::endl;
681 ss << "Name: \"kV\" Value: \"" << kV << "\"" << std::endl;
682 ss << "Name: \"kS\" Value: \"" << kS << "\"" << std::endl;
683 ss << "}" << std::endl;
684 return ss.str();
685 }
686
687 std::string Serialize() const
688 {
689 std::stringstream ss;
690 char *ref;
691 c_ctre_phoenixpro_serialize_double(1417, kP, &ref); if(ref != nullptr) { ss << ref; free(ref); }
692 c_ctre_phoenixpro_serialize_double(1418, kI, &ref); if(ref != nullptr) { ss << ref; free(ref); }
693 c_ctre_phoenixpro_serialize_double(1419, kD, &ref); if(ref != nullptr) { ss << ref; free(ref); }
694 c_ctre_phoenixpro_serialize_double(1420, kV, &ref); if(ref != nullptr) { ss << ref; free(ref); }
695 c_ctre_phoenixpro_serialize_double(1421, kS, &ref); if(ref != nullptr) { ss << ref; free(ref); }
696 return ss.str();
697 }
698
699 ctre::phoenix::StatusCode Deserialize(const std::string& string)
700 {
701 const char *string_c_str = string.c_str();
702 size_t string_length = string.length();
708 return 0;
709 }
710};
711
712
713/**
714 * \brief Configs that directly affect motor-output.
715 *
716 * \details Includes Motor Invert and various limit features.
717 */
719{
720public:
721 /**
722 * \brief Invert state of the device
723 *
724 */
726 /**
727 * \brief The state of the motor controller bridge when output is
728 * neutral or disabled.
729 *
730 */
732 /**
733 * \brief Configures the output deadband percentage.
734 *
735 * Minimum Value: 0.0
736 * Maximum Value: 0.25
737 * Default Value: 0
738 * Units: fractional
739 */
741 /**
742 * \brief Maximum (forward) output during duty cycle based control
743 * modes.
744 *
745 * Minimum Value: -1.0
746 * Maximum Value: 1.0
747 * Default Value: 1
748 * Units: fractional
749 */
751 /**
752 * \brief Minimum (reverse) output during duty cycle based control
753 * modes.
754 *
755 * Minimum Value: -1.0
756 * Maximum Value: 1.0
757 * Default Value: -1
758 * Units: fractional
759 */
761
762 std::string ToString() const
763 {
764 std::stringstream ss;
765 ss << "{" << std::endl;
766 ss << "Config Group: MotorOutput" << std::endl;
767 ss << "Name: \"Inverted\" Value: \"" << Inverted << "\"" << std::endl;
768 ss << "Name: \"NeutralMode\" Value: \"" << NeutralMode << "\"" << std::endl;
769 ss << "Name: \"DutyCycleNeutralDeadband\" Value: \"" << DutyCycleNeutralDeadband << "fractional\"" << std::endl;
770 ss << "Name: \"PeakForwardDutyCycle\" Value: \"" << PeakForwardDutyCycle << "fractional\"" << std::endl;
771 ss << "Name: \"PeakReverseDutyCycle\" Value: \"" << PeakReverseDutyCycle << "fractional\"" << std::endl;
772 ss << "}" << std::endl;
773 return ss.str();
774 }
775
776 std::string Serialize() const
777 {
778 std::stringstream ss;
779 char *ref;
780 c_ctre_phoenixpro_serialize_int(1422, Inverted.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
781 c_ctre_phoenixpro_serialize_int(1425, NeutralMode.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
782 c_ctre_phoenixpro_serialize_double(1426, DutyCycleNeutralDeadband, &ref); if(ref != nullptr) { ss << ref; free(ref); }
783 c_ctre_phoenixpro_serialize_double(1431, PeakForwardDutyCycle, &ref); if(ref != nullptr) { ss << ref; free(ref); }
784 c_ctre_phoenixpro_serialize_double(1432, PeakReverseDutyCycle, &ref); if(ref != nullptr) { ss << ref; free(ref); }
785 return ss.str();
786 }
787
788 ctre::phoenix::StatusCode Deserialize(const std::string& string)
789 {
790 const char *string_c_str = string.c_str();
791 size_t string_length = string.length();
797 return 0;
798 }
799};
800
801
802/**
803 * \brief Configs that directly affect current limiting features.
804 *
805 * \details Includes Motor Invert and various limit features.
806 */
808{
809public:
810 /**
811 * \brief The amount of current allowed in the motor (motoring and
812 * regen current). This is only applicable for non-torque current
813 * control modes. Note this requires the corresponding enable to be
814 * true.
815 *
816 * Minimum Value: 0.0
817 * Maximum Value: 800.0
818 * Default Value: 0
819 * Units: A
820 */
822 /**
823 * \brief Enable motor stator current limiting.
824 *
825 * Default Value: False
826 */
828 /**
829 * \brief The amount of supply current allowed. This is only
830 * applicable for non-torque current control modes. Note this
831 * requires the corresponding enable to be true. Use
832 * SupplyCurrentThreshold and SupplyTimeThreshold to allow brief
833 * periods of high-current before limiting occurs.
834 *
835 * Minimum Value: 0.0
836 * Maximum Value: 800.0
837 * Default Value: 0
838 * Units: A
839 */
841 /**
842 * \brief Enable motor supply current limiting.
843 *
844 * Default Value: False
845 */
847 /**
848 * \brief Delay supply current limiting until current exceeds this
849 * threshold for longer than SupplyTimeThreshold. This allows current
850 * draws above SupplyCurrentLimit for a fixed period of time. This
851 * has no effect if SupplyCurrentLimit is greater than this value.
852 *
853 * Minimum Value: 0.0
854 * Maximum Value: 511
855 * Default Value: 0
856 * Units: A
857 */
859 /**
860 * \brief Allows unlimited current for a period of time before current
861 * limiting occurs. Current threshold is the maximum of
862 * SupplyCurrentThreshold and SupplyCurrentLimit.
863 *
864 * Minimum Value: 0.0
865 * Maximum Value: 1.275
866 * Default Value: 0
867 * Units: sec
868 */
870
871 std::string ToString() const
872 {
873 std::stringstream ss;
874 ss << "{" << std::endl;
875 ss << "Config Group: CurrentLimits" << std::endl;
876 ss << "Name: \"StatorCurrentLimit\" Value: \"" << StatorCurrentLimit << "A\"" << std::endl;
877 ss << "Name: \"StatorCurrentLimitEnable\" Value: \"" << StatorCurrentLimitEnable << "\"" << std::endl;
878 ss << "Name: \"SupplyCurrentLimit\" Value: \"" << SupplyCurrentLimit << "A\"" << std::endl;
879 ss << "Name: \"SupplyCurrentLimitEnable\" Value: \"" << SupplyCurrentLimitEnable << "\"" << std::endl;
880 ss << "Name: \"SupplyCurrentThreshold\" Value: \"" << SupplyCurrentThreshold << "A\"" << std::endl;
881 ss << "Name: \"SupplyTimeThreshold\" Value: \"" << SupplyTimeThreshold << "sec\"" << std::endl;
882 ss << "}" << std::endl;
883 return ss.str();
884 }
885
886 std::string Serialize() const
887 {
888 std::stringstream ss;
889 char *ref;
890 c_ctre_phoenixpro_serialize_double(1427, StatorCurrentLimit, &ref); if(ref != nullptr) { ss << ref; free(ref); }
891 c_ctre_phoenixpro_serialize_bool(1428, StatorCurrentLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
892 c_ctre_phoenixpro_serialize_double(1429, SupplyCurrentLimit, &ref); if(ref != nullptr) { ss << ref; free(ref); }
893 c_ctre_phoenixpro_serialize_bool(1430, SupplyCurrentLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
894 c_ctre_phoenixpro_serialize_double(1505, SupplyCurrentThreshold, &ref); if(ref != nullptr) { ss << ref; free(ref); }
895 c_ctre_phoenixpro_serialize_double(1506, SupplyTimeThreshold, &ref); if(ref != nullptr) { ss << ref; free(ref); }
896 return ss.str();
897 }
898
899 ctre::phoenix::StatusCode Deserialize(const std::string& string)
900 {
901 const char *string_c_str = string.c_str();
902 size_t string_length = string.length();
909 return 0;
910 }
911};
912
913
914/**
915 * \brief Voltage-specific configs
916 *
917 * \details Voltage-specific configs
918 */
920{
921public:
922 /**
923 * \brief The time constant (in seconds) of the low-pass filter for
924 * the supply voltage.
925 *
926 * \details This impacts the filtering for the reported supply
927 * voltage, and any control strategies that use the supply voltage
928 * (such as voltage control on a motor controller).
929 *
930 * Minimum Value: 0.0
931 * Maximum Value: 0.1
932 * Default Value: 0
933 * Units: sec
934 */
936 /**
937 * \brief Maximum (forward) output during voltage based control modes.
938 *
939 * Minimum Value: -16
940 * Maximum Value: 16
941 * Default Value: 16
942 * Units: V
943 */
945 /**
946 * \brief Minimum (reverse) output during voltage based control modes.
947 *
948 * Minimum Value: -16
949 * Maximum Value: 16
950 * Default Value: -16
951 * Units: V
952 */
953 double PeakReverseVoltage = -16;
954
955 std::string ToString() const
956 {
957 std::stringstream ss;
958 ss << "{" << std::endl;
959 ss << "Config Group: Voltage" << std::endl;
960 ss << "Name: \"SupplyVoltageTimeConstant\" Value: \"" << SupplyVoltageTimeConstant << "sec\"" << std::endl;
961 ss << "Name: \"PeakForwardVoltage\" Value: \"" << PeakForwardVoltage << "V\"" << std::endl;
962 ss << "Name: \"PeakReverseVoltage\" Value: \"" << PeakReverseVoltage << "V\"" << std::endl;
963 ss << "}" << std::endl;
964 return ss.str();
965 }
966
967 std::string Serialize() const
968 {
969 std::stringstream ss;
970 char *ref;
971 c_ctre_phoenixpro_serialize_double(1423, SupplyVoltageTimeConstant, &ref); if(ref != nullptr) { ss << ref; free(ref); }
972 c_ctre_phoenixpro_serialize_double(1433, PeakForwardVoltage, &ref); if(ref != nullptr) { ss << ref; free(ref); }
973 c_ctre_phoenixpro_serialize_double(1434, PeakReverseVoltage, &ref); if(ref != nullptr) { ss << ref; free(ref); }
974 return ss.str();
975 }
976
977 ctre::phoenix::StatusCode Deserialize(const std::string& string)
978 {
979 const char *string_c_str = string.c_str();
980 size_t string_length = string.length();
984 return 0;
985 }
986};
987
988
989/**
990 * \brief Configs that directly affect motor-output.
991 *
992 * \details Includes Motor Invert and various limit features.
993 */
995{
996public:
997 /**
998 * \brief Maximum (forward) output during torque current based control
999 * modes.
1000 *
1001 * Minimum Value: -800
1002 * Maximum Value: 800
1003 * Default Value: 800
1004 * Units: A
1005 */
1007 /**
1008 * \brief Minimum (reverse) output during torque current based control
1009 * modes.
1010 *
1011 * Minimum Value: -800
1012 * Maximum Value: 800
1013 * Default Value: -800
1014 * Units: A
1015 */
1017 /**
1018 * \brief Configures the output deadband during torque current based
1019 * control modes.
1020 *
1021 * Minimum Value: 0
1022 * Maximum Value: 25
1023 * Default Value: 0.0
1024 * Units: A
1025 */
1027
1028 std::string ToString() const
1029 {
1030 std::stringstream ss;
1031 ss << "{" << std::endl;
1032 ss << "Config Group: TorqueCurrent" << std::endl;
1033 ss << "Name: \"PeakForwardTorqueCurrent\" Value: \"" << PeakForwardTorqueCurrent << "A\"" << std::endl;
1034 ss << "Name: \"PeakReverseTorqueCurrent\" Value: \"" << PeakReverseTorqueCurrent << "A\"" << std::endl;
1035 ss << "Name: \"TorqueNeutralDeadband\" Value: \"" << TorqueNeutralDeadband << "A\"" << std::endl;
1036 ss << "}" << std::endl;
1037 return ss.str();
1038 }
1039
1040 std::string Serialize() const
1041 {
1042 std::stringstream ss;
1043 char *ref;
1044 c_ctre_phoenixpro_serialize_double(1435, PeakForwardTorqueCurrent, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1045 c_ctre_phoenixpro_serialize_double(1436, PeakReverseTorqueCurrent, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1046 c_ctre_phoenixpro_serialize_double(1437, TorqueNeutralDeadband, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1047 return ss.str();
1048 }
1049
1050 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1051 {
1052 const char *string_c_str = string.c_str();
1053 size_t string_length = string.length();
1057 return 0;
1058 }
1059};
1060
1061
1062/**
1063 * \brief Configs that directly affect motor-output.
1064 *
1065 * \details Includes Motor Invert and various limit features.
1066 */
1068{
1069public:
1070 /**
1071 * \brief This offset is applied to the absolute integrated rotor
1072 * sensor. This can be used to zero the rotor in applications that
1073 * are within one rotor rotation.
1074 *
1075 * Minimum Value: -1
1076 * Maximum Value: 1
1077 * Default Value: 0.0
1078 * Units: rotations
1079 */
1081 /**
1082 * \brief This is the ratio of sensor rotations to the mechanism's
1083 * output. This is equivalent to the mechanism's gear ratio if the
1084 * sensor is located on the input of a gearbox. If sensor is on the
1085 * output of a gearbox, then this is typically set to 1. Note if this
1086 * is set to zero, device will reset back to one.
1087 *
1088 * Minimum Value: -1000
1089 * Maximum Value: 1000
1090 * Default Value: 1.0
1091 * Units: scalar
1092 */
1094 /**
1095 * \brief Talon FX is capable of fusing a remote CANcoder with its
1096 * rotor sensor to produce a high-bandwidth sensor source. This
1097 * feature requires specifying the ratio between the remote sensor and
1098 * the motor rotor. Note if this is set to zero, device will reset
1099 * back to one.
1100 *
1101 * Minimum Value: -1000
1102 * Maximum Value: 1000
1103 * Default Value: 1.0
1104 * Units: scalar
1105 */
1107 /**
1108 * \brief Choose what sensor source is reported via API and used by
1109 * closed-loop and limit features. The default is RotorSensor, which
1110 * uses the internal rotor sensor in the Talon FX. Choose
1111 * RemoteCANcoder to use another CANcoder on the same CAN bus (this
1112 * also requires setting FeedbackRemoteSensorID). Talon FX will
1113 * update its position and velocity whenever CANcoder publishes its
1114 * information on CAN bus. Choose FusedCANcoder and Talon FX will
1115 * fuse another CANcoder's information with the internal rotor, which
1116 * provides the best possible position and velocity for accuracy and
1117 * bandwidth (note this requires setting FeedbackRemoteSensorID).
1118 * FusedCANcoder was developed for applications such as
1119 * swerve-azimuth.
1120 *
1121 * \details Note: When the Talon Source is changed to FusedCANcoder,
1122 * the Talon needs a period of time to fuse before sensor-based
1123 * (soft-limit, closed loop, etc.) features are used. This period of
1124 * time is determined by the update frequency of the CANcoder's
1125 * Position signal.
1126 *
1127 */
1129 /**
1130 * \brief Device ID of which remote device to use. This is not used
1131 * if the Sensor Source is the internal rotor sensor.
1132 *
1133 * Minimum Value: 0
1134 * Maximum Value: 62
1135 * Default Value: 0
1136 * Units:
1137 */
1139
1140 std::string ToString() const
1141 {
1142 std::stringstream ss;
1143 ss << "{" << std::endl;
1144 ss << "Config Group: Feedback" << std::endl;
1145 ss << "Name: \"FeedbackRotorOffset\" Value: \"" << FeedbackRotorOffset << "rotations\"" << std::endl;
1146 ss << "Name: \"SensorToMechanismRatio\" Value: \"" << SensorToMechanismRatio << "scalar\"" << std::endl;
1147 ss << "Name: \"RotorToSensorRatio\" Value: \"" << RotorToSensorRatio << "scalar\"" << std::endl;
1148 ss << "Name: \"FeedbackSensorSource\" Value: \"" << FeedbackSensorSource << "\"" << std::endl;
1149 ss << "Name: \"FeedbackRemoteSensorID\" Value: \"" << FeedbackRemoteSensorID << "\"" << std::endl;
1150 ss << "}" << std::endl;
1151 return ss.str();
1152 }
1153
1154 std::string Serialize() const
1155 {
1156 std::stringstream ss;
1157 char *ref;
1158 c_ctre_phoenixpro_serialize_double(1438, FeedbackRotorOffset, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1159 c_ctre_phoenixpro_serialize_double(1439, SensorToMechanismRatio, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1160 c_ctre_phoenixpro_serialize_double(1440, RotorToSensorRatio, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1161 c_ctre_phoenixpro_serialize_int(1441, FeedbackSensorSource.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1162 c_ctre_phoenixpro_serialize_int(1442, FeedbackRemoteSensorID, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1163 return ss.str();
1164 }
1165
1166 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1167 {
1168 const char *string_c_str = string.c_str();
1169 size_t string_length = string.length();
1175 return 0;
1176 }
1177};
1178
1179
1180/**
1181 * \brief Configs that directly affect motor-output.
1182 *
1183 * \details Includes Motor Invert and various limit features.
1184 */
1186{
1187public:
1188 /**
1189 * \brief If non-zero, this determines how much time to ramp from 0%
1190 * output to 100% during open-loop modes.
1191 *
1192 * Minimum Value: 0
1193 * Maximum Value: 1
1194 * Default Value: 0
1195 * Units: sec
1196 */
1198 /**
1199 * \brief If non-zero, this determines how much time to ramp from 0V
1200 * output to 12V during open-loop modes.
1201 *
1202 * Minimum Value: 0
1203 * Maximum Value: 1
1204 * Default Value: 0
1205 * Units: sec
1206 */
1208 /**
1209 * \brief If non-zero, this determines how much time to ramp from 0A
1210 * output to 300A during open-loop modes.
1211 *
1212 * Minimum Value: 0
1213 * Maximum Value: 10
1214 * Default Value: 0
1215 * Units: sec
1216 */
1218
1219 std::string ToString() const
1220 {
1221 std::stringstream ss;
1222 ss << "{" << std::endl;
1223 ss << "Config Group: OpenLoopRamps" << std::endl;
1224 ss << "Name: \"DutyCycleOpenLoopRampPeriod\" Value: \"" << DutyCycleOpenLoopRampPeriod << "sec\"" << std::endl;
1225 ss << "Name: \"VoltageOpenLoopRampPeriod\" Value: \"" << VoltageOpenLoopRampPeriod << "sec\"" << std::endl;
1226 ss << "Name: \"TorqueOpenLoopRampPeriod\" Value: \"" << TorqueOpenLoopRampPeriod << "sec\"" << std::endl;
1227 ss << "}" << std::endl;
1228 return ss.str();
1229 }
1230
1231 std::string Serialize() const
1232 {
1233 std::stringstream ss;
1234 char *ref;
1235 c_ctre_phoenixpro_serialize_double(1443, DutyCycleOpenLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1236 c_ctre_phoenixpro_serialize_double(1444, VoltageOpenLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1237 c_ctre_phoenixpro_serialize_double(1445, TorqueOpenLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1238 return ss.str();
1239 }
1240
1241 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1242 {
1243 const char *string_c_str = string.c_str();
1244 size_t string_length = string.length();
1248 return 0;
1249 }
1250};
1251
1252
1253/**
1254 * \brief Configs that directly affect motor-output.
1255 *
1256 * \details Includes Motor Invert and various limit features.
1257 */
1259{
1260public:
1261 /**
1262 * \brief If non-zero, this determines how much time to ramp from 0%
1263 * output to 100% during closed-loop modes.
1264 *
1265 * Minimum Value: 0
1266 * Maximum Value: 1
1267 * Default Value: 0
1268 * Units: sec
1269 */
1271 /**
1272 * \brief If non-zero, this determines how much time to ramp from 0V
1273 * output to 12V during closed-loop modes.
1274 *
1275 * Minimum Value: 0
1276 * Maximum Value: 1
1277 * Default Value: 0
1278 * Units: sec
1279 */
1281 /**
1282 * \brief If non-zero, this determines how much time to ramp from 0A
1283 * output to 300A during closed-loop modes.
1284 *
1285 * Minimum Value: 0
1286 * Maximum Value: 10
1287 * Default Value: 0
1288 * Units: sec
1289 */
1291
1292 std::string ToString() const
1293 {
1294 std::stringstream ss;
1295 ss << "{" << std::endl;
1296 ss << "Config Group: ClosedLoopRamps" << std::endl;
1297 ss << "Name: \"DutyCycleClosedLoopRampPeriod\" Value: \"" << DutyCycleClosedLoopRampPeriod << "sec\"" << std::endl;
1298 ss << "Name: \"VoltageClosedLoopRampPeriod\" Value: \"" << VoltageClosedLoopRampPeriod << "sec\"" << std::endl;
1299 ss << "Name: \"TorqueClosedLoopRampPeriod\" Value: \"" << TorqueClosedLoopRampPeriod << "sec\"" << std::endl;
1300 ss << "}" << std::endl;
1301 return ss.str();
1302 }
1303
1304 std::string Serialize() const
1305 {
1306 std::stringstream ss;
1307 char *ref;
1308 c_ctre_phoenixpro_serialize_double(1446, DutyCycleClosedLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1309 c_ctre_phoenixpro_serialize_double(1447, VoltageClosedLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1310 c_ctre_phoenixpro_serialize_double(1448, TorqueClosedLoopRampPeriod, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1311 return ss.str();
1312 }
1313
1314 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1315 {
1316 const char *string_c_str = string.c_str();
1317 size_t string_length = string.length();
1321 return 0;
1322 }
1323};
1324
1325
1326/**
1327 * \brief Configs that directly affect motor-output.
1328 *
1329 * \details Includes Motor Invert and various limit features.
1330 */
1332{
1333public:
1334 /**
1335 * \brief Determines if limit is normally-open (default) or
1336 * normally-closed.
1337 *
1338 */
1340 /**
1341 * \brief If enabled, the position is auto-set to a specific value,
1342 * specified by ForwardLimitAutosetPositionValue
1343 *
1344 * Default Value: False
1345 */
1347 /**
1348 * \brief The value to auto-set the position to. This has no effect
1349 * if ForwardLimitAutosetPositionEnable is false.
1350 *
1351 * Minimum Value: -3.4e+38
1352 * Maximum Value: 3.4e+38
1353 * Default Value: 0
1354 * Units: rotations
1355 */
1357 /**
1358 * \brief If enabled, motor output is set to neutral when forward
1359 * limit switch is asseted and positive output is requested.
1360 *
1361 * Default Value: True
1362 */
1364 /**
1365 * \brief Determines where to poll the forward limit switch. This
1366 * defaults to the limit switch pin on the limit switch connector.
1367 *
1368 */
1370 /**
1371 * \brief Device ID of the device if using remote limit switch
1372 * features.
1373 *
1374 * Minimum Value: 0
1375 * Maximum Value: 62
1376 * Default Value: 0
1377 * Units:
1378 */
1380 /**
1381 * \brief Determines if limit is normally-open (default) or
1382 * normally-closed.
1383 *
1384 */
1386 /**
1387 * \brief If enabled, the position is auto-set to a specific value,
1388 * specified by ReverseLimitAutosetPositionValue
1389 *
1390 * Default Value: False
1391 */
1393 /**
1394 * \brief The value to auto-set the position to. This has no effect
1395 * if ReverseLimitAutosetPositionEnable is false.
1396 *
1397 * Minimum Value: -3.4e+38
1398 * Maximum Value: 3.4e+38
1399 * Default Value: 0
1400 * Units: rotations
1401 */
1403 /**
1404 * \brief If enabled, motor output is set to neutral when reverse
1405 * limit switch is asseted and positive output is requested.
1406 *
1407 * Default Value: True
1408 */
1410 /**
1411 * \brief Determines where to poll the reverse limit switch. This
1412 * defaults to the limit switch pin on the limit switch connector.
1413 *
1414 */
1416 /**
1417 * \brief Device ID of the device if using remote limit switch
1418 * features.
1419 *
1420 * Minimum Value: 0
1421 * Maximum Value: 62
1422 * Default Value: 0
1423 * Units:
1424 */
1426
1427 std::string ToString() const
1428 {
1429 std::stringstream ss;
1430 ss << "{" << std::endl;
1431 ss << "Config Group: HardwareLimitSwitch" << std::endl;
1432 ss << "Name: \"ForwardLimitType\" Value: \"" << ForwardLimitType << "\"" << std::endl;
1433 ss << "Name: \"ForwardLimitAutosetPositionEnable\" Value: \"" << ForwardLimitAutosetPositionEnable << "\"" << std::endl;
1434 ss << "Name: \"ForwardLimitAutosetPositionValue\" Value: \"" << ForwardLimitAutosetPositionValue << "rotations\"" << std::endl;
1435 ss << "Name: \"ForwardLimitEnable\" Value: \"" << ForwardLimitEnable << "\"" << std::endl;
1436 ss << "Name: \"ForwardLimitSource\" Value: \"" << ForwardLimitSource << "\"" << std::endl;
1437 ss << "Name: \"ForwardLimitRemoteSensorID\" Value: \"" << ForwardLimitRemoteSensorID << "\"" << std::endl;
1438 ss << "Name: \"ReverseLimitType\" Value: \"" << ReverseLimitType << "\"" << std::endl;
1439 ss << "Name: \"ReverseLimitAutosetPositionEnable\" Value: \"" << ReverseLimitAutosetPositionEnable << "\"" << std::endl;
1440 ss << "Name: \"ReverseLimitAutosetPositionValue\" Value: \"" << ReverseLimitAutosetPositionValue << "rotations\"" << std::endl;
1441 ss << "Name: \"ReverseLimitEnable\" Value: \"" << ReverseLimitEnable << "\"" << std::endl;
1442 ss << "Name: \"ReverseLimitSource\" Value: \"" << ReverseLimitSource << "\"" << std::endl;
1443 ss << "Name: \"ReverseLimitRemoteSensorID\" Value: \"" << ReverseLimitRemoteSensorID << "\"" << std::endl;
1444 ss << "}" << std::endl;
1445 return ss.str();
1446 }
1447
1448 std::string Serialize() const
1449 {
1450 std::stringstream ss;
1451 char *ref;
1452 c_ctre_phoenixpro_serialize_int(1449, ForwardLimitType.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1453 c_ctre_phoenixpro_serialize_bool(1450, ForwardLimitAutosetPositionEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1454 c_ctre_phoenixpro_serialize_double(1451, ForwardLimitAutosetPositionValue, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1455 c_ctre_phoenixpro_serialize_bool(1452, ForwardLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1456 c_ctre_phoenixpro_serialize_int(1453, ForwardLimitSource.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1457 c_ctre_phoenixpro_serialize_int(1454, ForwardLimitRemoteSensorID, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1458 c_ctre_phoenixpro_serialize_int(1455, ReverseLimitType.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1459 c_ctre_phoenixpro_serialize_bool(1456, ReverseLimitAutosetPositionEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1460 c_ctre_phoenixpro_serialize_double(1457, ReverseLimitAutosetPositionValue, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1461 c_ctre_phoenixpro_serialize_bool(1458, ReverseLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1462 c_ctre_phoenixpro_serialize_int(1459, ReverseLimitSource.value, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1463 c_ctre_phoenixpro_serialize_int(1460, ReverseLimitRemoteSensorID, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1464 return ss.str();
1465 }
1466
1467 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1468 {
1469 const char *string_c_str = string.c_str();
1470 size_t string_length = string.length();
1483 return 0;
1484 }
1485};
1486
1487
1488/**
1489 * \brief Configs that directly affect motor-output.
1490 *
1491 * \details Includes Motor Invert and various limit features.
1492 */
1494{
1495public:
1496 /**
1497 * \brief If true, the TalonFX will beep during boot-up. This is
1498 * useful for general debugging, and defaults to true. If rotor is
1499 * moving during boot-up, the beep will not occur regardless of this
1500 * setting.
1501 *
1502 * Default Value: True
1503 */
1504 bool BeepOnBoot = true;
1505
1506 std::string ToString() const
1507 {
1508 std::stringstream ss;
1509 ss << "{" << std::endl;
1510 ss << "Config Group: Audio" << std::endl;
1511 ss << "Name: \"BeepOnBoot\" Value: \"" << BeepOnBoot << "\"" << std::endl;
1512 ss << "}" << std::endl;
1513 return ss.str();
1514 }
1515
1516 std::string Serialize() const
1517 {
1518 std::stringstream ss;
1519 char *ref;
1520 c_ctre_phoenixpro_serialize_bool(1424, BeepOnBoot, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1521 return ss.str();
1522 }
1523
1524 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1525 {
1526 const char *string_c_str = string.c_str();
1527 size_t string_length = string.length();
1529 return 0;
1530 }
1531};
1532
1533
1534/**
1535 * \brief Configs that directly affect motor-output.
1536 *
1537 * \details Includes Motor Invert and various limit features.
1538 */
1540{
1541public:
1542 /**
1543 * \brief If enabled, the motor output is set to neutral if position
1544 * exceeds ForwardSoftLimitThreshold and forward output is requested.
1545 *
1546 * Default Value: False
1547 */
1549 /**
1550 * \brief If enabled, the motor output is set to neutral if position
1551 * exceeds ReverseSoftLimitThreshold and reverse output is requested.
1552 *
1553 * Default Value: False
1554 */
1556 /**
1557 * \brief Position threshold for forward soft limit features.
1558 * ForwardSoftLimitEnable must be enabled for this to take effect.
1559 *
1560 * Minimum Value: -3.4e+38
1561 * Maximum Value: 3.4e+38
1562 * Default Value: 0
1563 * Units: rotations
1564 */
1566 /**
1567 * \brief Position threshold for reverse soft limit features.
1568 * ReverseSoftLimitEnable must be enabled for this to take effect.
1569 *
1570 * Minimum Value: -3.4e+38
1571 * Maximum Value: 3.4e+38
1572 * Default Value: 0
1573 * Units: rotations
1574 */
1576
1577 std::string ToString() const
1578 {
1579 std::stringstream ss;
1580 ss << "{" << std::endl;
1581 ss << "Config Group: SoftwareLimitSwitch" << std::endl;
1582 ss << "Name: \"ForwardSoftLimitEnable\" Value: \"" << ForwardSoftLimitEnable << "\"" << std::endl;
1583 ss << "Name: \"ReverseSoftLimitEnable\" Value: \"" << ReverseSoftLimitEnable << "\"" << std::endl;
1584 ss << "Name: \"ForwardSoftLimitThreshold\" Value: \"" << ForwardSoftLimitThreshold << "rotations\"" << std::endl;
1585 ss << "Name: \"ReverseSoftLimitThreshold\" Value: \"" << ReverseSoftLimitThreshold << "rotations\"" << std::endl;
1586 ss << "}" << std::endl;
1587 return ss.str();
1588 }
1589
1590 std::string Serialize() const
1591 {
1592 std::stringstream ss;
1593 char *ref;
1594 c_ctre_phoenixpro_serialize_bool(1461, ForwardSoftLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1595 c_ctre_phoenixpro_serialize_bool(1462, ReverseSoftLimitEnable, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1596 c_ctre_phoenixpro_serialize_double(1463, ForwardSoftLimitThreshold, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1597 c_ctre_phoenixpro_serialize_double(1464, ReverseSoftLimitThreshold, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1598 return ss.str();
1599 }
1600
1601 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1602 {
1603 const char *string_c_str = string.c_str();
1604 size_t string_length = string.length();
1609 return 0;
1610 }
1611};
1612
1613
1614/**
1615 * \brief Configs that directly affect motor-output.
1616 *
1617 * \details Includes Motor Invert and various limit features.
1618 */
1620{
1621public:
1622 /**
1623 * \brief This is the maximum velocity Motion Magic® based control
1624 * modes are allowed to use.
1625 *
1626 * Minimum Value: 0
1627 * Maximum Value: 3.4e+38
1628 * Default Value: 0
1629 * Units: rps
1630 */
1632 /**
1633 * \brief This is the target acceleration Motion Magic® based control
1634 * modes are allowed to use.
1635 *
1636 * Minimum Value: 0
1637 * Maximum Value: 3.4e+38
1638 * Default Value: 0
1639 * Units: rot per sec²
1640 */
1642 /**
1643 * \brief This is the target jerk (acceleration derivative) Motion
1644 * Magic® based control modes are allowed to use. This allows Motion
1645 * Magic® support of S-Curves. If this is set to zero, then Motion
1646 * Magic® will not apply a Jerk limit.
1647 *
1648 * Minimum Value: 0
1649 * Maximum Value: 3.4e+38
1650 * Default Value: 0
1651 * Units: rot per sec³
1652 */
1654
1655 std::string ToString() const
1656 {
1657 std::stringstream ss;
1658 ss << "{" << std::endl;
1659 ss << "Config Group: MotionMagic" << std::endl;
1660 ss << "Name: \"MotionMagicCruiseVelocity\" Value: \"" << MotionMagicCruiseVelocity << "rps\"" << std::endl;
1661 ss << "Name: \"MotionMagicAcceleration\" Value: \"" << MotionMagicAcceleration << "rot per sec²\"" << std::endl;
1662 ss << "Name: \"MotionMagicJerk\" Value: \"" << MotionMagicJerk << "rot per sec³\"" << std::endl;
1663 ss << "}" << std::endl;
1664 return ss.str();
1665 }
1666
1667 std::string Serialize() const
1668 {
1669 std::stringstream ss;
1670 char *ref;
1671 c_ctre_phoenixpro_serialize_double(1465, MotionMagicCruiseVelocity, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1672 c_ctre_phoenixpro_serialize_double(1466, MotionMagicAcceleration, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1673 c_ctre_phoenixpro_serialize_double(1467, MotionMagicJerk, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1674 return ss.str();
1675 }
1676
1677 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1678 {
1679 const char *string_c_str = string.c_str();
1680 size_t string_length = string.length();
1684 return 0;
1685 }
1686};
1687
1688
1689/**
1690 * \brief Configs that directly affect motor-output.
1691 *
1692 * \details Includes Motor Invert and various limit features.
1693 */
1695{
1696public:
1697 /**
1698 * \brief Custom parameter 0. This is provided to allow
1699 * end-applications to store persistent information in the device.
1700 *
1701 * Minimum Value: -32768
1702 * Maximum Value: 32767
1703 * Default Value: 0
1704 * Units:
1705 */
1707 /**
1708 * \brief Custom parameter 1. This is provided to allow
1709 * end-applications to store persistent information in the device.
1710 *
1711 * Minimum Value: -32768
1712 * Maximum Value: 32767
1713 * Default Value: 0
1714 * Units:
1715 */
1717
1718 std::string ToString() const
1719 {
1720 std::stringstream ss;
1721 ss << "{" << std::endl;
1722 ss << "Config Group: CustomParams" << std::endl;
1723 ss << "Name: \"CustomParam0\" Value: \"" << CustomParam0 << "\"" << std::endl;
1724 ss << "Name: \"CustomParam1\" Value: \"" << CustomParam1 << "\"" << std::endl;
1725 ss << "}" << std::endl;
1726 return ss.str();
1727 }
1728
1729 std::string Serialize() const
1730 {
1731 std::stringstream ss;
1732 char *ref;
1733 c_ctre_phoenixpro_serialize_int(816, CustomParam0, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1734 c_ctre_phoenixpro_serialize_int(817, CustomParam1, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1735 return ss.str();
1736 }
1737
1738 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1739 {
1740 const char *string_c_str = string.c_str();
1741 size_t string_length = string.length();
1744 return 0;
1745 }
1746};
1747
1748
1749/**
1750 * \brief Configs that affect general behavior during closed-looping.
1751 *
1752 * \details Includes Continuous Wrap features.
1753 */
1755{
1756public:
1757 /**
1758 * \brief Wrap position error within [-0.5,+0.5) mechanism rotations.
1759 * Typically used for continuous position closed-loops like swerve
1760 * azimuth.
1761 *
1762 * \details This uses the mechanism rotation value. If there is a gear
1763 * ratio between the sensor and the mechanism, make sure to apply a
1764 * SensorToMechanismRatio so the closed loop operates on the full
1765 * rotation.
1766 *
1767 * Default Value: False
1768 */
1769 bool ContinuousWrap = false;
1770
1771 std::string ToString() const
1772 {
1773 std::stringstream ss;
1774 ss << "{" << std::endl;
1775 ss << "Config Group: ClosedLoopGeneral" << std::endl;
1776 ss << "Name: \"ContinuousWrap\" Value: \"" << ContinuousWrap << "\"" << std::endl;
1777 ss << "}" << std::endl;
1778 return ss.str();
1779 }
1780
1781 std::string Serialize() const
1782 {
1783 std::stringstream ss;
1784 char *ref;
1785 c_ctre_phoenixpro_serialize_bool(1499, ContinuousWrap, &ref); if(ref != nullptr) { ss << ref; free(ref); }
1786 return ss.str();
1787 }
1788
1789 ctre::phoenix::StatusCode Deserialize(const std::string& string)
1790 {
1791 const char *string_c_str = string.c_str();
1792 size_t string_length = string.length();
1794 return 0;
1795 }
1796};
1797
1798
1799}
1800}
1801}
ii that the Software will be uninterrupted or error free
Definition: CTRE_LICENSE.txt:191
CTREXPORT int c_ctre_phoenixpro_deserialize_int(int spn, const char *str, uint32_t strlen, int *val)
CTREXPORT int c_ctre_phoenixpro_deserialize_bool(int spn, const char *str, uint32_t strlen, bool *val)
CTREXPORT int c_ctre_phoenixpro_serialize_double(int spn, double value, char **str)
CTREXPORT int c_ctre_phoenixpro_deserialize_double(int spn, const char *str, uint32_t strlen, double *val)
CTREXPORT int c_ctre_phoenixpro_serialize_int(int spn, int value, char **str)
CTREXPORT int c_ctre_phoenixpro_serialize_bool(int spn, bool value, char **str)
Definition: Serializable.hpp:15
Configs that directly affect motor-output.
Definition: Configs.hpp:1494
bool BeepOnBoot
If true, the TalonFX will beep during boot-up.
Definition: Configs.hpp:1504
std::string ToString() const
Definition: Configs.hpp:1506
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1524
std::string Serialize() const
Definition: Configs.hpp:1516
Configs that affect general behavior during closed-looping.
Definition: Configs.hpp:1755
std::string Serialize() const
Definition: Configs.hpp:1781
bool ContinuousWrap
Wrap position error within [-0.5,+0.5) mechanism rotations.
Definition: Configs.hpp:1769
std::string ToString() const
Definition: Configs.hpp:1771
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1789
Configs that directly affect motor-output.
Definition: Configs.hpp:1259
double DutyCycleClosedLoopRampPeriod
If non-zero, this determines how much time to ramp from 0% output to 100% during closed-loop modes.
Definition: Configs.hpp:1270
std::string ToString() const
Definition: Configs.hpp:1292
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1314
double VoltageClosedLoopRampPeriod
If non-zero, this determines how much time to ramp from 0V output to 12V during closed-loop modes.
Definition: Configs.hpp:1280
std::string Serialize() const
Definition: Configs.hpp:1304
double TorqueClosedLoopRampPeriod
If non-zero, this determines how much time to ramp from 0A output to 300A during closed-loop modes.
Definition: Configs.hpp:1290
Configs that directly affect current limiting features.
Definition: Configs.hpp:808
double SupplyTimeThreshold
Allows unlimited current for a period of time before current limiting occurs.
Definition: Configs.hpp:869
bool SupplyCurrentLimitEnable
Enable motor supply current limiting.
Definition: Configs.hpp:846
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:899
double StatorCurrentLimit
The amount of current allowed in the motor (motoring and regen current).
Definition: Configs.hpp:821
double SupplyCurrentThreshold
Delay supply current limiting until current exceeds this threshold for longer than SupplyTimeThreshol...
Definition: Configs.hpp:858
double SupplyCurrentLimit
The amount of supply current allowed.
Definition: Configs.hpp:840
std::string Serialize() const
Definition: Configs.hpp:886
std::string ToString() const
Definition: Configs.hpp:871
bool StatorCurrentLimitEnable
Enable motor stator current limiting.
Definition: Configs.hpp:827
Configs that directly affect motor-output.
Definition: Configs.hpp:1695
int CustomParam0
Custom parameter 0.
Definition: Configs.hpp:1706
std::string ToString() const
Definition: Configs.hpp:1718
std::string Serialize() const
Definition: Configs.hpp:1729
int CustomParam1
Custom parameter 1.
Definition: Configs.hpp:1716
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1738
Configs that directly affect motor-output.
Definition: Configs.hpp:1068
double SensorToMechanismRatio
This is the ratio of sensor rotations to the mechanism's output.
Definition: Configs.hpp:1093
double RotorToSensorRatio
Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sen...
Definition: Configs.hpp:1106
int FeedbackRemoteSensorID
Device ID of which remote device to use.
Definition: Configs.hpp:1138
signals::FeedbackSensorSourceValue FeedbackSensorSource
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition: Configs.hpp:1128
std::string ToString() const
Definition: Configs.hpp:1140
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1166
double FeedbackRotorOffset
This offset is applied to the absolute integrated rotor sensor.
Definition: Configs.hpp:1080
std::string Serialize() const
Definition: Configs.hpp:1154
Configs to trim the Pigeon2's gyroscope.
Definition: Configs.hpp:185
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:237
double GyroScalarX
The gyro scalar component for the X axis.
Definition: Configs.hpp:195
double GyroScalarY
The gyro scalar component for the Y axis.
Definition: Configs.hpp:204
double GyroScalarZ
The gyro scalar component for the Z axis.
Definition: Configs.hpp:213
std::string ToString() const
Definition: Configs.hpp:215
std::string Serialize() const
Definition: Configs.hpp:227
Configs that directly affect motor-output.
Definition: Configs.hpp:1332
bool ReverseLimitAutosetPositionEnable
If enabled, the position is auto-set to a specific value, specified by ReverseLimitAutosetPositionVal...
Definition: Configs.hpp:1392
int ReverseLimitRemoteSensorID
Device ID of the device if using remote limit switch features.
Definition: Configs.hpp:1425
bool ForwardLimitEnable
If enabled, motor output is set to neutral when forward limit switch is asseted and positive output i...
Definition: Configs.hpp:1363
std::string ToString() const
Definition: Configs.hpp:1427
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1467
signals::ForwardLimitSourceValue ForwardLimitSource
Determines where to poll the forward limit switch.
Definition: Configs.hpp:1369
signals::ReverseLimitSourceValue ReverseLimitSource
Determines where to poll the reverse limit switch.
Definition: Configs.hpp:1415
double ForwardLimitAutosetPositionValue
The value to auto-set the position to.
Definition: Configs.hpp:1356
double ReverseLimitAutosetPositionValue
The value to auto-set the position to.
Definition: Configs.hpp:1402
signals::ReverseLimitTypeValue ReverseLimitType
Determines if limit is normally-open (default) or normally-closed.
Definition: Configs.hpp:1385
bool ForwardLimitAutosetPositionEnable
If enabled, the position is auto-set to a specific value, specified by ForwardLimitAutosetPositionVal...
Definition: Configs.hpp:1346
int ForwardLimitRemoteSensorID
Device ID of the device if using remote limit switch features.
Definition: Configs.hpp:1379
bool ReverseLimitEnable
If enabled, motor output is set to neutral when reverse limit switch is asseted and positive output i...
Definition: Configs.hpp:1409
signals::ForwardLimitTypeValue ForwardLimitType
Determines if limit is normally-open (default) or normally-closed.
Definition: Configs.hpp:1339
std::string Serialize() const
Definition: Configs.hpp:1448
Configs that affect the magnet sensor and how to interpret it.
Definition: Configs.hpp:42
double MagnetOffset
This offset is added to the reported position, allowing the application to trim the zero position.
Definition: Configs.hpp:61
std::string Serialize() const
Definition: Configs.hpp:81
signals::AbsoluteSensorRangeValue AbsoluteSensorRange
The range of the absolute sensor, either [0, 1) or [-0.5, 0.5).
Definition: Configs.hpp:67
std::string ToString() const
Definition: Configs.hpp:69
signals::SensorDirectionValue SensorDirection
Direction of the sensor to determine positive facing the LED side of the CANcoder.
Definition: Configs.hpp:49
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:91
Configs that directly affect motor-output.
Definition: Configs.hpp:1620
double MotionMagicAcceleration
This is the target acceleration Motion Magic® based control modes are allowed to use.
Definition: Configs.hpp:1641
std::string ToString() const
Definition: Configs.hpp:1655
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1677
std::string Serialize() const
Definition: Configs.hpp:1667
double MotionMagicJerk
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to us...
Definition: Configs.hpp:1653
double MotionMagicCruiseVelocity
This is the maximum velocity Motion Magic® based control modes are allowed to use.
Definition: Configs.hpp:1631
Configs that directly affect motor-output.
Definition: Configs.hpp:719
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:788
std::string ToString() const
Definition: Configs.hpp:762
std::string Serialize() const
Definition: Configs.hpp:776
signals::InvertedValue Inverted
Invert state of the device.
Definition: Configs.hpp:725
double DutyCycleNeutralDeadband
Configures the output deadband percentage.
Definition: Configs.hpp:740
double PeakForwardDutyCycle
Maximum (forward) output during duty cycle based control modes.
Definition: Configs.hpp:750
double PeakReverseDutyCycle
Minimum (reverse) output during duty cycle based control modes.
Definition: Configs.hpp:760
signals::NeutralModeValue NeutralMode
The state of the motor controller bridge when output is neutral or disabled.
Definition: Configs.hpp:731
Configs for Pigeon 2's Mount Pose configuration.
Definition: Configs.hpp:111
double MountPosePitch
The mounting calibration pitch-component.
Definition: Configs.hpp:130
std::string Serialize() const
Definition: Configs.hpp:153
double MountPoseRoll
The mounting calibration roll-component.
Definition: Configs.hpp:139
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:163
std::string ToString() const
Definition: Configs.hpp:141
double MountPoseYaw
The mounting calibration yaw-component.
Definition: Configs.hpp:121
Configs that directly affect motor-output.
Definition: Configs.hpp:1186
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1241
double VoltageOpenLoopRampPeriod
If non-zero, this determines how much time to ramp from 0V output to 12V during open-loop modes.
Definition: Configs.hpp:1207
std::string ToString() const
Definition: Configs.hpp:1219
double TorqueOpenLoopRampPeriod
If non-zero, this determines how much time to ramp from 0A output to 300A during open-loop modes.
Definition: Configs.hpp:1217
std::string Serialize() const
Definition: Configs.hpp:1231
double DutyCycleOpenLoopRampPeriod
If non-zero, this determines how much time to ramp from 0% output to 100% during open-loop modes.
Definition: Configs.hpp:1197
friend std::ostream & operator<<(std::ostream &str, const ParentConfiguration &v)
Definition: Configs.hpp:25
virtual std::string ToString() const =0
virtual ctre::phoenix::StatusCode Deserialize(const std::string &string)=0
Configs to enable/disable various features of the Pigeon2.
Definition: Configs.hpp:256
bool EnableCompass
Turns on or off the magnetometer fusing for 9-axis.
Definition: Configs.hpp:266
std::string ToString() const
Definition: Configs.hpp:280
bool DisableTemperatureCompensation
Disables using the temperature compensation feature.
Definition: Configs.hpp:272
bool DisableNoMotionCalibration
Disables using the no-motion calibration feature.
Definition: Configs.hpp:278
std::string Serialize() const
Definition: Configs.hpp:292
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:302
What the gains for slot 0 are.
Definition: Configs.hpp:321
std::string Serialize() const
Definition: Configs.hpp:421
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:433
double kP
Proportional Gain.
Definition: Configs.hpp:338
std::string ToString() const
Definition: Configs.hpp:407
double kD
Derivative Gain.
Definition: Configs.hpp:375
double kI
Integral Gain.
Definition: Configs.hpp:356
double kV
Velocity Feed Forward Gain.
Definition: Configs.hpp:391
double kS
Static Constant.
Definition: Configs.hpp:405
What the gains for slot 1 are.
Definition: Configs.hpp:454
std::string ToString() const
Definition: Configs.hpp:540
double kV
Velocity Feed Forward Gain.
Definition: Configs.hpp:524
double kD
Derivative Gain.
Definition: Configs.hpp:508
std::string Serialize() const
Definition: Configs.hpp:554
double kI
Integral Gain.
Definition: Configs.hpp:489
double kP
Proportional Gain.
Definition: Configs.hpp:471
double kS
Static Constant.
Definition: Configs.hpp:538
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:566
What the gains for slot 2 are.
Definition: Configs.hpp:587
double kP
Proportional Gain.
Definition: Configs.hpp:604
double kD
Derivative Gain.
Definition: Configs.hpp:641
double kS
Static Constant.
Definition: Configs.hpp:671
std::string ToString() const
Definition: Configs.hpp:673
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:699
std::string Serialize() const
Definition: Configs.hpp:687
double kI
Integral Gain.
Definition: Configs.hpp:622
double kV
Velocity Feed Forward Gain.
Definition: Configs.hpp:657
Configs that directly affect motor-output.
Definition: Configs.hpp:1540
double ForwardSoftLimitThreshold
Position threshold for forward soft limit features.
Definition: Configs.hpp:1565
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1601
double ReverseSoftLimitThreshold
Position threshold for reverse soft limit features.
Definition: Configs.hpp:1575
bool ReverseSoftLimitEnable
If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reve...
Definition: Configs.hpp:1555
std::string Serialize() const
Definition: Configs.hpp:1590
bool ForwardSoftLimitEnable
If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forw...
Definition: Configs.hpp:1548
std::string ToString() const
Definition: Configs.hpp:1577
Configs that directly affect motor-output.
Definition: Configs.hpp:995
double PeakReverseTorqueCurrent
Minimum (reverse) output during torque current based control modes.
Definition: Configs.hpp:1016
std::string Serialize() const
Definition: Configs.hpp:1040
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:1050
std::string ToString() const
Definition: Configs.hpp:1028
double TorqueNeutralDeadband
Configures the output deadband during torque current based control modes.
Definition: Configs.hpp:1026
double PeakForwardTorqueCurrent
Maximum (forward) output during torque current based control modes.
Definition: Configs.hpp:1006
Voltage-specific configs.
Definition: Configs.hpp:920
double PeakForwardVoltage
Maximum (forward) output during voltage based control modes.
Definition: Configs.hpp:944
ctre::phoenix::StatusCode Deserialize(const std::string &string)
Definition: Configs.hpp:977
std::string Serialize() const
Definition: Configs.hpp:967
std::string ToString() const
Definition: Configs.hpp:955
double SupplyVoltageTimeConstant
The time constant (in seconds) of the low-pass filter for the supply voltage.
Definition: Configs.hpp:935
double PeakReverseVoltage
Minimum (reverse) output during voltage based control modes.
Definition: Configs.hpp:953
The range of the absolute sensor, either [0, 1) or [-0.5, 0.5).
Definition: SpnEnums.hpp:680
static constexpr int Unsigned_0To1
Definition: SpnEnums.hpp:684
Choose what sensor source is reported via API and used by closed-loop and limit features.
Definition: SpnEnums.hpp:1332
static constexpr int RotorSensor
Definition: SpnEnums.hpp:1336
Determines where to poll the forward limit switch.
Definition: SpnEnums.hpp:1465
static constexpr int LimitSwitchPin
Definition: SpnEnums.hpp:1469
int value
Definition: SpnEnums.hpp:1467
Determines if limit is normally-open (default) or normally-closed.
Definition: SpnEnums.hpp:1399
static constexpr int NormallyOpen
Definition: SpnEnums.hpp:1403
int value
Definition: SpnEnums.hpp:1401
Invert state of the device.
Definition: SpnEnums.hpp:1185
int value
Definition: SpnEnums.hpp:1187
static constexpr int CounterClockwise_Positive
Definition: SpnEnums.hpp:1189
The state of the motor controller bridge when output is neutral or disabled.
Definition: SpnEnums.hpp:1251
int value
Definition: SpnEnums.hpp:1253
static constexpr int Coast
Definition: SpnEnums.hpp:1255
Determines where to poll the reverse limit switch.
Definition: SpnEnums.hpp:1594
static constexpr int LimitSwitchPin
Definition: SpnEnums.hpp:1598
int value
Definition: SpnEnums.hpp:1596
Determines if limit is normally-open (default) or normally-closed.
Definition: SpnEnums.hpp:1528
static constexpr int NormallyOpen
Definition: SpnEnums.hpp:1532
int value
Definition: SpnEnums.hpp:1530
Direction of the sensor to determine positive facing the LED side of the CANcoder.
Definition: SpnEnums.hpp:177
static constexpr int CounterClockwise_Positive
Definition: SpnEnums.hpp:181
int value
Definition: SpnEnums.hpp:179
static constexpr int Config_ReverseLimitSource
Definition: SpnValue.hpp:178
static constexpr int Slot2_kP
Definition: SpnValue.hpp:136
static constexpr int Config_SupplyCurrentLimit
Definition: SpnValue.hpp:148
static constexpr int Config_PeakRevTorqCurr
Definition: SpnValue.hpp:155
static constexpr int Config_DutyCycleNeutralDB
Definition: SpnValue.hpp:145
static constexpr int Config_StatorCurrentLimit
Definition: SpnValue.hpp:146
static constexpr int Config_TorqueNeutralDB
Definition: SpnValue.hpp:156
static constexpr int Config_ReverseSoftLimitThreshold
Definition: SpnValue.hpp:183
static constexpr int Config_PeakReverseDC
Definition: SpnValue.hpp:151
static constexpr int Config_RotorToSensorRatio
Definition: SpnValue.hpp:159
static constexpr int Slot0_kI
Definition: SpnValue.hpp:127
static constexpr int Config_ForwardSoftLimitEnable
Definition: SpnValue.hpp:180
static constexpr int Config_TorqueClosedLoopRampPeriod
Definition: SpnValue.hpp:167
static constexpr int Config_ForwardLimitAutosetPosValue
Definition: SpnValue.hpp:170
static constexpr int Pigeon2DisableTemperatureCompensation
Definition: SpnValue.hpp:45
static constexpr int Config_PeakForwardDC
Definition: SpnValue.hpp:150
static constexpr int Slot2_kD
Definition: SpnValue.hpp:138
static constexpr int CustomParam1
Definition: SpnValue.hpp:34
static constexpr int Config_SensorToMechanismRatio
Definition: SpnValue.hpp:158
static constexpr int Slot2_kI
Definition: SpnValue.hpp:137
static constexpr int Pigeon2MountPoseYaw
Definition: SpnValue.hpp:47
static constexpr int Config_FeedbackRemoteSensorID
Definition: SpnValue.hpp:161
static constexpr int Config_ForwardLimitAutosetPosEnable
Definition: SpnValue.hpp:169
static constexpr int Pigeon2GyroScalarY
Definition: SpnValue.hpp:51
static constexpr int Pigeon2GyroScalarX
Definition: SpnValue.hpp:50
static constexpr int Config_StatorCurrLimitEn
Definition: SpnValue.hpp:147
static constexpr int Config_NeutralMode
Definition: SpnValue.hpp:144
static constexpr int Config_BeepOnBoot
Definition: SpnValue.hpp:143
static constexpr int Slot2_kV
Definition: SpnValue.hpp:139
static constexpr int Config_DutyCycleClosedLoopRampPeriod
Definition: SpnValue.hpp:165
static constexpr int Slot0_kV
Definition: SpnValue.hpp:129
static constexpr int Config_ContinuousWrap
Definition: SpnValue.hpp:195
static constexpr int Config_MotionMagicAcceleration
Definition: SpnValue.hpp:185
static constexpr int Config_ReverseLimitType
Definition: SpnValue.hpp:174
static constexpr int CANcoder_SensorDirection
Definition: SpnValue.hpp:35
static constexpr int Slot1_kS
Definition: SpnValue.hpp:135
static constexpr int Config_MotionMagicJerk
Definition: SpnValue.hpp:186
static constexpr int Config_PeakReverseV
Definition: SpnValue.hpp:153
static constexpr int Slot0_kS
Definition: SpnValue.hpp:130
static constexpr int Config_ForwardLimitRemoteSensorID
Definition: SpnValue.hpp:173
static constexpr int Slot1_kD
Definition: SpnValue.hpp:133
static constexpr int Slot1_kV
Definition: SpnValue.hpp:134
static constexpr int Pigeon2MountPosePitch
Definition: SpnValue.hpp:48
static constexpr int Config_VoltageClosedLoopRampPeriod
Definition: SpnValue.hpp:166
static constexpr int Slot1_kI
Definition: SpnValue.hpp:132
static constexpr int CANCoder_MagnetOffset
Definition: SpnValue.hpp:84
static constexpr int Config_ReverseSoftLimitEnable
Definition: SpnValue.hpp:181
static constexpr int Config_SupplyTimeThres
Definition: SpnValue.hpp:197
static constexpr int Config_ForwardLimitSource
Definition: SpnValue.hpp:172
static constexpr int Slot0_kP
Definition: SpnValue.hpp:126
static constexpr int CANcoder_AbsoluteSensorRange
Definition: SpnValue.hpp:85
static constexpr int Config_Inverted
Definition: SpnValue.hpp:141
static constexpr int Config_ReverseLimitEnable
Definition: SpnValue.hpp:177
static constexpr int Config_PeakForwardV
Definition: SpnValue.hpp:152
static constexpr int Config_SupplyCurrLimitEn
Definition: SpnValue.hpp:149
static constexpr int Config_FeedbackSensorSource
Definition: SpnValue.hpp:160
static constexpr int Config_ReverseLimitRemoteSensorID
Definition: SpnValue.hpp:179
static constexpr int Config_ReverseLimitAutosetPosEnable
Definition: SpnValue.hpp:175
static constexpr int Config_VoltageOpenLoopRampPeriod
Definition: SpnValue.hpp:163
static constexpr int Pigeon2DisableNoMotionCalibration
Definition: SpnValue.hpp:46
static constexpr int Config_MotionMagicCruiseVelocity
Definition: SpnValue.hpp:184
static constexpr int Config_DutyCycleOpenLoopRampPeriod
Definition: SpnValue.hpp:162
static constexpr int Slot1_kP
Definition: SpnValue.hpp:131
static constexpr int Pigeon2GyroScalarZ
Definition: SpnValue.hpp:52
static constexpr int Config_ForwardLimitEnable
Definition: SpnValue.hpp:171
static constexpr int CustomParam0
Definition: SpnValue.hpp:33
static constexpr int Slot0_kD
Definition: SpnValue.hpp:128
static constexpr int Config_TorqueOpenLoopRampPeriod
Definition: SpnValue.hpp:164
static constexpr int Pigeon2UseCompass
Definition: SpnValue.hpp:44
static constexpr int Config_PeakForTorqCurr
Definition: SpnValue.hpp:154
static constexpr int Pigeon2MountPoseRoll
Definition: SpnValue.hpp:49
static constexpr int Config_ForwardLimitType
Definition: SpnValue.hpp:168
static constexpr int Slot2_kS
Definition: SpnValue.hpp:140
static constexpr int Config_ReverseLimitAutosetPosValue
Definition: SpnValue.hpp:176
static constexpr int Config_ForwardSoftLimitThreshold
Definition: SpnValue.hpp:182
static constexpr int Config_SupplyVLowpassTau
Definition: SpnValue.hpp:142
static constexpr int Config_FeedbackRotorOffset
Definition: SpnValue.hpp:157
static constexpr int Config_SupplyCurrThres
Definition: SpnValue.hpp:196
Definition: string_util.hpp:14