CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix6::mechanisms::DifferentialMechanism Class Reference

Manages control of a two-axis differential mechanism. More...

#include <ctre/phoenix6/mechanisms/DifferentialMechanism.hpp>

Public Types

enum class  DifferentialPigeon2Source { Yaw , Pitch , Roll }
 Sensor sources for a differential Pigeon 2. More...
 
enum class  DisabledReason {
  None , MissingRemoteSensor , MissingDifferentialFX , RemoteSensorPosOverflow ,
  DeviceHasReset
}
 Possible reasons for the mechanism to disable. More...
 
enum class  RequiresUserReason { None , RemoteSensorPosOverflow , DeviceHasReset }
 Possible reasons for the mechanism to require user action to resume control. More...
 

Public Member Functions

 DifferentialMechanism (hardware::TalonFX &differentialAddFX, hardware::TalonFX &differentialSubFX, bool motorDirectionsAlign)
 Creates a new differential mechanism using the given two hardware::TalonFX devices. More...
 
 DifferentialMechanism (hardware::TalonFX &differentialAddFX, hardware::TalonFX &differentialSubFX, bool motorDirectionsAlign, hardware::Pigeon2 &pigeon2, DifferentialPigeon2Source pigeonSource)
 Creates a new differential mechanism using the given two hardware::TalonFX devices and a hardware::Pigeon2. More...
 
 DifferentialMechanism (hardware::TalonFX &differentialAddFX, hardware::TalonFX &differentialSubFX, bool motorDirectionsAlign, hardware::CANcoder &cancoder)
 Creates a new differential mechanism using the given two hardware::TalonFX devices and a hardware::CANcoder. More...
 
hardware::TalonFXGetDifferentialLeader ()
 Get the Talon FX that is differential leader. More...
 
hardware::TalonFX const & GetDifferentialLeader () const
 Get the Talon FX that is differential leader. More...
 
hardware::TalonFXGetDifferentialFollower ()
 Get the Talon FX that is differential follower. More...
 
hardware::TalonFX const & GetDifferentialFollower () const
 Get the Talon FX that is differential follower. More...
 
ctre::phoenix::StatusCode ApplyConfigs (int numRetries=kDefaultConfigRetries)
 Apply the mechanism configs to the devices. More...
 
void Periodic ()
 Call this method periodically to keep the mechanism state updated. More...
 
bool IsDisabled () const
 Get whether the mechanism is currently disabled due to an issue. More...
 
bool RequiresUserAction () const
 Get whether the mechanism is currently disabled and requires user action to re-enable mechanism control. More...
 
MechanismState GetMechanismState () const
 Gets the state of the mechanism. More...
 
void ClearUserRequirement ()
 Indicate to the mechanism that the user has performed the required action to resume mechanism control. More...
 
DisabledReason GetDisabledReason () const
 
RequiresUserReason GetRequiresUserReason () const
 
ctre::phoenix::StatusCode SetNeutralOut ()
 Request neutral output of mechanism. More...
 
ctre::phoenix::StatusCode SetCoastOut ()
 Request coast neutral output of mechanism. More...
 
ctre::phoenix::StatusCode SetStaticBrake ()
 Applies full neutral-brake on the mechanism by shorting motor leads together. More...
 
ctre::phoenix::StatusCode SetControl (controls::DutyCycleOut AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::DutyCycleOut AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VoltageOut AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VoltageOut AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::TorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::TorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::PositionTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::VelocityTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism. More...
 

Static Public Attributes

static constexpr int kDefaultConfigRetries = 5
 The default number of retries for config applies. More...
 

Detailed Description

Manages control of a two-axis differential mechanism.

This mechanism requires the devices to be Pro licensed and connected to a CAN FD bus. Unlicensed users and users on a CAN 2.0 bus can use the SimpleDifferentialMechanism instead with limited functionality.

Member Enumeration Documentation

◆ DifferentialPigeon2Source

Sensor sources for a differential Pigeon 2.

Enumerator
Yaw 
Pitch 
Roll 

◆ DisabledReason

Possible reasons for the mechanism to disable.

Enumerator
None 

No reason given.

MissingRemoteSensor 

A remote sensor is not present on CAN Bus.

MissingDifferentialFX 

The remote Talon FX used for differential control is not present on CAN Bus.

RemoteSensorPosOverflow 

A remote sensor position has overflowed.

Because of the nature of remote sensors, it is possible for a remote sensor position to overflow beyond what is supported by the status signal frame. However, this is rare and cannot occur over the course of an FRC match under normal use.

DeviceHasReset 

A device or remote sensor has reset.

◆ RequiresUserReason

Possible reasons for the mechanism to require user action to resume control.

Enumerator
None 

No reason given.

RemoteSensorPosOverflow 

A remote sensor position has overflowed.

Because of the nature of remote sensors, it is possible for a remote sensor position to overflow beyond what is supported by the status signal frame. However, this is rare and cannot occur over the course of an FRC match under normal use.

DeviceHasReset 

A device or remote sensor has reset.

Constructor & Destructor Documentation

◆ DifferentialMechanism() [1/3]

ctre::phoenix6::mechanisms::DifferentialMechanism::DifferentialMechanism ( hardware::TalonFX differentialAddFX,
hardware::TalonFX differentialSubFX,
bool  motorDirectionsAlign 
)
inline

Creates a new differential mechanism using the given two hardware::TalonFX devices.

The mechanism will use the average of the two Talon FX sensors on the primary axis, and the difference between the two Talon FX sensors on the differential axis.

This mechanism requires the devices to be Pro licensed and connected to a CAN FD bus. Unlicensed users and users on a CAN 2.0 bus can use the SimpleDifferentialMechanism instead with limited functionality.

Parameters
differentialAddFXThe Talon FX that will have the differential output added to its regular output.
differentialSubFXThe Talon FX that will have the differential output subtracted from its regular output.
motorDirectionsAlignWhether the differential motors' directions are aligned.

◆ DifferentialMechanism() [2/3]

ctre::phoenix6::mechanisms::DifferentialMechanism::DifferentialMechanism ( hardware::TalonFX differentialAddFX,
hardware::TalonFX differentialSubFX,
bool  motorDirectionsAlign,
hardware::Pigeon2 pigeon2,
DifferentialPigeon2Source  pigeonSource 
)
inline

Creates a new differential mechanism using the given two hardware::TalonFX devices and a hardware::Pigeon2.

The mechanism will use the average of the two Talon FX sensors on the primary axis, and the selected Pigeon 2 sensor source on the differential axis.

This mechanism requires the devices to be Pro licensed and connected to a CAN FD bus. Unlicensed users and users on a CAN 2.0 bus can use the SimpleDifferentialMechanism instead with limited functionality.

Parameters
differentialAddFXThe Talon FX that will have the differential output added to its regular output.
differentialSubFXThe Talon FX that will have the differential output subtracted from its regular output.
motorDirectionsAlignWhether the differential motors' directions are aligned.
pigeon2The Pigeon 2 to use for the differential axis.
pigeonSourceThe sensor source to use for the Pigeon 2 (Yaw, Pitch, or Roll).

◆ DifferentialMechanism() [3/3]

ctre::phoenix6::mechanisms::DifferentialMechanism::DifferentialMechanism ( hardware::TalonFX differentialAddFX,
hardware::TalonFX differentialSubFX,
bool  motorDirectionsAlign,
hardware::CANcoder cancoder 
)
inline

Creates a new differential mechanism using the given two hardware::TalonFX devices and a hardware::CANcoder.

The mechanism will use the average of the two Talon FX sensors on the primary axis, and the CANcoder position/velocity on the differential axis.

This mechanism requires the devices to be Pro licensed and connected to a CAN FD bus. Unlicensed users and users on a CAN 2.0 bus can use the SimpleDifferentialMechanism instead with limited functionality.

Parameters
differentialAddFXThe Talon FX that will have the differential output added to its regular output.
differentialSubFXThe Talon FX that will have the differential output subtracted from its regular output.
motorDirectionsAlignWhether the differential motors' directions are aligned.
cancoderThe CANcoder to use for the differential axis.

Member Function Documentation

◆ ApplyConfigs()

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::ApplyConfigs ( int  numRetries = kDefaultConfigRetries)

Apply the mechanism configs to the devices.

This should be called after applying all other configs to the devices.

If the user does not call this function by the time SetControl is called, SetControl will apply the configs once.

Parameters
numRetriesNumber of retries when applying the configs
Returns
Status Code of the config applies.

◆ ClearUserRequirement()

void ctre::phoenix6::mechanisms::DifferentialMechanism::ClearUserRequirement ( )

Indicate to the mechanism that the user has performed the required action to resume mechanism control.

◆ GetDifferentialFollower() [1/2]

hardware::TalonFX & ctre::phoenix6::mechanisms::DifferentialMechanism::GetDifferentialFollower ( )
inline

Get the Talon FX that is differential follower.

The differential follower's position and velocity are used by the differential leader for the differential controller.

Returns
Differential follower Talon FX

◆ GetDifferentialFollower() [2/2]

hardware::TalonFX const & ctre::phoenix6::mechanisms::DifferentialMechanism::GetDifferentialFollower ( ) const
inline

Get the Talon FX that is differential follower.

The differential follower's position and velocity are used by the differential leader for the differential controller.

Returns
Differential follower Talon FX

◆ GetDifferentialLeader() [1/2]

hardware::TalonFX & ctre::phoenix6::mechanisms::DifferentialMechanism::GetDifferentialLeader ( )
inline

Get the Talon FX that is differential leader.

The differential leader calculates the output for the differential follower. The differential leader is also used for fault detection, and it reports status signals for the differential controller.

Returns
Differential leader Talon FX

◆ GetDifferentialLeader() [2/2]

hardware::TalonFX const & ctre::phoenix6::mechanisms::DifferentialMechanism::GetDifferentialLeader ( ) const
inline

Get the Talon FX that is differential leader.

The differential leader calculates the output for the differential follower. The differential leader is also useful for fault detection, and it reports status signals for the differential controller.

Returns
Differential leader Talon FX

◆ GetDisabledReason()

DisabledReason ctre::phoenix6::mechanisms::DifferentialMechanism::GetDisabledReason ( ) const
inline
Returns
The reason for the mechanism being disabled

◆ GetMechanismState()

MechanismState ctre::phoenix6::mechanisms::DifferentialMechanism::GetMechanismState ( ) const
inline

Gets the state of the mechanism.

Returns
MechanismState representing the state of the mechanism

◆ GetRequiresUserReason()

RequiresUserReason ctre::phoenix6::mechanisms::DifferentialMechanism::GetRequiresUserReason ( ) const
inline
Returns
The reason for the mechanism requiring user action to resume control

◆ IsDisabled()

bool ctre::phoenix6::mechanisms::DifferentialMechanism::IsDisabled ( ) const
inline

Get whether the mechanism is currently disabled due to an issue.

Returns
true if the mechanism is temporarily disabled

◆ Periodic()

void ctre::phoenix6::mechanisms::DifferentialMechanism::Periodic ( )

Call this method periodically to keep the mechanism state updated.

◆ RequiresUserAction()

bool ctre::phoenix6::mechanisms::DifferentialMechanism::RequiresUserAction ( ) const
inline

Get whether the mechanism is currently disabled and requires user action to re-enable mechanism control.

Returns
true if the mechanism is disabled and the user must manually perform an action

◆ SetCoastOut()

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetCoastOut ( )

Request coast neutral output of mechanism.

The bridge is disabled and the rotor is allowed to coast.

Returns
Status Code of the request.

◆ SetControl() [1/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::DutyCycleOut  AverageRequest,
controls::PositionDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage DutyCycleOut request of the mechanism.
DifferentialRequestDifferential PositionDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [2/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::DutyCycleOut  AverageRequest,
controls::VelocityDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage DutyCycleOut request of the mechanism.
DifferentialRequestDifferential VelocityDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [3/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicDutyCycle  AverageRequest,
controls::PositionDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicDutyCycle request of the mechanism.
DifferentialRequestDifferential PositionDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [4/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicDutyCycle  AverageRequest,
controls::VelocityDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicDutyCycle request of the mechanism.
DifferentialRequestDifferential VelocityDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [5/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicTorqueCurrentFOC  AverageRequest,
controls::PositionTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential PositionTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [6/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicTorqueCurrentFOC  AverageRequest,
controls::VelocityTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential VelocityTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [7/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicVoltage  AverageRequest,
controls::PositionVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVoltage request of the mechanism.
DifferentialRequestDifferential PositionVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [8/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::MotionMagicVoltage  AverageRequest,
controls::VelocityVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVoltage request of the mechanism.
DifferentialRequestDifferential VelocityVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [9/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionDutyCycle  AverageRequest,
controls::PositionDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionDutyCycle request of the mechanism.
DifferentialRequestDifferential PositionDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [10/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionDutyCycle  AverageRequest,
controls::VelocityDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionDutyCycle request of the mechanism.
DifferentialRequestDifferential VelocityDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [11/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionTorqueCurrentFOC  AverageRequest,
controls::PositionTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential PositionTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [12/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionTorqueCurrentFOC  AverageRequest,
controls::VelocityTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential VelocityTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [13/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionVoltage  AverageRequest,
controls::PositionVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionVoltage request of the mechanism.
DifferentialRequestDifferential PositionVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [14/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::PositionVoltage  AverageRequest,
controls::VelocityVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionVoltage request of the mechanism.
DifferentialRequestDifferential VelocityVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [15/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::TorqueCurrentFOC  AverageRequest,
controls::PositionTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage TorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential PositionTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [16/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::TorqueCurrentFOC  AverageRequest,
controls::VelocityTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage TorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential VelocityTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [17/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityDutyCycle  AverageRequest,
controls::PositionDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityDutyCYcle request of the mechanism.
DifferentialRequestDifferential PositionDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [18/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityDutyCycle  AverageRequest,
controls::VelocityDutyCycle  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityDutyCycle request of the mechanism.
DifferentialRequestDifferential VelocityDutyCycle request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [19/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityTorqueCurrentFOC  AverageRequest,
controls::PositionTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential PositionTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [20/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityTorqueCurrentFOC  AverageRequest,
controls::VelocityTorqueCurrentFOC  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential VelocityTorqueCurrentFOC request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [21/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityVoltage  AverageRequest,
controls::PositionVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityVoltage request of the mechanism.
DifferentialRequestDifferential PositionVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [22/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VelocityVoltage  AverageRequest,
controls::VelocityVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityVoltage request of the mechanism.
DifferentialRequestDifferential VelocityVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [23/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VoltageOut  AverageRequest,
controls::PositionVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VoltageOut request of the mechanism.
DifferentialRequestDifferential PositionVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetControl() [24/24]

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetControl ( controls::VoltageOut  AverageRequest,
controls::VelocityVoltage  DifferentialRequest 
)

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VoltageOut request of the mechanism.
DifferentialRequestDifferential VelocityVoltage request of the mechanism. Note: The UpdateFreqHz parameter for this control request will be ignored by the control frame.
Returns
Status Code of the request.

◆ SetNeutralOut()

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetNeutralOut ( )

Request neutral output of mechanism.

The applied brake type is determined by the NeutralMode configuration of each device.

Since the NeutralMode configuration of devices may not align, users may prefer to use the SetCoastOut() or SetStaticBrake() method.

Returns
Status Code of the request.

◆ SetStaticBrake()

ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism::SetStaticBrake ( )

Applies full neutral-brake on the mechanism by shorting motor leads together.

Returns
Status Code of the request.

Member Data Documentation

◆ kDefaultConfigRetries

constexpr int ctre::phoenix6::mechanisms::DifferentialMechanism::kDefaultConfigRetries = 5
staticconstexpr

The default number of retries for config applies.


The documentation for this class was generated from the following file: