31 double T,
const Bias& estimatedBias,
bool corrupted)
const {
35 const double dt = imuSampleTime();
36 const size_t nrSteps = T /
dt;
38 for (
size_t k = 0; k < nrSteps; k++, t +=
dt) {
40 corrupted ? measuredAngularVelocity(t) : actualAngularVelocity(t);
42 corrupted ? measuredSpecificForce(t) : actualSpecificForce(t);
50 const Bias& estimatedBias)
const {
51 const NavState state_i(scenario_.pose(0), scenario_.velocity_n(0));
52 return pim.
predict(state_i, estimatedBias);
55 Matrix9 ScenarioRunner::estimateCovariance(
double T,
size_t N,
56 const Bias& estimatedBias)
const {
57 gttic_(estimateCovariance);
60 NavState prediction = predict(integrate(T));
64 Vector9 sum = Vector9::Zero();
65 for (
size_t i = 0;
i <
N;
i++) {
66 auto pim = integrate(T, estimatedBias,
true);
74 Vector9 sampleMean = sum /
N;
77 for (
size_t i = 0;
i <
N;
i++) {
78 Vector9
xi = samples.col(
i) - sampleMean;
79 Q += xi * xi.transpose();
85 Matrix6 ScenarioRunner::estimateNoiseCovariance(
size_t N)
const {
87 Vector6 sum = Vector6::Zero();
88 for (
size_t i = 0;
i <
N;
i++) {
89 samples.col(
i) << accSampler_.sample() / sqrt_dt_,
90 gyroSampler_.sample() / sqrt_dt_;
91 sum += samples.col(
i);
95 Vector6 sampleMean = sum /
N;
98 for (
size_t i = 0;
i <
N;
i++) {
99 Vector6
xi = samples.col(
i) - sampleMean;
100 Q += xi * xi.transpose();
107 double T,
const Bias& estimatedBias,
bool corrupted)
const {
111 const double dt = imuSampleTime();
112 const size_t nrSteps = T /
dt;
114 for (
size_t k = 0; k < nrSteps; k++, t +=
dt) {
116 corrupted ? measuredAngularVelocity(t) : actualAngularVelocity(t);
118 corrupted ? measuredSpecificForce(t) : actualSpecificForce(t);
127 const Bias& estimatedBias)
const {
129 return pim.
predict(state_i, estimatedBias);
133 double T,
size_t N,
const Bias& estimatedBias)
const {
134 gttic_(estimateCovariance);
137 NavState prediction = predict(integrate(T));
141 Vector15 sum = Vector15::Zero();
142 for (
size_t i = 0;
i <
N;
i++) {
143 auto pim = integrate(T, estimatedBias,
true);
145 Vector15
xi = Vector15::Zero();
147 (estimatedBias_.vector() - estimatedBias.
vector());
153 Vector15 sampleMean = sum /
N;
156 for (
size_t i = 0;
i <
N;
i++) {
157 Vector15
xi = samples.col(
i) - sampleMean;
158 Q += xi * xi.transpose();
void integrateMeasurement(const Vector3 &measuredAcc, const Vector3 &measuredOmega, const double dt) override
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
void integrateMeasurement(const Vector3 &measuredAcc, const Vector3 &measuredOmega, const double dt) override
static double intNoiseVar
static const Matrix3 kIntegrationErrorCovariance
static const Vector3 measuredAcc
ConstantTwistScenario scenario(Z_3x1, Vector3(v, 0, 0))
static const Vector3 measuredOmega(w, 0, 0)
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
NavState predict(const NavState &state_i, const imuBias::ConstantBias &bias_i, OptionalJacobian< 9, 9 > H1={}, OptionalJacobian< 9, 6 > H2={}) const
Predict state at time j.
Simple class to test navigation scenarios.
Vector9 localCoordinates(const NavState &g, OptionalJacobian< 9, 9 > H1={}, OptionalJacobian< 9, 9 > H2={}) const
localCoordinates with optional derivatives
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set samples