Performs swerve module updates in a separate thread to minimize latency.
More...
#include <ctre/phoenix6/swerve/impl/SwerveDrivetrainImpl.hpp>
Performs swerve module updates in a separate thread to minimize latency.
◆ OdometryThread()
ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::OdometryThread |
( |
SwerveDrivetrainImpl & | drivetrain | ) |
|
◆ ~OdometryThread()
ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::~OdometryThread |
( |
| ) |
|
|
inline |
◆ IsOdometryValid()
bool ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::IsOdometryValid |
( |
| ) |
const |
|
inline |
Check if the odometry is currently valid.
- Returns
- True if odometry is valid
◆ Run()
void ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::Run |
( |
| ) |
|
|
protected |
◆ SetThreadPriority()
void ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::SetThreadPriority |
( |
int | priority | ) |
|
|
inline |
Sets the odometry thread priority to a real time priority under the specified priority level.
- Parameters
-
priority | Priority level to set the odometry thread to. This is a value between 0 and 99, with 99 indicating higher priority and 0 indicating lower priority. |
◆ Start()
void ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::Start |
( |
| ) |
|
|
inline |
Starts the odometry thread.
◆ Stop()
void ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::Stop |
( |
| ) |
|
|
inline |
Stops the odometry thread.
◆ _allSignals
std::vector<BaseStatusSignal *> ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_allSignals |
|
protected |
◆ _averageLoopTime
units::second_t ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_averageLoopTime {} |
|
protected |
◆ _drivetrain
SwerveDrivetrainImpl* ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_drivetrain |
|
protected |
◆ _failedDaqs
std::atomic<int32_t> ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_failedDaqs {} |
|
protected |
◆ _isRunning
std::atomic<bool> ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_isRunning = false |
|
protected |
◆ _lastThreadPriority
int ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_lastThreadPriority = START_THREAD_PRIORITY |
|
protected |
◆ _lastTime
units::second_t ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_lastTime {} |
|
protected |
◆ _lastTimeValid
bool ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_lastTimeValid = false |
|
protected |
◆ _lowPass
◆ _successfulDaqs
std::atomic<int32_t> ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_successfulDaqs {} |
|
protected |
◆ _thread
std::thread ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_thread |
|
protected |
◆ _threadMtx
std::mutex ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_threadMtx |
|
protected |
◆ _threadPriorityToSet
std::atomic<int> ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::_threadPriorityToSet = START_THREAD_PRIORITY |
|
protected |
◆ kLowPassTaps
int ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::kLowPassTaps = 50 |
|
staticconstexprprotected |
◆ START_THREAD_PRIORITY
int ctre::phoenix6::swerve::impl::SwerveDrivetrainImpl::OdometryThread::START_THREAD_PRIORITY = 1 |
|
staticconstexprprotected |
The documentation for this class was generated from the following file: