21 #include <boost/assign.hpp> 33 double T,
const Bias& estimatedBias,
bool corrupted)
const {
37 const double dt = imuSampleTime();
38 const size_t nrSteps = T /
dt;
40 for (
size_t k = 0; k < nrSteps; k++, t +=
dt) {
42 corrupted ? measuredAngularVelocity(t) : actualAngularVelocity(t);
44 corrupted ? measuredSpecificForce(t) : actualSpecificForce(t);
52 const Bias& estimatedBias)
const {
53 const NavState state_i(scenario_.pose(0), scenario_.velocity_n(0));
54 return pim.
predict(state_i, estimatedBias);
57 Matrix9 ScenarioRunner::estimateCovariance(
double T,
size_t N,
58 const Bias& estimatedBias)
const {
59 gttic_(estimateCovariance);
62 NavState prediction = predict(integrate(T));
66 Vector9
sum = Vector9::Zero();
67 for (
size_t i = 0;
i <
N;
i++) {
68 auto pim = integrate(T, estimatedBias,
true);
76 Vector9 sampleMean = sum /
N;
79 for (
size_t i = 0;
i <
N;
i++) {
80 Vector9
xi = samples.col(
i) - sampleMean;
81 Q += xi * xi.transpose();
87 Matrix6 ScenarioRunner::estimateNoiseCovariance(
size_t N)
const {
89 Vector6
sum = Vector6::Zero();
90 for (
size_t i = 0;
i <
N;
i++) {
91 samples.col(
i) << accSampler_.sample() / sqrt_dt_,
92 gyroSampler_.sample() / sqrt_dt_;
93 sum += samples.col(
i);
97 Vector6 sampleMean = sum /
N;
100 for (
size_t i = 0;
i <
N;
i++) {
101 Vector6
xi = samples.col(
i) - sampleMean;
102 Q += xi * xi.transpose();
void integrateMeasurement(const Vector3 &measuredAcc, const Vector3 &measuredOmega, const double dt) override
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Vector9 localCoordinates(const NavState &g, OptionalJacobian< 9, 9 > H1=boost::none, OptionalJacobian< 9, 9 > H2=boost::none) const
localCoordinates with optional derivatives
static double intNoiseVar
static const Matrix3 kIntegrationErrorCovariance
NavState predict(const NavState &state_i, const imuBias::ConstantBias &bias_i, OptionalJacobian< 9, 9 > H1=boost::none, OptionalJacobian< 9, 6 > H2=boost::none) const
Predict state at time j.
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
static const Vector3 measuredAcc
static const Vector3 measuredOmega(w, 0, 0)
Simple class to test navigation scenarios.
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