mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 10:43:34 +08:00
deleted second update of transformation matrix
This commit is contained in:
+3
-4
@@ -570,8 +570,10 @@ void Ekf::predictState()
|
|||||||
// save the previous value of velocity so we can use trapzoidal integration
|
// save the previous value of velocity so we can use trapzoidal integration
|
||||||
Vector3f vel_last = _state.vel;
|
Vector3f vel_last = _state.vel;
|
||||||
|
|
||||||
// update the rotation matrix and calculate the increment in velocity using the current orientation
|
// update transformation matrix from body to world frame
|
||||||
_R_to_earth = quat_to_invrotmat(_state.quat_nominal);
|
_R_to_earth = quat_to_invrotmat(_state.quat_nominal);
|
||||||
|
|
||||||
|
// calculate the increment in velocity using the current orientation
|
||||||
_state.vel += _R_to_earth * corrected_delta_vel;
|
_state.vel += _R_to_earth * corrected_delta_vel;
|
||||||
|
|
||||||
// compensate for acceleration due to gravity
|
// compensate for acceleration due to gravity
|
||||||
@@ -580,9 +582,6 @@ void Ekf::predictState()
|
|||||||
// predict position states via trapezoidal integration of velocity
|
// predict position states via trapezoidal integration of velocity
|
||||||
_state.pos += (vel_last + _state.vel) * _imu_sample_delayed.delta_vel_dt * 0.5f;
|
_state.pos += (vel_last + _state.vel) * _imu_sample_delayed.delta_vel_dt * 0.5f;
|
||||||
|
|
||||||
// update transformation matrix from body to world frame
|
|
||||||
_R_to_earth = quat_to_invrotmat(_state.quat_nominal);
|
|
||||||
|
|
||||||
constrainStates();
|
constrainStates();
|
||||||
|
|
||||||
// calculate an average filter update time
|
// calculate an average filter update time
|
||||||
|
|||||||
Reference in New Issue
Block a user