10#include <units/frequency.h>
11#include <units/time.h>
12#include <units/dimensionless.h>
13#include <units/angle.h>
27 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override;
159 constexpr std::string_view
GetName()
const override
161 return "DifferentialDutyCycle";
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Request a specified motor duty cycle with a differential position closed-loop.
Definition DifferentialDutyCycle.hpp:26
constexpr DifferentialDutyCycle & WithAverageOutput(units::dimensionless::scalar_t newAverageOutput)
Modifies this Control Request's AverageOutput parameter and returns itself for method-chaining and ea...
Definition DifferentialDutyCycle.hpp:177
std::string ToString() const override
Returns a string representation of the object.
constexpr DifferentialDutyCycle & WithDifferentialSlot(int newDifferentialSlot)
Modifies this Control Request's DifferentialSlot parameter and returns itself for method-chaining and...
Definition DifferentialDutyCycle.hpp:237
constexpr DifferentialDutyCycle & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition DifferentialDutyCycle.hpp:272
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
constexpr DifferentialDutyCycle & WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for method-chaining...
Definition DifferentialDutyCycle.hpp:312
units::angle::turn_t DifferentialPosition
Differential position to drive towards in rotations.
Definition DifferentialDutyCycle.hpp:44
constexpr DifferentialDutyCycle & WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for method-chaining...
Definition DifferentialDutyCycle.hpp:333
int DifferentialSlot
Select which gains are applied to the differential controller by selecting the slot.
Definition DifferentialDutyCycle.hpp:64
constexpr ~DifferentialDutyCycle() override
Definition DifferentialDutyCycle.hpp:152
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition DifferentialDutyCycle.hpp:117
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition DifferentialDutyCycle.hpp:159
bool IgnoreHardwareLimits
Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion param...
Definition DifferentialDutyCycle.hpp:96
constexpr DifferentialDutyCycle & WithEnableFOC(bool newEnableFOC)
Modifies this Control Request's EnableFOC parameter and returns itself for method-chaining and easier...
Definition DifferentialDutyCycle.hpp:220
constexpr DifferentialDutyCycle & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition DifferentialDutyCycle.hpp:355
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition DifferentialDutyCycle.hpp:83
constexpr DifferentialDutyCycle & WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for method-chain...
Definition DifferentialDutyCycle.hpp:255
bool EnableFOC
Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supp...
Definition DifferentialDutyCycle.hpp:58
constexpr DifferentialDutyCycle & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition DifferentialDutyCycle.hpp:377
units::dimensionless::scalar_t AverageOutput
Proportion of supply voltage to apply on the Average axis in fractional units between -1 and +1.
Definition DifferentialDutyCycle.hpp:37
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition DifferentialDutyCycle.hpp:132
constexpr DifferentialDutyCycle & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition DifferentialDutyCycle.hpp:289
bool LimitForwardMotion
Set to true to force forward limiting.
Definition DifferentialDutyCycle.hpp:77
bool OverrideBrakeDurNeutral
Set to true to static-brake the rotor when output is zero (or within deadband).
Definition DifferentialDutyCycle.hpp:71
bool IgnoreSoftwareLimits
Set to true to ignore software limits, instead allowing motion.
Definition DifferentialDutyCycle.hpp:106
constexpr DifferentialDutyCycle(units::dimensionless::scalar_t AverageOutput, units::angle::turn_t DifferentialPosition)
Request a specified motor duty cycle with a differential position closed-loop.
Definition DifferentialDutyCycle.hpp:147
constexpr DifferentialDutyCycle & WithDifferentialPosition(units::angle::turn_t newDifferentialPosition)
Modifies this Control Request's DifferentialPosition parameter and returns itself for method-chaining...
Definition DifferentialDutyCycle.hpp:195
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14