Skip to content

Commit

Permalink
ekf: move gravity, coriolis and transport rate signs
Browse files Browse the repository at this point in the history
This is how those quentities are usually defined
  • Loading branch information
bresch committed Nov 21, 2024
1 parent 0bfcddf commit 09488d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/ekf2/EKF/ekf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ void Ekf::predictState(const imuSample &imu_delayed)
_state.vel += corrected_delta_vel_ef;

// compensate for acceleration due to gravity, Coriolis and transport rate
const Vector3f gravity_acceleration(0.f, 0.f, -CONSTANTS_ONE_G); // simplistic model
const Vector3f coriolis_acceleration = 2.f * _earth_rate_NED.cross(vel_last);
const Vector3f transport_rate = _gpos.computeAngularRateNavFrame(vel_last).cross(vel_last);
_state.vel -= (gravity_acceleration + coriolis_acceleration + transport_rate) * imu_delayed.delta_vel_dt;
const Vector3f gravity_acceleration(0.f, 0.f, CONSTANTS_ONE_G); // simplistic model
const Vector3f coriolis_acceleration = -2.f * _earth_rate_NED.cross(vel_last);
const Vector3f transport_rate = -_gpos.computeAngularRateNavFrame(vel_last).cross(vel_last);
_state.vel += (gravity_acceleration + coriolis_acceleration + transport_rate) * imu_delayed.delta_vel_dt;

// predict position states via trapezoidal integration of velocity
_gpos += (vel_last + _state.vel) * imu_delayed.delta_vel_dt * 0.5f;
Expand Down

0 comments on commit 09488d9

Please sign in to comment.