32 throw std::invalid_argument(
"ScenarioRunner::Diagonal: not a diagonal");
47 const SharedParams
p_;
56 double imuSampleTime = 1.0 / 100.0,
const Bias& bias =
Bias())
57 : scenario_(scenario),
59 imuSampleTime_(imuSampleTime),
60 sqrt_dt_(
std::
sqrt(imuSampleTime)),
63 gyroSampler_(
Diagonal(p->gyroscopeCovariance), 10),
64 accSampler_(
Diagonal(p->accelerometerCovariance), 29284) {}
83 return actualAngularVelocity(t) + estimatedBias_.
gyroscope() +
84 gyroSampler_.
sample() / sqrt_dt_;
87 return actualSpecificForce(t) + estimatedBias_.
accelerometer() +
88 accSampler_.
sample() / sqrt_dt_;
95 const Bias& estimatedBias =
Bias(),
96 bool corrupted =
false)
const;
100 const Bias& estimatedBias =
Bias())
const;
103 Matrix9 estimateCovariance(
double T,
size_t N = 1000,
104 const Bias& estimatedBias =
Bias())
const;
107 Matrix6 estimateNoiseCovariance(
size_t N = 1000)
const;
119 const SharedParams
p_;
125 double imuSampleTime = 1.0 / 100.0,
126 const Bias& bias =
Bias(),
130 imuSampleTime, bias),
132 estimatedBias_(bias),
133 preintMeasCov_(preintMeasCov) {}
137 double T,
const Bias& estimatedBias =
Bias(),
138 bool corrupted =
false)
const;
142 const Bias& estimatedBias =
Bias())
const;
146 double T,
size_t N = 1000,
const Bias& estimatedBias =
Bias())
const;
Simple class to test navigation scenarios.
Vector3 actualAngularVelocity(double t) const
virtual Vector3 omega_b(double t) const =0
angular velocity in body frame
Vector sample() const
sample from distribution
imuBias::ConstantBias Bias
ScenarioRunner(const Scenario &scenario, const SharedParams &p, double imuSampleTime=1.0/100.0, const Bias &bias=Bias())
static shared_ptr Covariance(const Matrix &covariance, bool smart=true)
const Eigen::Matrix< double, 15, 15 > preintMeasCov_
const Bias estimatedBias_
noiseModel::Diagonal::shared_ptr model
Vector3 actualSpecificForce(double t) const
void diagonal(const MatrixType &m)
const double & imuSampleTime() const
Rot3 rotation(double t) const
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Vector3 measuredAngularVelocity(double t) const
const Vector3 & accelerometer() const
const Vector3 & gravity_n() const
CombinedScenarioRunner(const Scenario &scenario, const SharedParams &p, double imuSampleTime=1.0/100.0, const Bias &bias=Bias(), const Eigen::Matrix< double, 15, 15 > &preintMeasCov=Eigen::Matrix< double, 15, 15 >::Zero())
const Scenario & scenario_
std::shared_ptr< PreintegrationCombinedParams > SharedParams
sampling from a NoiseModel
ConstantTwistScenario scenario(Z_3x1, Vector3(v, 0, 0))
Simple trajectory simulator.
imuBias::ConstantBias Bias
const Vector3 & gyroscope() const
static noiseModel::Diagonal::shared_ptr Diagonal(const Matrix &covariance)
Jet< T, N > sqrt(const Jet< T, N > &f)
std::shared_ptr< Diagonal > shared_ptr
const Scenario & scenario() const
Matrix3 transpose() const
Vector3 acceleration_b(double t) const
std::shared_ptr< PreintegrationParams > SharedParams
const Bias estimatedBias_
Vector3 measuredSpecificForce(double t) const