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