CTRE Phoenix 6 C++ 24.50.0-alpha-2
DynamicMotionMagicDutyCycle.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
12#include <sstream>
13#include <units/angle.h>
14#include <units/angular_velocity.h>
15#include <units/angular_acceleration.h>
16#include <units/angular_jerk.h>
17#include <units/dimensionless.h>
18#include <units/frequency.h>
19#include <units/time.h>
20
21
22namespace ctre {
23namespace phoenix6 {
24namespace controls {
25
26/**
27 * Requires Phoenix Pro and CANivore;
28 * Requests Motion Magic® to target a final position using a motion profile.
29 * This dynamic request allows runtime changes to Cruise Velocity, Acceleration,
30 * and Jerk. Users can optionally provide a duty cycle feedforward. This
31 * control requires use of a CANivore.
32 *
33 * Motion Magic® produces a motion profile in real-time while attempting to honor the specified Cruise
34 * Velocity, Acceleration, and Jerk value. This control mode does not use the Expo_kV or Expo_kA configs.
35 *
36 * Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This
37 * control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the
38 * numerator: +1.0 represents full forward output.
39 */
41{
42 ctre::phoenix::StatusCode SendRequest(const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req) override
43 {
44 if (req.get() != this)
45 {
46 auto const reqCast = dynamic_cast<DynamicMotionMagicDutyCycle *>(req.get());
47 if (reqCast != nullptr)
48 {
49 *reqCast = *this;
50 }
51 else
52 {
53 req = std::make_shared<DynamicMotionMagicDutyCycle>(*this);
54 }
55 }
56
57 return c_ctre_phoenix6_RequestControlDynamicMotionMagicDutyCycle(network, deviceHash, UpdateFreqHz.to<double>(), Position.to<double>(), Velocity.to<double>(), Acceleration.to<double>(), Jerk.to<double>(), EnableFOC, FeedForward.to<double>(), Slot, OverrideBrakeDurNeutral, LimitForwardMotion, LimitReverseMotion, UseTimesync);
58 }
59
60public:
61 /**
62 * Position to drive toward in rotations.
63 */
64 units::angle::turn_t Position;
65 /**
66 * Cruise velocity for profiling. The signage does not matter as the device
67 * will use the absolute value for profile generation.
68 */
69 units::angular_velocity::turns_per_second_t Velocity;
70 /**
71 * Acceleration for profiling. The signage does not matter as the device will
72 * use the absolute value for profile generation
73 */
74 units::angular_acceleration::turns_per_second_squared_t Acceleration;
75 /**
76 * Jerk for profiling. The signage does not matter as the device will use the
77 * absolute value for profile generation
78 */
79 units::angular_jerk::turns_per_second_cubed_t Jerk;
80 /**
81 * Set to true to use FOC commutation (requires Phoenix Pro), which increases
82 * peak power by ~15%. Set to false to use trapezoidal commutation.
83 *
84 * FOC improves motor performance by leveraging torque (current) control.
85 * However, this may be inconvenient for applications that require specifying
86 * duty cycle or voltage. CTR-Electronics has developed a hybrid method that
87 * combines the performances gains of FOC while still allowing applications to
88 * provide duty cycle or voltage demand. This not to be confused with simple
89 * sinusoidal control or phase voltage control which lacks the performance
90 * gains.
91 */
93 /**
94 * Feedforward to apply in fractional units between -1 and +1.
95 */
96 units::dimensionless::scalar_t FeedForward;
97 /**
98 * Select which gains are applied by selecting the slot. Use the configuration
99 * api to set the gain values for the selected slot before enabling this
100 * feature. Slot must be within [0,2].
101 */
102 int Slot;
103 /**
104 * Set to true to static-brake the rotor when output is zero (or within
105 * deadband). Set to false to use the NeutralMode configuration setting
106 * (default). This flag exists to provide the fundamental behavior of this
107 * control when output is zero, which is to provide 0V to the motor.
108 */
110 /**
111 * Set to true to force forward limiting. This allows users to use other limit
112 * switch sensors connected to robot controller. This also allows use of active
113 * sensors that require external power.
114 */
116 /**
117 * Set to true to force reverse limiting. This allows users to use other limit
118 * switch sensors connected to robot controller. This also allows use of active
119 * sensors that require external power.
120 */
122 /**
123 * Set to true to delay applying this control request until a timesync boundary
124 * (requires Phoenix Pro and CANivore). This eliminates the impact of
125 * nondeterministic network delays in exchange for a larger but deterministic
126 * control latency.
127 */
129
130 /**
131 * \brief The period at which this control will update at.
132 * This is designated in Hertz, with a minimum of 20 Hz
133 * (every 50 ms) and a maximum of 1000 Hz (every 1 ms).
134 *
135 * If this field is set to 0 Hz, the control request will
136 * be sent immediately as a one-shot frame. This may be useful
137 * for advanced applications that require outputs to be
138 * synchronized with data acquisition. In this case, we
139 * recommend not exceeding 50 ms between control calls.
140 */
141 units::frequency::hertz_t UpdateFreqHz{100_Hz}; // Default to 100_Hz
142
143 /**
144 * \brief Requires Phoenix Pro and CANivore;
145 * Requests Motion Magic® to target a final position using a motion
146 * profile. This dynamic request allows runtime changes to Cruise
147 * Velocity, Acceleration, and Jerk. Users can optionally provide a duty
148 * cycle feedforward. This control requires use of a CANivore.
149 *
150 * \details Motion Magic® produces a motion profile in real-time while
151 * attempting to honor the specified Cruise Velocity, Acceleration, and
152 * Jerk value. This control mode does not use the Expo_kV or Expo_kA
153 * configs.
154 *
155 * Target position can be changed on-the-fly and Motion Magic® will do
156 * its best to adjust the profile. This control mode is duty cycle
157 * based, so relevant closed-loop gains will use fractional duty cycle
158 * for the numerator: +1.0 represents full forward output.
159 *
160 * \param Position Position to drive toward in rotations.
161 * \param Velocity Cruise velocity for profiling. The signage does not
162 * matter as the device will use the absolute value for
163 * profile generation.
164 * \param Acceleration Acceleration for profiling. The signage does not
165 * matter as the device will use the absolute value for
166 * profile generation
167 * \param Jerk Jerk for profiling. The signage does not matter as the device
168 * will use the absolute value for profile generation
169 * \param EnableFOC Set to true to use FOC commutation (requires Phoenix
170 * Pro), which increases peak power by ~15%. Set to false to
171 * use trapezoidal commutation.
172 *
173 * FOC improves motor performance by leveraging torque
174 * (current) control. However, this may be inconvenient for
175 * applications that require specifying duty cycle or
176 * voltage. CTR-Electronics has developed a hybrid method
177 * that combines the performances gains of FOC while still
178 * allowing applications to provide duty cycle or voltage
179 * demand. This not to be confused with simple sinusoidal
180 * control or phase voltage control which lacks the
181 * performance gains.
182 * \param FeedForward Feedforward to apply in fractional units between -1 and
183 * +1.
184 * \param Slot Select which gains are applied by selecting the slot. Use the
185 * configuration api to set the gain values for the selected slot
186 * before enabling this feature. Slot must be within [0,2].
187 * \param OverrideBrakeDurNeutral Set to true to static-brake the rotor when
188 * output is zero (or within deadband). Set
189 * to false to use the NeutralMode
190 * configuration setting (default). This flag
191 * exists to provide the fundamental behavior
192 * of this control when output is zero, which
193 * is to provide 0V to the motor.
194 * \param LimitForwardMotion Set to true to force forward limiting. This
195 * allows users to use other limit switch sensors
196 * connected to robot controller. This also allows
197 * use of active sensors that require external
198 * power.
199 * \param LimitReverseMotion Set to true to force reverse limiting. This
200 * allows users to use other limit switch sensors
201 * connected to robot controller. This also allows
202 * use of active sensors that require external
203 * power.
204 * \param UseTimesync Set to true to delay applying this control request
205 * until a timesync boundary (requires Phoenix Pro and
206 * CANivore). This eliminates the impact of
207 * nondeterministic network delays in exchange for a
208 * larger but deterministic control latency.
209 */
210 DynamicMotionMagicDutyCycle(units::angle::turn_t Position, units::angular_velocity::turns_per_second_t Velocity, units::angular_acceleration::turns_per_second_squared_t Acceleration, units::angular_jerk::turns_per_second_cubed_t Jerk, bool EnableFOC = true, units::dimensionless::scalar_t FeedForward = 0.0, int Slot = 0, bool OverrideBrakeDurNeutral = false, bool LimitForwardMotion = false, bool LimitReverseMotion = false, bool UseTimesync = false) : ControlRequest{"DynamicMotionMagicDutyCycle"},
211 Position{std::move(Position)},
212 Velocity{std::move(Velocity)},
214 Jerk{std::move(Jerk)},
215 EnableFOC{std::move(EnableFOC)},
217 Slot{std::move(Slot)},
222 {}
223
224 /**
225 * \brief Modifies this Control Request's Position parameter and returns itself for
226 * method-chaining and easier to use request API.
227 *
228 * Position to drive toward in rotations.
229 *
230 * \param newPosition Parameter to modify
231 * \returns Itself
232 */
233 DynamicMotionMagicDutyCycle& WithPosition(units::angle::turn_t newPosition)
234 {
235 Position = std::move(newPosition);
236 return *this;
237 }
238
239 /**
240 * \brief Modifies this Control Request's Velocity parameter and returns itself for
241 * method-chaining and easier to use request API.
242 *
243 * Cruise velocity for profiling. The signage does not matter as the device
244 * will use the absolute value for profile generation.
245 *
246 * \param newVelocity Parameter to modify
247 * \returns Itself
248 */
249 DynamicMotionMagicDutyCycle& WithVelocity(units::angular_velocity::turns_per_second_t newVelocity)
250 {
251 Velocity = std::move(newVelocity);
252 return *this;
253 }
254
255 /**
256 * \brief Modifies this Control Request's Acceleration parameter and returns itself for
257 * method-chaining and easier to use request API.
258 *
259 * Acceleration for profiling. The signage does not matter as the device will
260 * use the absolute value for profile generation
261 *
262 * \param newAcceleration Parameter to modify
263 * \returns Itself
264 */
265 DynamicMotionMagicDutyCycle& WithAcceleration(units::angular_acceleration::turns_per_second_squared_t newAcceleration)
266 {
267 Acceleration = std::move(newAcceleration);
268 return *this;
269 }
270
271 /**
272 * \brief Modifies this Control Request's Jerk parameter and returns itself for
273 * method-chaining and easier to use request API.
274 *
275 * Jerk for profiling. The signage does not matter as the device will use the
276 * absolute value for profile generation
277 *
278 * \param newJerk Parameter to modify
279 * \returns Itself
280 */
281 DynamicMotionMagicDutyCycle& WithJerk(units::angular_jerk::turns_per_second_cubed_t newJerk)
282 {
283 Jerk = std::move(newJerk);
284 return *this;
285 }
286
287 /**
288 * \brief Modifies this Control Request's EnableFOC parameter and returns itself for
289 * method-chaining and easier to use request API.
290 *
291 * Set to true to use FOC commutation (requires Phoenix Pro), which increases
292 * peak power by ~15%. Set to false to use trapezoidal commutation.
293 *
294 * FOC improves motor performance by leveraging torque (current) control.
295 * However, this may be inconvenient for applications that require specifying
296 * duty cycle or voltage. CTR-Electronics has developed a hybrid method that
297 * combines the performances gains of FOC while still allowing applications to
298 * provide duty cycle or voltage demand. This not to be confused with simple
299 * sinusoidal control or phase voltage control which lacks the performance
300 * gains.
301 *
302 * \param newEnableFOC Parameter to modify
303 * \returns Itself
304 */
306 {
307 EnableFOC = std::move(newEnableFOC);
308 return *this;
309 }
310
311 /**
312 * \brief Modifies this Control Request's FeedForward parameter and returns itself for
313 * method-chaining and easier to use request API.
314 *
315 * Feedforward to apply in fractional units between -1 and +1.
316 *
317 * \param newFeedForward Parameter to modify
318 * \returns Itself
319 */
320 DynamicMotionMagicDutyCycle& WithFeedForward(units::dimensionless::scalar_t newFeedForward)
321 {
322 FeedForward = std::move(newFeedForward);
323 return *this;
324 }
325
326 /**
327 * \brief Modifies this Control Request's Slot parameter and returns itself for
328 * method-chaining and easier to use request API.
329 *
330 * Select which gains are applied by selecting the slot. Use the configuration
331 * api to set the gain values for the selected slot before enabling this
332 * feature. Slot must be within [0,2].
333 *
334 * \param newSlot Parameter to modify
335 * \returns Itself
336 */
338 {
339 Slot = std::move(newSlot);
340 return *this;
341 }
342
343 /**
344 * \brief Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for
345 * method-chaining and easier to use request API.
346 *
347 * Set to true to static-brake the rotor when output is zero (or within
348 * deadband). Set to false to use the NeutralMode configuration setting
349 * (default). This flag exists to provide the fundamental behavior of this
350 * control when output is zero, which is to provide 0V to the motor.
351 *
352 * \param newOverrideBrakeDurNeutral Parameter to modify
353 * \returns Itself
354 */
356 {
357 OverrideBrakeDurNeutral = std::move(newOverrideBrakeDurNeutral);
358 return *this;
359 }
360
361 /**
362 * \brief Modifies this Control Request's LimitForwardMotion parameter and returns itself for
363 * method-chaining and easier to use request API.
364 *
365 * Set to true to force forward limiting. This allows users to use other limit
366 * switch sensors connected to robot controller. This also allows use of active
367 * sensors that require external power.
368 *
369 * \param newLimitForwardMotion Parameter to modify
370 * \returns Itself
371 */
373 {
374 LimitForwardMotion = std::move(newLimitForwardMotion);
375 return *this;
376 }
377
378 /**
379 * \brief Modifies this Control Request's LimitReverseMotion parameter and returns itself for
380 * method-chaining and easier to use request API.
381 *
382 * Set to true to force reverse limiting. This allows users to use other limit
383 * switch sensors connected to robot controller. This also allows use of active
384 * sensors that require external power.
385 *
386 * \param newLimitReverseMotion Parameter to modify
387 * \returns Itself
388 */
390 {
391 LimitReverseMotion = std::move(newLimitReverseMotion);
392 return *this;
393 }
394
395 /**
396 * \brief Modifies this Control Request's UseTimesync parameter and returns itself for
397 * method-chaining and easier to use request API.
398 *
399 * Set to true to delay applying this control request until a timesync boundary
400 * (requires Phoenix Pro and CANivore). This eliminates the impact of
401 * nondeterministic network delays in exchange for a larger but deterministic
402 * control latency.
403 *
404 * \param newUseTimesync Parameter to modify
405 * \returns Itself
406 */
408 {
409 UseTimesync = std::move(newUseTimesync);
410 return *this;
411 }
412 /**
413 * \brief Sets the period at which this control will update at.
414 * This is designated in Hertz, with a minimum of 20 Hz
415 * (every 50 ms) and a maximum of 1000 Hz (every 1 ms).
416 *
417 * If this field is set to 0 Hz, the control request will
418 * be sent immediately as a one-shot frame. This may be useful
419 * for advanced applications that require outputs to be
420 * synchronized with data acquisition. In this case, we
421 * recommend not exceeding 50 ms between control calls.
422 *
423 * \param newUpdateFreqHz Parameter to modify
424 * \returns Itself
425 */
426 DynamicMotionMagicDutyCycle &WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
427 {
428 UpdateFreqHz = newUpdateFreqHz;
429 return *this;
430 }
431 /**
432 * Returns a string representation of the object.
433 *
434 * \returns a string representation of the object.
435 */
436 std::string ToString() const override
437 {
438 std::stringstream ss;
439 ss << "Control: DynamicMotionMagicDutyCycle" << std::endl;
440 ss << " Position: " << Position.to<double>() << " rotations" << std::endl;
441 ss << " Velocity: " << Velocity.to<double>() << " rotations per second" << std::endl;
442 ss << " Acceleration: " << Acceleration.to<double>() << " rotations per second²" << std::endl;
443 ss << " Jerk: " << Jerk.to<double>() << " rotations per second³" << std::endl;
444 ss << " EnableFOC: " << EnableFOC << std::endl;
445 ss << " FeedForward: " << FeedForward.to<double>() << " fractional" << std::endl;
446 ss << " Slot: " << Slot << std::endl;
447 ss << " OverrideBrakeDurNeutral: " << OverrideBrakeDurNeutral << std::endl;
448 ss << " LimitForwardMotion: " << LimitForwardMotion << std::endl;
449 ss << " LimitReverseMotion: " << LimitReverseMotion << std::endl;
450 ss << " UseTimesync: " << UseTimesync << std::endl;
451 return ss.str();
452 }
453
454 /**
455 * \brief Gets information about this control request.
456 *
457 * \returns Map of control parameter names and corresponding applied values
458 */
459 std::map<std::string, std::string> GetControlInfo() const override
460 {
461 std::map<std::string, std::string> controlInfo;
462 std::stringstream ss;
463 controlInfo["Name"] = GetName();
464 ss << Position.to<double>(); controlInfo["Position"] = ss.str(); ss.str(std::string{});
465 ss << Velocity.to<double>(); controlInfo["Velocity"] = ss.str(); ss.str(std::string{});
466 ss << Acceleration.to<double>(); controlInfo["Acceleration"] = ss.str(); ss.str(std::string{});
467 ss << Jerk.to<double>(); controlInfo["Jerk"] = ss.str(); ss.str(std::string{});
468 ss << EnableFOC; controlInfo["EnableFOC"] = ss.str(); ss.str(std::string{});
469 ss << FeedForward.to<double>(); controlInfo["FeedForward"] = ss.str(); ss.str(std::string{});
470 ss << Slot; controlInfo["Slot"] = ss.str(); ss.str(std::string{});
471 ss << OverrideBrakeDurNeutral; controlInfo["OverrideBrakeDurNeutral"] = ss.str(); ss.str(std::string{});
472 ss << LimitForwardMotion; controlInfo["LimitForwardMotion"] = ss.str(); ss.str(std::string{});
473 ss << LimitReverseMotion; controlInfo["LimitReverseMotion"] = ss.str(); ss.str(std::string{});
474 ss << UseTimesync; controlInfo["UseTimesync"] = ss.str(); ss.str(std::string{});
475 return controlInfo;
476 }
477};
478
479}
480}
481}
482
CTREXPORT int c_ctre_phoenix6_RequestControlDynamicMotionMagicDutyCycle(const char *canbus, uint32_t ecuEncoding, double updateTime, double Position, double Velocity, double Acceleration, double Jerk, bool EnableFOC, double FeedForward, int Slot, bool OverrideBrakeDurNeutral, bool LimitForwardMotion, bool LimitReverseMotion, bool UseTimesync)
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:29
std::string const & GetName() const
Definition: ControlRequest.hpp:52
Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion p...
Definition: DynamicMotionMagicDutyCycle.hpp:41
std::string ToString() const override
Returns a string representation of the object.
Definition: DynamicMotionMagicDutyCycle.hpp:436
DynamicMotionMagicDutyCycle & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition: DynamicMotionMagicDutyCycle.hpp:407
units::angular_velocity::turns_per_second_t Velocity
Cruise velocity for profiling.
Definition: DynamicMotionMagicDutyCycle.hpp:69
units::angular_acceleration::turns_per_second_squared_t Acceleration
Acceleration for profiling.
Definition: DynamicMotionMagicDutyCycle.hpp:74
bool OverrideBrakeDurNeutral
Set to true to static-brake the rotor when output is zero (or within deadband).
Definition: DynamicMotionMagicDutyCycle.hpp:109
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition: DynamicMotionMagicDutyCycle.hpp:141
bool EnableFOC
Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15%.
Definition: DynamicMotionMagicDutyCycle.hpp:92
DynamicMotionMagicDutyCycle & WithVelocity(units::angular_velocity::turns_per_second_t newVelocity)
Modifies this Control Request's Velocity parameter and returns itself for method-chaining and easier ...
Definition: DynamicMotionMagicDutyCycle.hpp:249
DynamicMotionMagicDutyCycle(units::angle::turn_t Position, units::angular_velocity::turns_per_second_t Velocity, units::angular_acceleration::turns_per_second_squared_t Acceleration, units::angular_jerk::turns_per_second_cubed_t Jerk, bool EnableFOC=true, units::dimensionless::scalar_t FeedForward=0.0, int Slot=0, bool OverrideBrakeDurNeutral=false, bool LimitForwardMotion=false, bool LimitReverseMotion=false, bool UseTimesync=false)
Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion p...
Definition: DynamicMotionMagicDutyCycle.hpp:210
units::angular_jerk::turns_per_second_cubed_t Jerk
Jerk for profiling.
Definition: DynamicMotionMagicDutyCycle.hpp:79
DynamicMotionMagicDutyCycle & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition: DynamicMotionMagicDutyCycle.hpp:337
DynamicMotionMagicDutyCycle & WithAcceleration(units::angular_acceleration::turns_per_second_squared_t newAcceleration)
Modifies this Control Request's Acceleration parameter and returns itself for method-chaining and eas...
Definition: DynamicMotionMagicDutyCycle.hpp:265
bool LimitForwardMotion
Set to true to force forward limiting.
Definition: DynamicMotionMagicDutyCycle.hpp:115
DynamicMotionMagicDutyCycle & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition: DynamicMotionMagicDutyCycle.hpp:372
DynamicMotionMagicDutyCycle & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition: DynamicMotionMagicDutyCycle.hpp:426
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition: DynamicMotionMagicDutyCycle.hpp:121
DynamicMotionMagicDutyCycle & WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for method-chain...
Definition: DynamicMotionMagicDutyCycle.hpp:355
DynamicMotionMagicDutyCycle & WithEnableFOC(bool newEnableFOC)
Modifies this Control Request's EnableFOC parameter and returns itself for method-chaining and easier...
Definition: DynamicMotionMagicDutyCycle.hpp:305
DynamicMotionMagicDutyCycle & WithJerk(units::angular_jerk::turns_per_second_cubed_t newJerk)
Modifies this Control Request's Jerk parameter and returns itself for method-chaining and easier to u...
Definition: DynamicMotionMagicDutyCycle.hpp:281
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition: DynamicMotionMagicDutyCycle.hpp:459
DynamicMotionMagicDutyCycle & WithFeedForward(units::dimensionless::scalar_t newFeedForward)
Modifies this Control Request's FeedForward parameter and returns itself for method-chaining and easi...
Definition: DynamicMotionMagicDutyCycle.hpp:320
DynamicMotionMagicDutyCycle & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition: DynamicMotionMagicDutyCycle.hpp:389
units::angle::turn_t Position
Position to drive toward in rotations.
Definition: DynamicMotionMagicDutyCycle.hpp:64
int Slot
Select which gains are applied by selecting the slot.
Definition: DynamicMotionMagicDutyCycle.hpp:102
DynamicMotionMagicDutyCycle & WithPosition(units::angle::turn_t newPosition)
Modifies this Control Request's Position parameter and returns itself for method-chaining and easier ...
Definition: DynamicMotionMagicDutyCycle.hpp:233
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition: DynamicMotionMagicDutyCycle.hpp:128
units::dimensionless::scalar_t FeedForward
Feedforward to apply in fractional units between -1 and +1.
Definition: DynamicMotionMagicDutyCycle.hpp:96
Status codes reported by APIs, including OK, warnings, and errors.
Definition: StatusCodes.h:27
Represents the state of one swerve module.
Definition: StatusCodes.h:18
Definition: span.hpp:401