CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
ctre::phoenix6::signals::SensorPhaseValue Struct 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 other) const
 
constexpr auto operator<=> (SensorPhaseValue 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 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

CTREXPORT friend 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<=>()

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

◆ operator==()

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

◆ Serialize()

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

◆ ToString()

std::string_view ctre::phoenix6::signals::SensorPhaseValue::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,
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 struct was generated from the following file: