CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT > Class Template Reference

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

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

Public Types

enum class  DisabledReasonValue {
  None , MissingRemoteSensor , MissingDifferentialFX , RemoteSensorPosOverflow ,
  DeviceHasReset
}
 Possible reasons for the mechanism to disable. More...
 
enum class  RequiresUserReasonValue { None , RemoteSensorPosOverflow , DeviceHasReset }
 Possible reasons for the mechanism to require user action to resume control. More...
 

Public Member Functions

 DifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants)
 Creates a new differential mechanism using two hardware::traits::CommonTalon devices.
 
 DifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::Pigeon2 &pigeon2, DifferentialPigeon2Source pigeonSource)
 Creates a new differential mechanism using two hardware::traits::CommonTalon devices and a hardware::Pigeon2.
 
 DifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::CANcoder &cancoder)
 Creates a new differential mechanism using two hardware::traits::CommonTalon devices and a hardware::CANcoder.
 
 DifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::CANdi &candi, DifferentialCANdiSource candiSource)
 Creates a new differential mechanism using two hardware::traits::CommonTalon devices and a hardware::CANdi.
 
ctre::phoenix::StatusCode ConfigNeutralMode (signals::NeutralModeValue neutralMode, units::second_t timeoutSeconds=100_ms)
 Configures the neutral mode to use for both motors in the mechanism.
 
void Periodic ()
 Call this method periodically to automatically protect against dangerous fault conditions and keep GetMechanismState() updated.
 
bool IsDisabled () const
 Get whether the mechanism is currently disabled due to an issue.
 
bool RequiresUserAction () const
 Get whether the mechanism is currently disabled and requires user action to re-enable mechanism control.
 
MechanismState GetMechanismState () const
 Gets the state of the mechanism.
 
void ClearUserRequirement ()
 Indicate to the mechanism that the user has performed the required action to resume mechanism control.
 
DisabledReasonValue GetDisabledReason () const
 
RequiresUserReasonValue GetRequiresUserReason () const
 
StatusSignal< units::turn_t > & GetAveragePosition (bool refresh=true)
 Average component of the mechanism position.
 
StatusSignal< units::turns_per_second_t > & GetAverageVelocity (bool refresh=true)
 Average component of the mechanism velocity.
 
StatusSignal< units::turn_t > & GetDifferentialPosition (bool refresh=true)
 Differential component of the mechanism position.
 
StatusSignal< units::turns_per_second_t > & GetDifferentialVelocity (bool refresh=true)
 Differential component of the mechanism velocity.
 
StatusSignal< double > & GetAverageClosedLoopReference (bool refresh=true)
 Value that the average closed loop is targeting.
 
StatusSignal< double > & GetAverageClosedLoopReferenceSlope (bool refresh=true)
 Derivative of the target that the average closed loop is targeting.
 
StatusSignal< double > & GetAverageClosedLoopError (bool refresh=true)
 The difference between target average reference and current measurement.
 
StatusSignal< double > & GetDifferentialClosedLoopReference (bool refresh=true)
 Value that the differential closed loop is targeting.
 
StatusSignal< double > & GetDifferentialClosedLoopReferenceSlope (bool refresh=true)
 Derivative of the target that the differential closed loop is targeting.
 
StatusSignal< double > & GetDifferentialClosedLoopError (bool refresh=true)
 The difference between target differential reference and current measurement.
 
ctre::phoenix::StatusCode SetPosition (units::turn_t avgPosition, units::turn_t diffPosition=0_tr, units::time::second_t timeoutSeconds=0.100_s)
 Sets the position of the mechanism in rotations.
 
MotorT & GetLeader ()
 Get the Talon FX that is differential leader.
 
MotorT const & GetLeader () const
 Get the Talon FX that is differential leader.
 
MotorT & GetFollower ()
 Get the Talon FX that is differential follower.
 
MotorT const & GetFollower () const
 Get the Talon FX that is differential follower.
 
ctre::phoenix::StatusCode SetNeutralOut ()
 Request neutral output of mechanism.
 
ctre::phoenix::StatusCode SetCoastOut ()
 Request coast neutral output of mechanism.
 
ctre::phoenix::StatusCode SetStaticBrake ()
 Applies full neutral-brake on the mechanism by shorting motor leads together.
 
ctre::phoenix::StatusCode SetControl (controls::DutyCycleOut AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityDutyCycle AverageRequest, controls::PositionDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DutyCycleOut AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityDutyCycle AverageRequest, controls::VelocityDutyCycle DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DutyCycleOut AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionDutyCycle AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityDutyCycle AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicDutyCycle AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoDutyCycle AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityDutyCycle AverageRequest, controls::DutyCycleOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VoltageOut AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityVoltage AverageRequest, controls::PositionVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VoltageOut AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityVoltage AverageRequest, controls::VelocityVoltage DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VoltageOut AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionVoltage AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityVoltage AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVoltage AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoVoltage AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityVoltage AverageRequest, controls::VoltageOut DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::TorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityTorqueCurrentFOC AverageRequest, controls::PositionTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::TorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityTorqueCurrentFOC AverageRequest, controls::VelocityTorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::TorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::PositionTorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::VelocityTorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicTorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicExpoTorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::MotionMagicVelocityTorqueCurrentFOC AverageRequest, controls::TorqueCurrentFOC DifferentialRequest)
 Sets the control request for this mechanism.
 

Detailed Description

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
class ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >

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.

A differential mechanism has two axes of motion, where the position along each axis is determined by two motors in separate gearboxes:

  • Driving both motors in a common direction causes the mechanism to move forward/reverse, up/down, etc.
    • This is the Average axis: position is determined by the average of the two motors' positions.
  • Driving the motors in opposing directions causes the mechanism to twist or rotate left/right.
    • This is the Difference axis: rotation is determined by half the difference of the two motors' positions.

Member Enumeration Documentation

◆ DisabledReasonValue

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.

◆ RequiresUserReasonValue

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/4]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::DifferentialMechanism ( DifferentialMotorConstants< typename MotorT::Configuration > const & constants)

Creates a new differential mechanism using two hardware::traits::CommonTalon devices.

The mechanism will use the average of the two Talon FX sensors on the primary axis, and half of 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
constantsConstants used to construct the mechanism

◆ DifferentialMechanism() [2/4]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::DifferentialMechanism ( DifferentialMotorConstants< typename MotorT::Configuration > const & constants,
hardware::Pigeon2 & pigeon2,
DifferentialPigeon2Source pigeonSource )

Creates a new differential mechanism using two hardware::traits::CommonTalon 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
constantsConstants used to construct the mechanism
pigeon2The Pigeon 2 to use for the differential axis
pigeonSourceThe sensor source to use for the Pigeon 2 (Yaw, Pitch, or Roll)

◆ DifferentialMechanism() [3/4]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::DifferentialMechanism ( DifferentialMotorConstants< typename MotorT::Configuration > const & constants,
hardware::CANcoder & cancoder )

Creates a new differential mechanism using two hardware::traits::CommonTalon 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
constantsConstants used to construct the mechanism
cancoderThe CANcoder to use for the differential axis

◆ DifferentialMechanism() [4/4]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::DifferentialMechanism ( DifferentialMotorConstants< typename MotorT::Configuration > const & constants,
hardware::CANdi & candi,
DifferentialCANdiSource candiSource )

Creates a new differential mechanism using two hardware::traits::CommonTalon devices and a hardware::CANdi.

The mechanism will use the average of the two Talon FX sensors on the primary axis, and the selected CTR Electronics' CANdiā„¢ branded 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
constantsConstants used to construct the mechanism
candiThe CTR Electronics' CANdiā„¢ branded device to use for the differential axis
candiSourceThe sensor source to use for the CTR Electronics' CANdiā„¢ branded device

Member Function Documentation

◆ ClearUserRequirement()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
void ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::ClearUserRequirement ( )

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

◆ ConfigNeutralMode()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::ConfigNeutralMode ( signals::NeutralModeValue neutralMode,
units::second_t timeoutSeconds = 100_ms )

Configures the neutral mode to use for both motors in the mechanism.

Parameters
neutralModeThe state of the motor controller bridge when output is neutral or disabled
timeoutSecondsMaximum amount of time to wait when performing each configuration
Returns
Status code of the first failed config call, or OK if all succeeded

◆ GetAverageClosedLoopError()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetAverageClosedLoopError ( bool refresh = true)
inline

The difference between target average reference and current measurement.

This is the value that is treated as the error in the PID loop.

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
ClosedLoopError Status Signal object

◆ GetAverageClosedLoopReference()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetAverageClosedLoopReference ( bool refresh = true)
inline

Value that the average closed loop is targeting.

This is the value that the closed loop PID controller targets.

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
ClosedLoopReference Status Signal object

◆ GetAverageClosedLoopReferenceSlope()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetAverageClosedLoopReferenceSlope ( bool refresh = true)
inline

Derivative of the target that the average closed loop is targeting.

This is the change in the closed loop reference. This may be used in the feed-forward calculation, the derivative-error, or in application of the signage for kS. Typically, this represents the target velocity during Motion MagicĀ®.

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
ClosedLoopReferenceSlope Status Signal object

◆ GetAveragePosition()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< units::turn_t > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetAveragePosition ( bool refresh = true)
inline

Average component of the mechanism position.

  • Minimum Value: -16384.0
  • Maximum Value: 16383.999755859375
  • Default Value: 0
  • Units: rotations

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialAveragePosition Status Signal Object

◆ GetAverageVelocity()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< units::turns_per_second_t > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetAverageVelocity ( bool refresh = true)
inline

Average component of the mechanism velocity.

  • Minimum Value: -512.0
  • Maximum Value: 511.998046875
  • Default Value: 0
  • Units: rotations per second

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialAverageVelocity Status Signal Object

◆ GetDifferentialClosedLoopError()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDifferentialClosedLoopError ( bool refresh = true)
inline

The difference between target differential reference and current measurement.

This is the value that is treated as the error in the differential PID loop (on the difference axis).

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialClosedLoopError Status Signal object

◆ GetDifferentialClosedLoopReference()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDifferentialClosedLoopReference ( bool refresh = true)
inline

Value that the differential closed loop is targeting.

This is the value that the differential closed loop PID controller targets (on the difference axis).

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialClosedLoopReference Status Signal object

◆ GetDifferentialClosedLoopReferenceSlope()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< double > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDifferentialClosedLoopReferenceSlope ( bool refresh = true)
inline

Derivative of the target that the differential closed loop is targeting.

This is the change in the closed loop reference (on the difference axis). This may be used in the feed-forward calculation, the derivative-error, or in application of the signage for kS. Typically, this represents the target velocity during Motion MagicĀ®.

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialClosedLoopReferenceSlope Status Signal object

◆ GetDifferentialPosition()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< units::turn_t > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDifferentialPosition ( bool refresh = true)
inline

Differential component of the mechanism position.

  • Minimum Value: -16384.0
  • Maximum Value: 16383.999755859375
  • Default Value: 0
  • Units: rotations

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialDifferencePosition Status Signal Object

◆ GetDifferentialVelocity()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
StatusSignal< units::turns_per_second_t > & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDifferentialVelocity ( bool refresh = true)
inline

Differential component of the mechanism velocity.

  • Minimum Value: -512.0
  • Maximum Value: 511.998046875
  • Default Value: 0
  • Units: rotations per second

This refreshes and returns a cached StatusSignal object.

Parameters
refreshWhether to refresh the StatusSignal before returning it; defaults to true
Returns
DifferentialDifferenceVelocity Status Signal Object

◆ GetDisabledReason()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
DisabledReasonValue ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetDisabledReason ( ) const
inline
Returns
The reason for the mechanism being disabled

◆ GetFollower() [1/2]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
MotorT & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetFollower ( )
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

◆ GetFollower() [2/2]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
MotorT const & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetFollower ( ) 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

◆ GetLeader() [1/2]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
MotorT & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetLeader ( )
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

◆ GetLeader() [2/2]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
MotorT const & ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetLeader ( ) 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

◆ GetMechanismState()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
MechanismState ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetMechanismState ( ) const
inline

Gets the state of the mechanism.

Returns
MechanismState representing the state of the mechanism

◆ GetRequiresUserReason()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
RequiresUserReasonValue ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::GetRequiresUserReason ( ) const
inline
Returns
The reason for the mechanism requiring user action to resume control

◆ IsDisabled()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
bool ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::IsDisabled ( ) const
inline

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

Returns
true if the mechanism is temporarily disabled

◆ Periodic()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
void ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::Periodic ( )

Call this method periodically to automatically protect against dangerous fault conditions and keep GetMechanismState() updated.

◆ RequiresUserAction()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
bool ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::DutyCycleOut AverageRequest,
controls::DutyCycleOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage DutyCycleOut request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [3/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [4/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicDutyCycle AverageRequest,
controls::DutyCycleOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicDutyCycle request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [6/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [7/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicExpoDutyCycle AverageRequest,
controls::DutyCycleOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoDutyCycle request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoDutyCycle 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() [9/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoDutyCycle 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() [10/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoTorqueCurrentFOC 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() [11/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoTorqueCurrentFOC 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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicExpoVoltage AverageRequest,
controls::PositionVoltage DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoVoltage 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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicExpoVoltage AverageRequest,
controls::VelocityVoltage DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoVoltage 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/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicExpoVoltage AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicExpoVoltage request of the mechanism.
DifferentialRequestDifferential VoltageOut 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/54]

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() [17/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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/54]

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() [19/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityDutyCycle request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityDutyCycle 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() [21/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityDutyCycle 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() [22/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityTorqueCurrentFOC 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() [23/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityTorqueCurrentFOC 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() [25/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityVoltage 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() [26/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityVoltage 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() [27/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicVelocityVoltage AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVelocityVoltage request of the mechanism.
DifferentialRequestDifferential VoltageOut 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() [28/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [29/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [30/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::MotionMagicVoltage AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage MotionMagicVoltage request of the mechanism.
DifferentialRequestDifferential VoltageOut 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() [31/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::PositionDutyCycle AverageRequest,
controls::DutyCycleOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionDutyCycle request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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() [32/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [33/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [34/54]

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() [35/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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() [36/54]

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() [37/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [38/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [39/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::PositionVoltage AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage PositionVoltage request of the mechanism.
DifferentialRequestDifferential VoltageOut 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() [40/54]

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() [41/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::TorqueCurrentFOC AverageRequest,
controls::TorqueCurrentFOC DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage TorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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() [42/54]

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() [43/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::VelocityDutyCycle AverageRequest,
controls::DutyCycleOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityDutyCYcle request of the mechanism.
DifferentialRequestDifferential DutyCycleOut 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() [44/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [45/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [46/54]

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() [47/54]

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityTorqueCurrentFOC request of the mechanism.
DifferentialRequestDifferential TorqueCurrentFOC 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() [48/54]

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() [49/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [50/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [51/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::VelocityVoltage AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VelocityVoltage request of the mechanism.
DifferentialRequestDifferential VoltageOut 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() [52/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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() [53/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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.

◆ SetControl() [54/54]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetControl ( controls::VoltageOut AverageRequest,
controls::VoltageOut DifferentialRequest )

Sets the control request for this mechanism.

Parameters
AverageRequestAverage VoltageOut request of the mechanism.
DifferentialRequestDifferential VoltageOut 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()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::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.

◆ SetPosition()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetPosition ( units::turn_t avgPosition,
units::turn_t diffPosition = 0_tr,
units::time::second_t timeoutSeconds = 0.100_s )
inline

Sets the position of the mechanism in rotations.

Parameters
avgPositionThe average position of the mechanism, in rotations
diffPositionThe differential position of the mechanism, in rotations
timeoutSecondsMaximum time to wait up to in seconds
Returns
StatusCode of the set command

◆ SetStaticBrake()

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::DifferentialMechanism< MotorT >::SetStaticBrake ( )

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

Returns
Status Code of the request.

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