WPILibC++ 2024.3.2
StateSpaceUtil.h File Reference
#include <array>
#include <cmath>
#include <concepts>
#include <limits>
#include <random>
#include <Eigen/Eigenvalues>
#include <Eigen/QR>
#include <wpi/Algorithm.h>
#include <wpi/SymbolExports.h>
#include "frc/EigenCore.h"
#include "frc/geometry/Pose2d.h"

Go to the source code of this file.

Namespaces

namespace  frc
 

Functions

template<std::same_as< double >... Ts>
Matrixd< sizeof...(Ts), sizeof...(Ts)> frc::MakeCostMatrix (Ts... tolerances)
 Creates a cost matrix from the given vector for use with LQR. More...
 
template<std::same_as< double >... Ts>
Matrixd< sizeof...(Ts), sizeof...(Ts)> frc::MakeCovMatrix (Ts... stdDevs)
 Creates a covariance matrix from the given vector for use with Kalman filters. More...
 
template<size_t N>
Matrixd< N, N > frc::MakeCostMatrix (const std::array< double, N > &costs)
 Creates a cost matrix from the given vector for use with LQR. More...
 
template<size_t N>
Matrixd< N, N > frc::MakeCovMatrix (const std::array< double, N > &stdDevs)
 Creates a covariance matrix from the given vector for use with Kalman filters. More...
 
template<std::same_as< double >... Ts>
Vectord< sizeof...(Ts)> frc::MakeWhiteNoiseVector (Ts... stdDevs)
 
template<int N>
Vectord< N > frc::MakeWhiteNoiseVector (const std::array< double, N > &stdDevs)
 Creates a vector of normally distributed white noise with the given noise intensities for each element. More...
 
WPILIB_DLLEXPORT Eigen::Vector3d frc::PoseTo3dVector (const Pose2d &pose)
 Converts a Pose2d into a vector of [x, y, theta]. More...
 
WPILIB_DLLEXPORT Eigen::Vector4d frc::PoseTo4dVector (const Pose2d &pose)
 Converts a Pose2d into a vector of [x, y, std::cos(theta), std::sin(theta)]. More...
 
template<int States, int Inputs>
bool frc::IsStabilizable (const Matrixd< States, States > &A, const Matrixd< States, Inputs > &B)
 Returns true if (A, B) is a stabilizable pair. More...
 
template WPILIB_DLLEXPORT bool frc::IsStabilizable< 1, 1 > (const Matrixd< 1, 1 > &A, const Matrixd< 1, 1 > &B)
 
template WPILIB_DLLEXPORT bool frc::IsStabilizable< 2, 1 > (const Matrixd< 2, 2 > &A, const Matrixd< 2, 1 > &B)
 
template WPILIB_DLLEXPORT bool frc::IsStabilizable< Eigen::Dynamic, Eigen::Dynamic > (const Eigen::MatrixXd &A, const Eigen::MatrixXd &B)
 
template<int States, int Outputs>
bool frc::IsDetectable (const Matrixd< States, States > &A, const Matrixd< Outputs, States > &C)
 Returns true if (A, C) is a detectable pair. More...
 
WPILIB_DLLEXPORT Eigen::Vector3d frc::PoseToVector (const Pose2d &pose)
 Converts a Pose2d into a vector of [x, y, theta]. More...
 
template<int Inputs>
Vectord< Inputs > frc::ClampInputMaxMagnitude (const Vectord< Inputs > &u, const Vectord< Inputs > &umin, const Vectord< Inputs > &umax)
 Clamps input vector between system's minimum and maximum allowable input. More...
 
template<int Inputs>
Vectord< Inputs > frc::DesaturateInputVector (const Vectord< Inputs > &u, double maxMagnitude)
 Renormalize all inputs if any exceeds the maximum magnitude. More...