10#include <units/frequency.h>
11#include <units/time.h>
12#include <units/voltage.h>
13#include <units/angle.h>
27 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override;
158 constexpr std::string_view
GetName()
const override
160 return "DifferentialVoltage";
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Request a specified voltage with a differential position closed-loop.
Definition DifferentialVoltage.hpp:26
bool IgnoreHardwareLimits
Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion param...
Definition DifferentialVoltage.hpp:95
constexpr ~DifferentialVoltage() override
Definition DifferentialVoltage.hpp:151
units::voltage::volt_t AverageOutput
Voltage to attempt to drive at on the Average axis.
Definition DifferentialVoltage.hpp:36
constexpr DifferentialVoltage & WithEnableFOC(bool newEnableFOC)
Modifies this Control Request's EnableFOC parameter and returns itself for method-chaining and easier...
Definition DifferentialVoltage.hpp:218
constexpr DifferentialVoltage & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition DifferentialVoltage.hpp:287
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition DifferentialVoltage.hpp:116
bool EnableFOC
Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supp...
Definition DifferentialVoltage.hpp:57
bool LimitForwardMotion
Set to true to force forward limiting.
Definition DifferentialVoltage.hpp:76
units::angle::turn_t DifferentialPosition
Differential position to drive towards in rotations.
Definition DifferentialVoltage.hpp:43
int DifferentialSlot
Select which gains are applied to the differential controller by selecting the slot.
Definition DifferentialVoltage.hpp:63
constexpr DifferentialVoltage & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition DifferentialVoltage.hpp:375
constexpr DifferentialVoltage & WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for method-chain...
Definition DifferentialVoltage.hpp:253
constexpr DifferentialVoltage(units::voltage::volt_t AverageOutput, units::angle::turn_t DifferentialPosition)
Request a specified voltage with a differential position closed-loop.
Definition DifferentialVoltage.hpp:146
bool IgnoreSoftwareLimits
Set to true to ignore software limits, instead allowing motion.
Definition DifferentialVoltage.hpp:105
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition DifferentialVoltage.hpp:158
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition DifferentialVoltage.hpp:131
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition DifferentialVoltage.hpp:82
constexpr DifferentialVoltage & WithAverageOutput(units::voltage::volt_t newAverageOutput)
Modifies this Control Request's AverageOutput parameter and returns itself for method-chaining and ea...
Definition DifferentialVoltage.hpp:175
std::string ToString() const override
Returns a string representation of the object.
constexpr DifferentialVoltage & WithDifferentialPosition(units::angle::turn_t newDifferentialPosition)
Modifies this Control Request's DifferentialPosition parameter and returns itself for method-chaining...
Definition DifferentialVoltage.hpp:193
constexpr DifferentialVoltage & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition DifferentialVoltage.hpp:270
constexpr DifferentialVoltage & WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for method-chaining...
Definition DifferentialVoltage.hpp:310
constexpr DifferentialVoltage & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition DifferentialVoltage.hpp:353
constexpr DifferentialVoltage & WithDifferentialSlot(int newDifferentialSlot)
Modifies this Control Request's DifferentialSlot parameter and returns itself for method-chaining and...
Definition DifferentialVoltage.hpp:235
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
constexpr DifferentialVoltage & WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for method-chaining...
Definition DifferentialVoltage.hpp:331
bool OverrideBrakeDurNeutral
Set to true to static-brake the rotor when output is zero (or within deadband).
Definition DifferentialVoltage.hpp:70
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14