CTRE Phoenix 6 C++ 26.3.0
Loading...
Searching...
No Matches
ctre::phoenix6::signals::FeedbackSensorSourceValue Struct Reference

Choose what sensor source is reported via API and used by closed-loop and limit features. More...

#include <ctre/phoenix6/signals/SpnEnums.hpp>

Inheritance diagram for ctre::phoenix6::signals::FeedbackSensorSourceValue:
ctre::phoenix6::ISerializable

Public Member Functions

constexpr FeedbackSensorSourceValue (int value)
 
constexpr FeedbackSensorSourceValue ()
 
constexpr bool operator== (FeedbackSensorSourceValue other) const
 
constexpr auto operator<=> (FeedbackSensorSourceValue other) const
 
constexpr std::string_view ToString () const
 Gets the string representation of this enum.
 
std::string Serialize () const override
 
- Public Member Functions inherited from ctre::phoenix6::ISerializable

Public Attributes

int value
 

Static Public Attributes

static constexpr int RotorSensor = 0
 Use the internal rotor sensor in the Talon.
 
static constexpr int RemoteCANcoder = 1
 Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemotePigeon2Yaw = 2
 Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemotePigeon2Pitch = 3
 Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemotePigeon2Roll = 4
 Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int FusedCANcoder = 5
 Requires Phoenix Pro; Talon will fuse another CANcoder's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int SyncCANcoder = 6
 Requires Phoenix Pro; Talon will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemoteCANdiPWM1 = 9
 Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemoteCANdiPWM2 = 10
 Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int RemoteCANdiQuadrature = 11
 Use a quadrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int FusedCANdiPWM1 = 12
 Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANdi™, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int FusedCANdiPWM2 = 13
 Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANdi™, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int FusedCANdiQuadrature = 14
 Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™.
 
static constexpr int SyncCANdiPWM1 = 15
 Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width encoder attached to Sensor Input 1 (S1IN), then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).
 
static constexpr int SyncCANdiPWM2 = 16
 Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width encoder attached to Sensor Input 1 (S1IN), then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).
 

Friends

CTREXPORT friend std::ostream & operator<< (std::ostream &os, FeedbackSensorSourceValue data)
 

Detailed Description

Choose what sensor source is reported via API and used by closed-loop and limit features.

The default is RotorSensor, which uses the internal rotor sensor in the Talon.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon internal rotor will not be used.

Choose Fused* (requires Phoenix Pro) and Talon will fuse another sensor's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). This was developed for applications such as swerve-azimuth.

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its internal rotor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Note: When the feedback source is changed to Fused* or Sync*, the Talon needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the remote sensor's Position signal.

Constructor & Destructor Documentation

◆ FeedbackSensorSourceValue() [1/2]

ctre::phoenix6::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( int value)
inlineconstexpr

◆ FeedbackSensorSourceValue() [2/2]

ctre::phoenix6::signals::FeedbackSensorSourceValue::FeedbackSensorSourceValue ( )
inlineconstexpr

Member Function Documentation

◆ operator<=>()

auto ctre::phoenix6::signals::FeedbackSensorSourceValue::operator<=> ( FeedbackSensorSourceValue other) const
inlineconstexpr

◆ operator==()

bool ctre::phoenix6::signals::FeedbackSensorSourceValue::operator== ( FeedbackSensorSourceValue other) const
inlineconstexpr

◆ Serialize()

std::string ctre::phoenix6::signals::FeedbackSensorSourceValue::Serialize ( ) const
inlineoverridevirtual

◆ ToString()

std::string_view ctre::phoenix6::signals::FeedbackSensorSourceValue::ToString ( ) const
inlineconstexpr

Gets the string representation of this enum.

Returns
String representation of this enum

Friends And Related Symbol Documentation

◆ operator<<

CTREXPORT friend std::ostream & operator<< ( std::ostream & os,
FeedbackSensorSourceValue data )
friend

Member Data Documentation

◆ FusedCANcoder

int ctre::phoenix6::signals::FeedbackSensorSourceValue::FusedCANcoder = 5
staticconstexpr

Requires Phoenix Pro; Talon will fuse another CANcoder's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).

FusedCANcoder was developed for applications such as swerve-azimuth.

◆ FusedCANdiPWM1

int ctre::phoenix6::signals::FeedbackSensorSourceValue::FusedCANdiPWM1 = 12
staticconstexpr

Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANdi™, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).

FusedCANdi was developed for applications such as swerve-azimuth.

◆ FusedCANdiPWM2

int ctre::phoenix6::signals::FeedbackSensorSourceValue::FusedCANdiPWM2 = 13
staticconstexpr

Requires Phoenix Pro; Talon will fuse a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANdi™, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID).

FusedCANdi was developed for applications such as swerve-azimuth.

◆ FusedCANdiQuadrature

int ctre::phoenix6::signals::FeedbackSensorSourceValue::FusedCANdiQuadrature = 14
staticconstexpr

Requires Phoenix Pro; Talon will fuse a qaudrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™.

This provides velocity and relative position measurements. This also requires setting FeedbackRemoteSensorID.

◆ RemoteCANcoder

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemoteCANcoder = 1
staticconstexpr

Use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID).

Talon will update its position and velocity whenever CANcoder publishes its information on CAN bus, and the Talon internal rotor will not be used.

◆ RemoteCANdiPWM1

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemoteCANdiPWM1 = 9
staticconstexpr

Use a pulse-width encoder remotely attached to the Sensor Input 1 (S1IN) on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).

Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon internal rotor will not be used.

◆ RemoteCANdiPWM2

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemoteCANdiPWM2 = 10
staticconstexpr

Use a pulse-width encoder remotely attached to the Sensor Input 2 (S2IN) on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).

Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon internal rotor will not be used.

◆ RemoteCANdiQuadrature

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemoteCANdiQuadrature = 11
staticconstexpr

Use a quadrature encoder remotely attached to the two Sensor Inputs on the CTR Electronics' CANdi™ (this also requires setting FeedbackRemoteSensorID).

Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon internal rotor will not be used.

◆ RemotePigeon2Pitch

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2Pitch = 3
staticconstexpr

Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).

Talon will update its position to match the Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

◆ RemotePigeon2Roll

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2Roll = 4
staticconstexpr

Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).

Talon will update its position to match the Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

◆ RemotePigeon2Yaw

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RemotePigeon2Yaw = 2
staticconstexpr

Use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID).

Talon will update its position to match the Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

◆ RotorSensor

int ctre::phoenix6::signals::FeedbackSensorSourceValue::RotorSensor = 0
staticconstexpr

Use the internal rotor sensor in the Talon.

◆ SyncCANcoder

int ctre::phoenix6::signals::FeedbackSensorSourceValue::SyncCANcoder = 6
staticconstexpr

Requires Phoenix Pro; Talon will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).

The Talon will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

◆ SyncCANdiPWM1

int ctre::phoenix6::signals::FeedbackSensorSourceValue::SyncCANdiPWM1 = 15
staticconstexpr

Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width encoder attached to Sensor Input 1 (S1IN), then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).

The Talon will report if its internal position differs significantly from the reported PWM position. SyncCANdi was developed for mechanisms where there is a risk of the CTR Electronics' CANdi™ failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

◆ SyncCANdiPWM2

int ctre::phoenix6::signals::FeedbackSensorSourceValue::SyncCANdiPWM2 = 16
staticconstexpr

Requires Phoenix Pro; Talon will synchronize its internal rotor position against the pulse-width encoder attached to Sensor Input 1 (S1IN), then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID).

The Talon will report if its internal position differs significantly from the reported PWM position. SyncCANdi was developed for mechanisms where there is a risk of the CTR Electronics' CANdi™ failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

◆ value

int ctre::phoenix6::signals::FeedbackSensorSourceValue::value

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