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

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

#include <ctre/phoenix6/mechanisms/SimpleDifferentialMechanism.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

 SimpleDifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants)
 Creates a new simple differential mechanism using two hardware::traits::CommonTalon devices.
 
 SimpleDifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::Pigeon2 &pigeon2, DifferentialPigeon2Source pigeonSource)
 Creates a new simple differential mechanism using two hardware::traits::CommonTalon devices and a hardware::Pigeon2.
 
 SimpleDifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::CANcoder &cancoder)
 Creates a new simple differential mechanism using two hardware::traits::CommonTalon devices and a hardware::CANcoder.
 
 SimpleDifferentialMechanism (DifferentialMotorConstants< typename MotorT::Configuration > const &constants, hardware::CANdi &candi, DifferentialCANdiSource candiSource)
 Creates a new simple 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::DifferentialDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialPositionDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialPositionVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialVelocityDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialVelocityVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicExpoDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicExpoVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicVelocityDutyCycle const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 
ctre::phoenix::StatusCode SetControl (controls::DifferentialMotionMagicVelocityVoltage const &diffLeaderFXRequest)
 Sets the control request for this mechanism.
 

Detailed Description

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

Manages control of a simple two-axis differential mechanism.

This mechanism provides limited differential functionality. Pro users on a CAN FD bus can use the DifferentialMechanism instead for full 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

◆ SimpleDifferentialMechanism() [1/4]

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

Creates a new simple 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 provides limited differential functionality. Pro users on a CAN FD bus can use the DifferentialMechanism class instead for full functionality.

Parameters
constantsConstants used to construct the mechanism

◆ SimpleDifferentialMechanism() [2/4]

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

Creates a new simple 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 provides limited differential functionality. Pro users on a CAN FD bus can use the DifferentialMechanism class instead for full 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)

◆ SimpleDifferentialMechanism() [3/4]

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

Creates a new simple 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 provides limited differential functionality. Pro users on a CAN FD bus can use the DifferentialMechanism class instead for full functionality.

Parameters
constantsConstants used to construct the mechanism
cancoderThe CANcoder to use for the differential axis

◆ SimpleDifferentialMechanism() [4/4]

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

Creates a new simple 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 provides limited differential functionality. Pro users on a CAN FD bus can use the DifferentialMechanism class instead for full 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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::SimpleDifferentialMechanism< 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()

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

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::SimpleDifferentialMechanism< MotorT >::SetControl ( controls::DifferentialDutyCycle const & diffLeaderFXRequest)

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest a specified motor duty cycle with a differential position closed-loop.
Returns
Status Code of the request.

◆ SetControl() [2/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final position using a motion profile, and PID to a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [3/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final position using an exponential motion profile, and PID to a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [4/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final position using an exponential motion profile, and PID to a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [5/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final velocity using a motion profile, and PID to a differential position setpoint. This allows smooth transitions between velocity set points.
Returns
Status Code of the request.

◆ SetControl() [6/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final velocity using a motion profile, and PID to a differential position setpoint. This allows smooth transitions between velocity set points.
Returns
Status Code of the request.

◆ SetControl() [7/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequests Motion Magic® to target a final position using a motion profile, and PID to a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [8/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest PID to target position with a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [9/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest PID to target position with a differential position setpoint
Returns
Status Code of the request.

◆ SetControl() [10/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest PID to target velocity with a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [11/12]

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest PID to target velocity with a differential position setpoint.
Returns
Status Code of the request.

◆ SetControl() [12/12]

template<std::derived_from< hardware::traits::CommonTalon > MotorT>
ctre::phoenix::StatusCode ctre::phoenix6::mechanisms::SimpleDifferentialMechanism< MotorT >::SetControl ( controls::DifferentialVoltage const & diffLeaderFXRequest)

Sets the control request for this mechanism.

Parameters
diffLeaderFXRequestRequest a specified voltage with a differential position closed-loop.
Returns
Status Code of the request.

◆ 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::SimpleDifferentialMechanism< 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()

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: