Skip to content

Commit

Permalink
Matrix Quaternions: Apply simpler call for constructor and copying to…
Browse files Browse the repository at this point in the history
… all remaining modules
  • Loading branch information
MaEtUgR committed Sep 18, 2017
1 parent 41d3745 commit 44a4655
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/ekf2/ekf2_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ void Ekf2::run()
_integrated_time_us += sensors.gyro_integral_dt;
}

matrix::Quaternion<float> q;
matrix::Quatf q;
_ekf.copy_quaternion(q.data());

float velocity[3];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ void BlockLocalPositionEstimator::updateSSParams()
void BlockLocalPositionEstimator::predict()
{
// get acceleration
matrix::Quaternion<float> q(&_sub_att.get().q[0]);
matrix::Quatf q(&_sub_att.get().q[0]);
_eul = matrix::Euler<float>(q);
_R_att = matrix::Dcm<float>(q);
Vector3f a(_sub_sensor.get().accelerometer_m_s2);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/vtol_att_control/standard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void Standard::update_mc_state()
_v_att_sp->roll_body = -asinf(tilt_new(1));
R_sp = matrix::Eulerf(_v_att_sp->roll_body, _v_att_sp->pitch_body, euler_sp(2));
matrix::Quatf q_sp(R_sp);
memcpy(&_v_att_sp->q_d[0], &q_sp._data[0], sizeof(_v_att_sp->q_d));
q_sp.copyTo(_v_att_sp->q_d);
}

_pusher_throttle = _pusher_throttle < 0.0f ? 0.0f : _pusher_throttle;
Expand Down

0 comments on commit 44a4655

Please sign in to comment.