62 for (
size_t t = 1; t <= States; ++t) {
63 q[t - 1] = m_alpha * std::sqrt(
static_cast<double>(t * (States + 1)) /
64 static_cast<double>(t + 1));
69 for (
int col = 1; col <
NumSigmas; ++col) {
70 for (
int row = 0; row < States; ++row) {
73 }
else if (row == col - 2) {
76 C(row, col) = -q[row] / (row + 1);
82 for (
int col = 0; col <
NumSigmas; ++col) {
83 sigmas.col(col) = x +
S * C.col(col);
99 double Wm(
int i)
const {
return m_Wm(i, 0); }
111 double Wc(
int i)
const {
return m_Wc(i, 0); }
123 void ComputeWeights(
double beta) {
124 double alpha_sq = m_alpha * m_alpha;
126 double c = 1.0 / (alpha_sq * (States + 1));
130 m_Wm(0) = 1.0 - 1.0 / alpha_sq;
131 m_Wc(0) = 1.0 - 1.0 / alpha_sq + (1 - alpha_sq + beta);
Generates sigma points and weights according to Papakonstantinou's paper[1] for the UnscentedKalmanFi...
Definition S3SigmaPoints.h:30
const Vectord< NumSigmas > & Wm() const
Returns the weight for each sigma point for the mean.
Definition S3SigmaPoints.h:92
double Wm(int i) const
Returns an element of the weight for each sigma point for the mean.
Definition S3SigmaPoints.h:99
const Vectord< NumSigmas > & Wc() const
Returns the weight for each sigma point for the covariance.
Definition S3SigmaPoints.h:104
static constexpr int NumSigmas
Definition S3SigmaPoints.h:32
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.h:58
double Wc(int i) const
Returns an element of the weight for each sigma point for the covariance.
Definition S3SigmaPoints.h:111
S3SigmaPoints(double alpha=1e-3, double beta=2)
Constructs a generator for Papakonstantinou sigma points.
Definition S3SigmaPoints.h:42
This class is a wrapper around std::array that does compile time size checking.
Definition array.h:26
Definition SystemServer.h:9
Eigen::Matrix< double, Rows, Cols, Options, MaxRows, MaxCols > Matrixd
Definition EigenCore.h:21
Eigen::Vector< double, Size > Vectord
Definition EigenCore.h:12
constexpr empty_array_t empty_array
Definition array.h:16
#define S(label, offset, message)
Definition Errors.h:113