CTRE Phoenix 6 C++ 25.2.1
Loading...
Searching...
No Matches
ctre::phoenix6::signals::SensorPhaseValue Class Reference

The relationship between the motor controlled by a Talon and the external sensor connected to the data port. More...

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

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

Public Member Functions

constexpr SensorPhaseValue (int value)
 
constexpr SensorPhaseValue ()
 
constexpr bool operator== (SensorPhaseValue data) const
 
constexpr bool operator== (int data) const
 
constexpr bool operator!= (SensorPhaseValue data) const
 
constexpr bool operator!= (int data) const
 
constexpr bool operator< (SensorPhaseValue data) const
 
constexpr bool operator< (int data) const
 
std::string ToString () const
 Gets the string representation of this enum.
 
std::string Serialize () const
 
- Public Member Functions inherited from ctre::phoenix6::ISerializable

Public Attributes

int value
 

Static Public Attributes

static constexpr int Aligned = 0
 The sensor direction is normally aligned with the motor.
 
static constexpr int Opposed = 1
 The sensor direction is normally opposed to the motor.
 

Friends

std::ostream & operator<< (std::ostream &os, SensorPhaseValue data)
 

Detailed Description

The relationship between the motor controlled by a Talon and the external sensor connected to the data port.

This does not affect the commutation sensor or remote sensors.

To determine the sensor phase, set this config to Aligned and drive the motor with positive output. If the reported sensor velocity is positive, then the phase is Aligned. If the reported sensor velocity is negative, then the phase is Opposed.

The sensor direction is automatically inverted along with motor invert, so the sensor phase does not need to be changed when motor invert changes.

Constructor & Destructor Documentation

◆ SensorPhaseValue() [1/2]

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

◆ SensorPhaseValue() [2/2]

ctre::phoenix6::signals::SensorPhaseValue::SensorPhaseValue ( )
inlineconstexpr

Member Function Documentation

◆ operator!=() [1/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator!= ( int data) const
inlineconstexpr

◆ operator!=() [2/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator!= ( SensorPhaseValue data) const
inlineconstexpr

◆ operator<() [1/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator< ( int data) const
inlineconstexpr

◆ operator<() [2/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator< ( SensorPhaseValue data) const
inlineconstexpr

◆ operator==() [1/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator== ( int data) const
inlineconstexpr

◆ operator==() [2/2]

bool ctre::phoenix6::signals::SensorPhaseValue::operator== ( SensorPhaseValue data) const
inlineconstexpr

◆ Serialize()

std::string ctre::phoenix6::signals::SensorPhaseValue::Serialize ( ) const
inlinevirtual

◆ ToString()

std::string ctre::phoenix6::signals::SensorPhaseValue::ToString ( ) const
inline

Gets the string representation of this enum.

Returns
String representation of this enum

Friends And Related Symbol Documentation

◆ operator<<

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

Member Data Documentation

◆ Aligned

int ctre::phoenix6::signals::SensorPhaseValue::Aligned = 0
staticconstexpr

The sensor direction is normally aligned with the motor.

◆ Opposed

int ctre::phoenix6::signals::SensorPhaseValue::Opposed = 1
staticconstexpr

The sensor direction is normally opposed to the motor.

◆ value

int ctre::phoenix6::signals::SensorPhaseValue::value

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