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/current.h>
28 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override;
37 units::angular_velocity::turns_per_second_t
Velocity;
45 units::angular_acceleration::turns_per_second_squared_t
Acceleration = 0.0_tr_per_s_sq;
152 constexpr std::string_view
GetName()
const override
154 return "VelocityTorqueCurrentFOC";
228 Slot = std::move(newSlot);
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Requires Phoenix Pro; Request PID to target velocity with torque current feedforward.
Definition VelocityTorqueCurrentFOC.hpp:27
units::angular_acceleration::turns_per_second_squared_t Acceleration
Acceleration to drive toward in rotations per second squared.
Definition VelocityTorqueCurrentFOC.hpp:45
bool IgnoreHardwareLimits
Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion param...
Definition VelocityTorqueCurrentFOC.hpp:93
constexpr VelocityTorqueCurrentFOC & WithFeedForward(units::current::ampere_t newFeedForward)
Modifies this Control Request's FeedForward parameter and returns itself for method-chaining and easi...
Definition VelocityTorqueCurrentFOC.hpp:209
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
constexpr VelocityTorqueCurrentFOC & WithLimitReverseMotion(bool newLimitReverseMotion)
Modifies this Control Request's LimitReverseMotion parameter and returns itself for method-chaining a...
Definition VelocityTorqueCurrentFOC.hpp:278
constexpr VelocityTorqueCurrentFOC & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition VelocityTorqueCurrentFOC.hpp:366
constexpr VelocityTorqueCurrentFOC & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition VelocityTorqueCurrentFOC.hpp:226
bool OverrideCoastDurNeutral
Set to true to coast the rotor when output is zero (or within deadband).
Definition VelocityTorqueCurrentFOC.hpp:68
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition VelocityTorqueCurrentFOC.hpp:152
constexpr VelocityTorqueCurrentFOC & WithOverrideCoastDurNeutral(bool newOverrideCoastDurNeutral)
Modifies this Control Request's OverrideCoastDurNeutral parameter and returns itself for method-chain...
Definition VelocityTorqueCurrentFOC.hpp:244
units::angular_velocity::turns_per_second_t Velocity
Velocity to drive toward in rotations per second.
Definition VelocityTorqueCurrentFOC.hpp:37
constexpr VelocityTorqueCurrentFOC & WithLimitForwardMotion(bool newLimitForwardMotion)
Modifies this Control Request's LimitForwardMotion parameter and returns itself for method-chaining a...
Definition VelocityTorqueCurrentFOC.hpp:261
constexpr VelocityTorqueCurrentFOC & 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 VelocityTorqueCurrentFOC.hpp:169
constexpr VelocityTorqueCurrentFOC & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition VelocityTorqueCurrentFOC.hpp:344
constexpr VelocityTorqueCurrentFOC & WithIgnoreHardwareLimits(bool newIgnoreHardwareLimits)
Modifies this Control Request's IgnoreHardwareLimits parameter and returns itself for method-chaining...
Definition VelocityTorqueCurrentFOC.hpp:301
units::current::ampere_t FeedForward
Feedforward to apply in torque current in Amperes.
Definition VelocityTorqueCurrentFOC.hpp:55
constexpr ~VelocityTorqueCurrentFOC() override
Definition VelocityTorqueCurrentFOC.hpp:145
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition VelocityTorqueCurrentFOC.hpp:129
constexpr VelocityTorqueCurrentFOC(units::angular_velocity::turns_per_second_t Velocity)
Requires Phoenix Pro; Request PID to target velocity with torque current feedforward.
Definition VelocityTorqueCurrentFOC.hpp:141
bool IgnoreSoftwareLimits
Set to true to ignore software limits, instead allowing motion.
Definition VelocityTorqueCurrentFOC.hpp:103
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition VelocityTorqueCurrentFOC.hpp:114
int Slot
Select which gains are applied by selecting the slot.
Definition VelocityTorqueCurrentFOC.hpp:61
std::string ToString() const override
Returns a string representation of the object.
bool LimitReverseMotion
Set to true to force reverse limiting.
Definition VelocityTorqueCurrentFOC.hpp:80
constexpr VelocityTorqueCurrentFOC & 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 VelocityTorqueCurrentFOC.hpp:188
bool LimitForwardMotion
Set to true to force forward limiting.
Definition VelocityTorqueCurrentFOC.hpp:74
constexpr VelocityTorqueCurrentFOC & WithIgnoreSoftwareLimits(bool newIgnoreSoftwareLimits)
Modifies this Control Request's IgnoreSoftwareLimits parameter and returns itself for method-chaining...
Definition VelocityTorqueCurrentFOC.hpp:322
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14