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