60 for (
size_t t = 1; t <= States; ++t) {
61 q[t - 1] = m_alpha * std::sqrt(
static_cast<double>(t * (States + 1)) /
62 static_cast<double>(t + 1));
67 for (
int col = 1; col <
NumSigmas; ++col) {
68 for (
int row = 0; row < States; ++row) {
71 }
else if (row == col - 2) {
74 C(row, col) = -q[row] / (row + 1);
80 for (
int col = 0; col <
NumSigmas; ++col) {
81 sigmas.col(col) = x +
S * C.col(col);
97 double Wm(
int i)
const {
return m_Wm(i, 0); }
109 double Wc(
int i)
const {
return m_Wc(i, 0); }
121 void ComputeWeights(
double beta) {
122 double alpha_sq = m_alpha * m_alpha;
124 double c = 1.0 / (alpha_sq * (States + 1));
128 m_Wm(0) = 1.0 - 1.0 / alpha_sq;
129 m_Wc(0) = 1.0 - 1.0 / alpha_sq + (1 - alpha_sq + beta);
#define S(label, offset, message)
Definition Errors.hpp:113
double Wm(int i) const
Returns an element of the weight for each sigma point for the mean.
Definition S3SigmaPoints.hpp:97
S3SigmaPoints(double alpha=1e-3, double beta=2)
Constructs a generator for Papakonstantinou sigma points.
Definition S3SigmaPoints.hpp:40
Matrixd< States, NumSigmas > SquareRootSigmaPoints(const Vectord< States > &x, const Matrixd< States, States > &S) const
Computes the sigma points for an unscented Kalman filter given the mean (x) and square-root covarianc...
Definition S3SigmaPoints.hpp:56
double Wc(int i) const
Returns an element of the weight for each sigma point for the covariance.
Definition S3SigmaPoints.hpp:109
static constexpr int NumSigmas
Definition S3SigmaPoints.hpp:30
const Vectord< NumSigmas > & Wm() const
Returns the weight for each sigma point for the mean.
Definition S3SigmaPoints.hpp:90
const Vectord< NumSigmas > & Wc() const
Returns the weight for each sigma point for the covariance.
Definition S3SigmaPoints.hpp:102
This class is a wrapper around std::array that does compile time size checking.
Definition array.hpp:26
Definition LinearSystem.hpp:20
Eigen::Matrix< double, Rows, Cols, Options, MaxRows, MaxCols > Matrixd
Definition EigenCore.hpp:21
Eigen::Vector< double, Size > Vectord
Definition EigenCore.hpp:12
constexpr empty_array_t empty_array
Definition array.hpp:16