WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
frc::detail Namespace Reference

Classes

class  ListenerExecutor
 An executor for running listener tasks posted by Sendable listeners synchronously from the main application thread. More...
 

Functions

constexpr ct_matrix3d RotationVectorToMatrix (const ct_vector3d &rotation)
 Applies the hat operator to a rotation vector.
 
constexpr Eigen::Matrix3d RotationVectorToMatrix (const Eigen::Vector3d &rotation)
 Applies the hat operator to a rotation vector.
 
template<int States, int Inputs>
Eigen::Matrix< double, States, States > DARE (const Eigen::Matrix< double, States, States > &A, const Eigen::Matrix< double, States, Inputs > &B, const Eigen::Matrix< double, States, States > &Q, const Eigen::LLT< Eigen::Matrix< double, Inputs, Inputs > > &R_llt)
 Computes the unique stabilizing solution X to the discrete-time algebraic Riccati equation:
 
WPILIB_DLLEXPORT int IncrementAndGetProfiledPIDControllerInstances ()
 

Function Documentation

◆ DARE()

template<int States, int Inputs>
Eigen::Matrix< double, States, States > frc::detail::DARE ( const Eigen::Matrix< double, States, States > & A,
const Eigen::Matrix< double, States, Inputs > & B,
const Eigen::Matrix< double, States, States > & Q,
const Eigen::LLT< Eigen::Matrix< double, Inputs, Inputs > > & R_llt )

Computes the unique stabilizing solution X to the discrete-time algebraic Riccati equation:

AᵀXA − X − AᵀXB(BᵀXB + R)⁻¹BᵀXA + Q = 0

This internal function skips expensive precondition checks for increased performance. The solver may hang if any of the following occur:

  • Q isn't symmetric positive semidefinite
  • R isn't symmetric positive definite
  • The (A, B) pair isn't stabilizable
  • The (A, C) pair where Q = CᵀC isn't detectable

Only use this function if you're sure the preconditions are met.

Template Parameters
StatesNumber of states.
InputsNumber of inputs.
Parameters
AThe system matrix.
BThe input matrix.
QThe state cost matrix.
R_lltThe LLT decomposition of the input cost matrix.
Returns
Solution to the DARE.

◆ IncrementAndGetProfiledPIDControllerInstances()

WPILIB_DLLEXPORT int frc::detail::IncrementAndGetProfiledPIDControllerInstances ( )

◆ RotationVectorToMatrix() [1/2]

ct_matrix3d frc::detail::RotationVectorToMatrix ( const ct_vector3d & rotation)
constexpr

Applies the hat operator to a rotation vector.

It takes a rotation vector and returns the corresponding matrix representation of the Lie algebra element (a 3x3 rotation matrix).

Parameters
rotationThe rotation vector.
Returns
The rotation vector as a 3x3 rotation matrix.

◆ RotationVectorToMatrix() [2/2]

Eigen::Matrix3d frc::detail::RotationVectorToMatrix ( const Eigen::Vector3d & rotation)
constexpr

Applies the hat operator to a rotation vector.

It takes a rotation vector and returns the corresponding matrix representation of the Lie algebra element (a 3x3 rotation matrix).

Parameters
rotationThe rotation vector.
Returns
The rotation vector as a 3x3 rotation matrix.