10#include <units/frequency.h>
11#include <units/time.h>
12#include <units/angular_velocity.h>
13#include <units/angular_acceleration.h>
14#include <units/dimensionless.h>
27 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override;
36 units::angular_velocity::turns_per_second_t
Velocity;
44 units::angular_acceleration::turns_per_second_squared_t
Acceleration = 0.0_tr_per_s_sq;
162 constexpr std::string_view
GetName()
const override
164 return "VelocityDutyCycle";
261 Slot = std::move(newSlot);
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Request PID to target velocity with duty cycle feedforward.
Definition VelocityDutyCycle.hpp:26
constexpr VelocityDutyCycle & 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 VelocityDutyCycle.hpp:179
int Slot
Select which gains are applied by selecting the slot.
Definition VelocityDutyCycle.hpp:72
constexpr VelocityDutyCycle & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition VelocityDutyCycle.hpp:399
units::angular_acceleration::turns_per_second_squared_t Acceleration
Acceleration to drive toward in rotations per second squared.
Definition VelocityDutyCycle.hpp:44
constexpr VelocityDutyCycle & WithEnableFOC(bool newEnableFOC)
Modifies this Control Request's EnableFOC parameter and returns itself for method-chaining and easier...
Definition VelocityDutyCycle.hpp:223
bool OverrideBrakeDurNeutral
Set to true to static-brake the rotor when output is zero (or within deadband).
Definition VelocityDutyCycle.hpp:79
bool IgnoreSoftwareLimits
Set to true to ignore software limits, instead allowing motion.
Definition VelocityDutyCycle.hpp:114
bool IgnoreHardwareLimits
Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion param...
Definition VelocityDutyCycle.hpp:104
units::angular_velocity::turns_per_second_t Velocity
Velocity to drive toward in rotations per second.
Definition VelocityDutyCycle.hpp:36
constexpr VelocityDutyCycle & 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 VelocityDutyCycle.hpp:198
constexpr VelocityDutyCycle & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition VelocityDutyCycle.hpp:294
constexpr VelocityDutyCycle & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition VelocityDutyCycle.hpp:259
constexpr VelocityDutyCycle & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition VelocityDutyCycle.hpp:311
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition VelocityDutyCycle.hpp:140
constexpr VelocityDutyCycle & WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for method-chaining...
Definition VelocityDutyCycle.hpp:355
constexpr VelocityDutyCycle(units::angular_velocity::turns_per_second_t Velocity)
Request PID to target velocity with duty cycle feedforward.
Definition VelocityDutyCycle.hpp:151
units::dimensionless::scalar_t FeedForward
Feedforward to apply in fractional units between -1 and +1.
Definition VelocityDutyCycle.hpp:66
constexpr VelocityDutyCycle & WithFeedForward(units::dimensionless::scalar_t newFeedForward)
Modifies this Control Request's FeedForward parameter and returns itself for method-chaining and easi...
Definition VelocityDutyCycle.hpp:242
bool EnableFOC
Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supp...
Definition VelocityDutyCycle.hpp:58
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition VelocityDutyCycle.hpp:162
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition VelocityDutyCycle.hpp:91
constexpr VelocityDutyCycle & WithOverrideBrakeDurNeutral(bool newOverrideBrakeDurNeutral)
Modifies this Control Request's OverrideBrakeDurNeutral parameter and returns itself for method-chain...
Definition VelocityDutyCycle.hpp:277
constexpr VelocityDutyCycle & WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for method-chaining...
Definition VelocityDutyCycle.hpp:334
std::string ToString() const override
Returns a string representation of the object.
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition VelocityDutyCycle.hpp:125
constexpr ~VelocityDutyCycle() override
Definition VelocityDutyCycle.hpp:155
bool LimitForwardMotion
Set to true to force forward limiting.
Definition VelocityDutyCycle.hpp:85
constexpr VelocityDutyCycle & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition VelocityDutyCycle.hpp:377
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14