Skip to content

Commit

Permalink
SIH: do not store delta_quaternion
Browse files Browse the repository at this point in the history
Converting an AxisAngle to a Quaternion uses the exponenial
  • Loading branch information
bresch committed Nov 19, 2024
1 parent 2b102b9 commit 0627e29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/modules/simulation/simulator_sih/sih.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ void Sih::equations_of_motion(const float dt)
// trapezoidal position integration
_p_E = _p_E + (Vector3d(_v_E(0), _v_E(1), _v_E(2)) + v_E_prev) * 0.5 * dt;

_dq = Quatf::expq(0.5f * dt * _w_B);
const Quatf dq(AxisAnglef(0.5f * dt * _w_B));

_q_E = _q_E * _dq;
_q_E = _q_E * dq;
_q_E.normalize();

const Vector3f w_B_dot = _Im1 * (_Mt_B + _Ma_B - _w_B.cross(_I * _w_B)); // conservation of angular momentum
Expand Down
1 change: 0 additions & 1 deletion src/modules/simulation/simulator_sih/sih.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ class Sih : public ModuleBase<Sih>, public ModuleParams
matrix::Quatf _q{}; // quaternion attitude in local navigation frame
matrix::Quatf _q_E{}; // quaternion attitude in ECEF
matrix::Vector3f _w_B{}; // body rates in body frame [rad/s]
matrix::Quatf _dq{}; // quaternion differential
float _u[NB_MOTORS] {}; // thruster signals

matrix::Vector3f _gravity_E{};
Expand Down

0 comments on commit 0627e29

Please sign in to comment.