30#include <boost/optional.hpp>
89template<
class POSE,
class VELOCITY>
97 Vector delta_pos_in_t0_;
98 Vector delta_vel_in_t0_;
99 Vector3 delta_angles_;
104 Vector world_omega_earth_;
106 Matrix Jacobian_wrt_t0_Overall_;
108 boost::optional<POSE> body_P_sensor_;
113 typedef typename boost::shared_ptr<EquivInertialNavFactor_GlobalVel_NoBias> shared_ptr;
120 const Vector& delta_pos_in_t0,
const Vector& delta_vel_in_t0,
const Vector3& delta_angles,
121 double dt12,
const Vector world_g,
const Vector world_rho,
122 const Vector& world_omega_earth,
const noiseModel::Gaussian::shared_ptr& model_equivalent,
123 const Matrix& Jacobian_wrt_t0_Overall,
124 boost::optional<POSE> body_P_sensor = boost::none) :
125 Base(model_equivalent, Pose1, Vel1,
Pose2, Vel2),
126 delta_pos_in_t0_(delta_pos_in_t0), delta_vel_in_t0_(delta_vel_in_t0), delta_angles_(delta_angles),
127 dt12_(dt12), world_g_(world_g), world_rho_(world_rho), world_omega_earth_(world_omega_earth), Jacobian_wrt_t0_Overall_(Jacobian_wrt_t0_Overall),
128 body_P_sensor_(body_P_sensor) { }
136 const std::string& s =
"EquivInertialNavFactor_GlobalVel_NoBias",
137 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const {
138 std::cout << s <<
"("
139 << keyFormatter(this->
key1()) <<
","
140 << keyFormatter(this->key2()) <<
","
141 << keyFormatter(this->key3()) <<
","
142 << keyFormatter(this->key4()) <<
"\n";
143 std::cout <<
"delta_pos_in_t0: " << this->delta_pos_in_t0_.transpose() << std::endl;
144 std::cout <<
"delta_vel_in_t0: " << this->delta_vel_in_t0_.transpose() << std::endl;
145 std::cout <<
"delta_angles: " << this->delta_angles_ << std::endl;
146 std::cout <<
"dt12: " << this->dt12_ << std::endl;
147 std::cout <<
"gravity (in world frame): " << this->world_g_.transpose() << std::endl;
148 std::cout <<
"craft rate (in world frame): " << this->world_rho_.transpose() << std::endl;
149 std::cout <<
"earth's rotation (in world frame): " << this->world_omega_earth_.transpose() << std::endl;
150 if(this->body_P_sensor_)
151 this->body_P_sensor_->print(
" sensor pose in body frame: ");
152 this->noiseModel_->print(
" noise model");
157 const This *e =
dynamic_cast<const This*
> (&expected);
159 && (delta_pos_in_t0_ - e->delta_pos_in_t0_).norm() < tol
160 && (delta_vel_in_t0_ - e->delta_vel_in_t0_).norm() < tol
161 && (delta_angles_ - e->delta_angles_).norm() < tol
162 && (dt12_ - e->dt12_) < tol
163 && (world_g_ - e->world_g_).norm() < tol
164 && (world_rho_ - e->world_rho_).norm() < tol
165 && (world_omega_earth_ - e->world_omega_earth_).norm() < tol
166 && ((!body_P_sensor_ && !e->body_P_sensor_) || (body_P_sensor_ && e->body_P_sensor_ && body_P_sensor_->
equals(*e->body_P_sensor_)));
170 POSE predictPose(
const POSE& Pose1,
const VELOCITY& Vel1)
const {
173 Vector delta_pos_in_t0_corrected = delta_pos_in_t0_;
176 Vector delta_angles_corrected = delta_angles_;
178 return predictPose_inertial(Pose1, Vel1,
179 delta_pos_in_t0_corrected, delta_angles_corrected,
180 dt12_, world_g_, world_rho_, world_omega_earth_);
183 static inline POSE predictPose_inertial(
const POSE& Pose1,
const VELOCITY& Vel1,
184 const Vector& delta_pos_in_t0,
const Vector3& delta_angles,
185 const double dt12,
const Vector& world_g,
const Vector& world_rho,
const Vector& world_omega_earth){
187 const POSE& world_P1_body = Pose1;
188 const VELOCITY& world_V1_body = Vel1;
191 Vector body_deltaPos_body = delta_pos_in_t0;
193 Vector world_deltaPos_pls_body = world_P1_body.rotation().matrix() * body_deltaPos_body;
194 Vector world_deltaPos_body = world_V1_body * dt12 + 0.5*world_g*dt12*dt12 + world_deltaPos_pls_body;
197 world_deltaPos_body -= 2*
skewSymmetric(world_rho + world_omega_earth)*world_V1_body * dt12*dt12;
207 Vector body_deltaAngles_body = delta_angles;
210 Matrix body_R_world(world_P1_body.rotation().inverse().matrix());
211 Vector body_rho = body_R_world * world_rho;
212 Vector body_omega_earth = body_R_world * world_omega_earth;
215 body_deltaAngles_body -= (body_rho + body_omega_earth)*dt12;
217 return POSE(Pose1.rotation() * POSE::Rotation::Expmap(body_deltaAngles_body), Pose1.translation() +
typename POSE::Translation(world_deltaPos_body));
221 VELOCITY predictVelocity(
const POSE& Pose1,
const VELOCITY& Vel1)
const {
224 Vector delta_vel_in_t0_corrected = delta_vel_in_t0_;
226 return predictVelocity_inertial(Pose1, Vel1,
227 delta_vel_in_t0_corrected,
228 dt12_, world_g_, world_rho_, world_omega_earth_);
231 static inline VELOCITY predictVelocity_inertial(
const POSE& Pose1,
const VELOCITY& Vel1,
232 const Vector& delta_vel_in_t0,
233 const double dt12,
const Vector& world_g,
const Vector& world_rho,
const Vector& world_omega_earth) {
235 const POSE& world_P1_body = Pose1;
236 const VELOCITY& world_V1_body = Vel1;
238 Vector body_deltaVel_body = delta_vel_in_t0;
239 Vector world_deltaVel_body = world_P1_body.rotation().matrix() * body_deltaVel_body;
241 VELOCITY VelDelta( world_deltaVel_body + world_g * dt12 );
244 VelDelta -= 2*
skewSymmetric(world_rho + world_omega_earth)*world_V1_body * dt12;
247 return Vel1.compose( VelDelta );
251 void predict(
const POSE& Pose1,
const VELOCITY& Vel1, POSE& Pose2, VELOCITY& Vel2)
const {
252 Pose2 = predictPose(Pose1, Vel1);
253 Vel2 = predictVelocity(Pose1, Vel1);
256 POSE evaluatePoseError(
const POSE& Pose1,
const VELOCITY& Vel1,
const POSE& Pose2,
const VELOCITY& Vel2)
const {
258 POSE Pose2Pred = predictPose(Pose1, Vel1);
261 return Pose2.between(Pose2Pred);
264 VELOCITY evaluateVelocityError(
const POSE& Pose1,
const VELOCITY& Vel1,
const POSE& Pose2,
const VELOCITY& Vel2)
const {
266 VELOCITY Vel2Pred = predictVelocity(Pose1, Vel1);
269 return Vel2.between(Vel2Pred);
272 Vector
evaluateError(
const POSE& Pose1,
const VELOCITY& Vel1,
const POSE&
Pose2,
const VELOCITY& Vel2,
273 boost::optional<Matrix&> H1 = boost::none,
274 boost::optional<Matrix&> H2 = boost::none,
275 boost::optional<Matrix&> H3 = boost::none,
276 boost::optional<Matrix&> H4 = boost::none)
const {
281 Matrix H1_Pose = numericalDerivative11<POSE, POSE>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluatePoseError,
this, _1, Vel1,
Pose2, Vel2), Pose1);
282 Matrix H1_Vel = numericalDerivative11<VELOCITY, POSE>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluateVelocityError,
this, _1, Vel1,
Pose2, Vel2), Pose1);
283 *H1 =
stack(2, &H1_Pose, &H1_Vel);
288 Matrix H2_Pose = numericalDerivative11<POSE, VELOCITY>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluatePoseError,
this, Pose1, _1,
Pose2, Vel2), Vel1);
289 Matrix H2_Vel = numericalDerivative11<VELOCITY, VELOCITY>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluateVelocityError,
this, Pose1, _1,
Pose2, Vel2), Vel1);
290 *H2 =
stack(2, &H2_Pose, &H2_Vel);
295 Matrix H3_Pose = numericalDerivative11<POSE, POSE>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluatePoseError,
this, Pose1, Vel1, _1, Vel2),
Pose2);
296 Matrix H3_Vel = numericalDerivative11<VELOCITY, POSE>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluateVelocityError,
this, Pose1, Vel1, _1, Vel2),
Pose2);
297 *H3 =
stack(2, &H3_Pose, &H3_Vel);
302 Matrix H4_Pose = numericalDerivative11<POSE, VELOCITY>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluatePoseError,
this, Pose1, Vel1,
Pose2, _1), Vel2);
303 Matrix H4_Vel = numericalDerivative11<VELOCITY, VELOCITY>(std::bind(&EquivInertialNavFactor_GlobalVel_NoBias::evaluateVelocityError,
this, Pose1, Vel1,
Pose2, _1), Vel2);
304 *H4 =
stack(2, &H4_Pose, &H4_Vel);
307 Vector ErrPoseVector(POSE::Logmap(evaluatePoseError(Pose1, Vel1,
Pose2, Vel2)));
308 Vector ErrVelVector(VELOCITY::Logmap(evaluateVelocityError(Pose1, Vel1,
Pose2, Vel2)));
315 static inline POSE PredictPoseFromPreIntegration(
const POSE& Pose1,
const VELOCITY& Vel1,
316 const Vector& delta_pos_in_t0,
const Vector3& delta_angles,
317 double dt12,
const Vector world_g,
const Vector world_rho,
318 const Vector& world_omega_earth,
const Matrix& Jacobian_wrt_t0_Overall) {
321 Vector delta_pos_in_t0_corrected = delta_pos_in_t0;
324 Vector delta_angles_corrected = delta_angles;
328 return predictPose_inertial(Pose1, Vel1, delta_pos_in_t0_corrected, delta_angles_corrected, dt12, world_g, world_rho, world_omega_earth);
331 static inline VELOCITY PredictVelocityFromPreIntegration(
const POSE& Pose1,
const VELOCITY& Vel1,
332 const Vector& delta_vel_in_t0,
double dt12,
const Vector world_g,
const Vector world_rho,
333 const Vector& world_omega_earth,
const Matrix& Jacobian_wrt_t0_Overall) {
335 Vector delta_vel_in_t0_corrected = delta_vel_in_t0;
337 return predictVelocity_inertial(Pose1, Vel1, delta_vel_in_t0_corrected, dt12, world_g, world_rho, world_omega_earth);
340 static inline void PredictFromPreIntegration(
const POSE& Pose1,
const VELOCITY& Vel1, POSE& Pose2, VELOCITY& Vel2,
341 const Vector& delta_pos_in_t0,
const Vector& delta_vel_in_t0,
const Vector3& delta_angles,
342 double dt12,
const Vector world_g,
const Vector world_rho,
343 const Vector& world_omega_earth,
const Matrix& Jacobian_wrt_t0_Overall) {
345 Pose2 = PredictPoseFromPreIntegration(Pose1, Vel1, delta_pos_in_t0, delta_angles, dt12, world_g, world_rho, world_omega_earth, Jacobian_wrt_t0_Overall);
346 Vel2 = PredictVelocityFromPreIntegration(Pose1, Vel1, delta_vel_in_t0, dt12, world_g, world_rho, world_omega_earth, Jacobian_wrt_t0_Overall);
350 static inline void PreIntegrateIMUObservations(
const Vector& msr_acc_t,
const Vector& msr_gyro_t,
const double msr_dt,
351 Vector& delta_pos_in_t0, Vector3& delta_angles, Vector& delta_vel_in_t0,
double& delta_t,
352 const noiseModel::Gaussian::shared_ptr& model_continuous_overall,
353 Matrix& EquivCov_Overall, Matrix& Jacobian_wrt_t0_Overall,
354 boost::optional<POSE> p_body_P_sensor = boost::none){
358 POSE body_P_sensor = POSE();
359 bool flag_use_body_P_sensor =
false;
360 if (p_body_P_sensor){
361 body_P_sensor = *p_body_P_sensor;
362 flag_use_body_P_sensor =
true;
365 delta_pos_in_t0 = PreIntegrateIMUObservations_delta_pos(msr_dt, delta_pos_in_t0, delta_vel_in_t0);
366 delta_vel_in_t0 = PreIntegrateIMUObservations_delta_vel(msr_gyro_t, msr_acc_t, msr_dt, delta_angles, delta_vel_in_t0, flag_use_body_P_sensor, body_P_sensor);
367 delta_angles = PreIntegrateIMUObservations_delta_angles(msr_gyro_t, msr_dt, delta_angles, flag_use_body_P_sensor, body_P_sensor);
372 Matrix Z_3x3 = Z_3x3;
373 Matrix I_3x3 = I_3x3;
375 Matrix H_pos_pos = numericalDerivative11<LieVector, LieVector>(std::bind(&PreIntegrateIMUObservations_delta_pos, msr_dt, _1, delta_vel_in_t0), delta_pos_in_t0);
376 Matrix H_pos_vel = numericalDerivative11<LieVector, LieVector>(std::bind(&PreIntegrateIMUObservations_delta_pos, msr_dt, delta_pos_in_t0, _1), delta_vel_in_t0);
377 Matrix H_pos_angles = Z_3x3;
379 Matrix H_vel_vel = numericalDerivative11<LieVector, LieVector>(std::bind(&PreIntegrateIMUObservations_delta_vel, msr_gyro_t, msr_acc_t, msr_dt, delta_angles, _1, flag_use_body_P_sensor, body_P_sensor), delta_vel_in_t0);
380 Matrix H_vel_angles = numericalDerivative11<LieVector, LieVector>(std::bind(&PreIntegrateIMUObservations_delta_vel, msr_gyro_t, msr_acc_t, msr_dt, _1, delta_vel_in_t0, flag_use_body_P_sensor, body_P_sensor), delta_angles);
381 Matrix H_vel_pos = Z_3x3;
383 Matrix H_angles_angles = numericalDerivative11<LieVector, LieVector>(std::bind(&PreIntegrateIMUObservations_delta_angles, msr_gyro_t, msr_dt, _1, flag_use_body_P_sensor, body_P_sensor), delta_angles);
384 Matrix H_angles_pos = Z_3x3;
385 Matrix H_angles_vel = Z_3x3;
387 Matrix F_angles =
collect(3, &H_angles_angles, &H_angles_pos, &H_angles_vel);
388 Matrix F_pos =
collect(3, &H_pos_angles, &H_pos_pos, &H_pos_vel);
389 Matrix F_vel =
collect(3, &H_vel_angles, &H_vel_pos, &H_vel_vel);
390 Matrix F =
stack(3, &F_angles, &F_pos, &F_vel);
392 noiseModel::Gaussian::shared_ptr model_discrete_curr = calc_descrete_noise_model(model_continuous_overall, msr_dt );
393 Matrix Q_d =
inverse(model_discrete_curr->R().transpose() * model_discrete_curr->R() );
395 EquivCov_Overall = F * EquivCov_Overall * F.transpose() + Q_d;
398 Jacobian_wrt_t0_Overall = F * Jacobian_wrt_t0_Overall;
401 static inline Vector PreIntegrateIMUObservations_delta_pos(
const double msr_dt,
402 const Vector& delta_pos_in_t0,
const Vector& delta_vel_in_t0){
407 return delta_pos_in_t0 + delta_vel_in_t0 * msr_dt;
412 static inline Vector PreIntegrateIMUObservations_delta_vel(
const Vector& msr_gyro_t,
const Vector& msr_acc_t,
const double msr_dt,
413 const Vector3& delta_angles,
const Vector& delta_vel_in_t0,
const bool flag_use_body_P_sensor,
const POSE& body_P_sensor){
418 Vector AccCorrected = msr_acc_t;
419 Vector body_t_a_body;
420 if (flag_use_body_P_sensor){
421 Matrix body_R_sensor = body_P_sensor.rotation().matrix();
423 Vector GyroCorrected(msr_gyro_t);
425 Vector body_omega_body = body_R_sensor * GyroCorrected;
426 Matrix body_omega_body__cross =
skewSymmetric(body_omega_body);
428 body_t_a_body = body_R_sensor * AccCorrected - body_omega_body__cross * body_omega_body__cross * body_P_sensor.translation().vector();
430 body_t_a_body = AccCorrected;
435 return delta_vel_in_t0 + R_t_to_t0.matrix() * body_t_a_body * msr_dt;
439 static inline Vector PreIntegrateIMUObservations_delta_angles(
const Vector& msr_gyro_t,
const double msr_dt,
440 const Vector3& delta_angles,
const bool flag_use_body_P_sensor,
const POSE& body_P_sensor){
445 Vector GyroCorrected = msr_gyro_t;
447 Vector body_t_omega_body;
448 if (flag_use_body_P_sensor){
449 body_t_omega_body = body_P_sensor.rotation().matrix() * GyroCorrected;
451 body_t_omega_body = GyroCorrected;
456 R_t_to_t0 = R_t_to_t0 *
Rot3::Expmap( body_t_omega_body*msr_dt );
460 static inline noiseModel::Gaussian::shared_ptr CalcEquivalentNoiseCov(
const noiseModel::Gaussian::shared_ptr& gaussian_acc,
const noiseModel::Gaussian::shared_ptr& gaussian_gyro,
461 const noiseModel::Gaussian::shared_ptr& gaussian_process){
463 Matrix cov_acc =
inverse( gaussian_acc->R().transpose() * gaussian_acc->R() );
464 Matrix cov_gyro =
inverse( gaussian_gyro->R().transpose() * gaussian_gyro->R() );
465 Matrix cov_process =
inverse( gaussian_process->R().transpose() * gaussian_process->R() );
467 cov_process.block(0,0, 3,3) += cov_gyro;
468 cov_process.block(6,6, 3,3) += cov_acc;
473 static inline void CalcEquivalentNoiseCov_DifferentParts(
const noiseModel::Gaussian::shared_ptr& gaussian_acc,
const noiseModel::Gaussian::shared_ptr& gaussian_gyro,
474 const noiseModel::Gaussian::shared_ptr& gaussian_process,
475 Matrix& cov_acc, Matrix& cov_gyro, Matrix& cov_process_without_acc_gyro){
477 cov_acc =
inverse( gaussian_acc->R().transpose() * gaussian_acc->R() );
478 cov_gyro =
inverse( gaussian_gyro->R().transpose() * gaussian_gyro->R() );
479 cov_process_without_acc_gyro =
inverse( gaussian_process->R().transpose() * gaussian_process->R() );
482 static inline void Calc_g_rho_omega_earth_NED(
const Vector& Pos_NED,
const Vector& Vel_NED,
const Vector& LatLonHeight_IC,
const Vector& Pos_NED_Initial,
483 Vector& g_NED, Vector& rho_NED, Vector& omega_earth_NED) {
485 Matrix ENU_to_NED = (Matrix(3, 3) <<
488 0.0, 0.0, -1.0).finished();
490 Matrix NED_to_ENU = (Matrix(3, 3) <<
493 0.0, 0.0, -1.0).finished();
496 Vector Pos_ENU = NED_to_ENU * Pos_NED;
497 Vector Vel_ENU = NED_to_ENU * Vel_NED;
498 Vector Pos_ENU_Initial = NED_to_ENU * Pos_NED_Initial;
503 Vector omega_earth_ENU;
504 Calc_g_rho_omega_earth_ENU(Pos_ENU, Vel_ENU, LatLonHeight_IC, Pos_ENU_Initial, g_ENU, rho_ENU, omega_earth_ENU);
507 g_NED = ENU_to_NED * g_ENU;
508 rho_NED = ENU_to_NED * rho_ENU;
509 omega_earth_NED = ENU_to_NED * omega_earth_ENU;
512 static inline void Calc_g_rho_omega_earth_ENU(
const Vector& Pos_ENU,
const Vector& Vel_ENU,
const Vector& LatLonHeight_IC,
const Vector& Pos_ENU_Initial,
513 Vector& g_ENU, Vector& rho_ENU, Vector& omega_earth_ENU){
514 double R0 = 6.378388e6;
516 double Re( R0*( 1-e*(sin( LatLonHeight_IC(0) ))*(sin( LatLonHeight_IC(0) )) ) );
519 Vector delta_Pos_ENU(Pos_ENU - Pos_ENU_Initial);
520 double delta_lat(delta_Pos_ENU(1)/Re);
521 double delta_lon(delta_Pos_ENU(0)/(Re*cos(LatLonHeight_IC(0))));
522 double lat_new(LatLonHeight_IC(0) + delta_lat);
523 double lon_new(LatLonHeight_IC(1) + delta_lon);
526 Rot3 C1(cos(lon_new), sin(lon_new), 0.0,
527 -sin(lon_new), cos(lon_new), 0.0,
531 Rot3 C2(cos(lat_new), 0.0, sin(lat_new),
533 -sin(lat_new), 0.0, cos(lat_new));
535 Rot3 UEN_to_ENU(0, 1, 0,
539 Rot3 R_ECEF_to_ENU( UEN_to_ENU * C2 * C1 );
541 Vector omega_earth_ECEF((Vector(3) << 0.0, 0.0, 7.292115e-5));
542 omega_earth_ENU = R_ECEF_to_ENU.matrix() * omega_earth_ECEF;
545 double height(LatLonHeight_IC(2));
546 double EQUA_RADIUS = 6378137.0;
547 double ECCENTRICITY = 0.0818191908426;
548 double e2( pow(ECCENTRICITY,2) );
549 double den( 1-e2*pow(sin(lat_new),2) );
550 double Rm( (EQUA_RADIUS*(1-e2))/( pow(den,(3/2)) ) );
551 double Rp( EQUA_RADIUS/( sqrt(den) ) );
552 double Ro( sqrt(Rp*Rm) );
553 double g0( 9.780318*( 1 + 5.3024e-3 * pow(sin(lat_new),2) - 5.9e-6 * pow(sin(2*lat_new),2) ) );
554 double g_calc( g0/( pow(1 + height/Ro, 2) ) );
555 g_ENU = (Vector(3) << 0.0, 0.0, -g_calc);
559 double Ve( Vel_ENU(0) );
560 double Vn( Vel_ENU(1) );
561 double rho_E = -Vn/(Rm + height);
562 double rho_N = Ve/(Rp + height);
563 double rho_U = Ve*tan(lat_new)/(Rp + height);
564 rho_ENU = (Vector(3) << rho_E, rho_N, rho_U);
567 static inline noiseModel::Gaussian::shared_ptr calc_descrete_noise_model(
const noiseModel::Gaussian::shared_ptr& model,
double delta_t){
578 template<
class ARCHIVE>
579 void serialize(ARCHIVE & ar,
const unsigned int ) {
580 ar & boost::serialization::make_nvp(
"NonlinearFactor2",
581 boost::serialization::base_object<Base>(*
this));
typedef and functions to augment Eigen's MatrixXd
Some functions to compute numerical derivatives.
T inverse(const T &t)
unary functions
Definition: lieProxies.h:43
3D rotation represented as a rotation matrix or quaternion
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Matrix stack(size_t nrMatrices,...)
create a matrix by stacking other matrices Given a set of matrices: A1, A2, A3...
Definition: Matrix.cpp:396
Matrix3 skewSymmetric(double wx, double wy, double wz)
skew symmetric matrix returns this: 0 -wz wy wz 0 -wx -wy wx 0
Definition: Matrix.h:404
Matrix collect(const std::vector< const Matrix * > &matrices, size_t m, size_t n)
create a matrix by concatenating Given a set of matrices: A1, A2, A3... If all matrices have the same...
Definition: Matrix.cpp:442
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
Vector concatVectors(const std::list< Vector > &vs)
concatenate Vectors
Definition: Vector.cpp:302
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
static Vector3 Logmap(const Rot3 &R, OptionalJacobian< 3, 3 > H=boost::none)
Log map at identity - returns the canonical coordinates of this rotation.
Definition: Rot3M.cpp:158
static Rot3 Expmap(const Vector3 &v, OptionalJacobian< 3, 3 > H=boost::none)
Exponential map at identity - create a rotation from canonical coordinates using Rodrigues' formula.
Definition: Rot3.h:377
This is the base class for all factor types.
Definition: Factor.h:56
bool equals(const This &other, double tol=1e-9) const
check equality
Definition: Factor.cpp:42
static shared_ptr Covariance(const Matrix &covariance, bool smart=true)
A Gaussian noise model created by specifying a covariance matrix.
Definition: NoiseModel.cpp:116
static shared_ptr SqrtInformation(const Matrix &R, bool smart=true)
A Gaussian noise model created by specifying a square root information matrix.
Definition: NoiseModel.cpp:85
Nonlinear factor base class.
Definition: NonlinearFactor.h:43
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Check if two factors are equal.
Definition: NonlinearFactor.cpp:71
A convenient base class for creating your own NoiseModelFactor with 4 variables.
Definition: NonlinearFactor.h:521
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:557
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:90
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
equals
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:156
Vector evaluateError(const POSE &Pose1, const VELOCITY &Vel1, const POSE &Pose2, const VELOCITY &Vel2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none) const
Override this method to finish implementing a 4-way factor.
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:272
virtual void print(const std::string &s="EquivInertialNavFactor_GlobalVel_NoBias", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
implement functions needed for Testable
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:135
EquivInertialNavFactor_GlobalVel_NoBias()
default constructor - only use for serialization
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:116
friend class boost::serialization::access
Serialization function.
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:577
EquivInertialNavFactor_GlobalVel_NoBias(const Key &Pose1, const Key &Vel1, const Key &Pose2, const Key &Vel2, const Vector &delta_pos_in_t0, const Vector &delta_vel_in_t0, const Vector3 &delta_angles, double dt12, const Vector world_g, const Vector world_rho, const Vector &world_omega_earth, const noiseModel::Gaussian::shared_ptr &model_equivalent, const Matrix &Jacobian_wrt_t0_Overall, boost::optional< POSE > body_P_sensor=boost::none)
Constructor.
Definition: EquivInertialNavFactor_GlobalVel_NoBias.h:119