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++) {
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_;
95 Vector6 sampleMean = sum /
N;
98 for (
size_t i = 0;
i <
N;
i++) {
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++) {
158 Q +=
xi *
xi.transpose();