Fix mc att control multiplatform

This commit is contained in:
Lorenz Meier
2016-09-27 18:28:52 +02:00
parent b035b6a112
commit 57f193174c
@@ -86,14 +86,12 @@ void MulticopterAttitudeControlBase::control_attitude(float dt)
_thrust_sp = _v_att_sp->data().thrust; _thrust_sp = _v_att_sp->data().thrust;
/* construct attitude setpoint rotation matrix */ /* construct attitude setpoint rotation matrix */
math::Matrix<3, 3> R_sp; math::Quaternion q_sp(&_v_att_sp->data().q_d[0]);
matrix::Quaternion<float> q_sp(&_v_att_sp->data().q_d[0]); math::Matrix<3, 3> R_sp = q_sp.to_dcm();
R_sp.set(&q_sp._data[0][0]);
/* rotation matrix for current state */ /* rotation matrix for current state */
math::Matrix<3, 3> R; math::Quaternion q(&_v_att->data().q[0]);
matrix::Quaternion<float> q(&_v_att->data().q[0]); math::Matrix<3, 3> R = q.to_dcm();
R.set(&q._data[0][0]);
/* all input data is ready, run controller itself */ /* all input data is ready, run controller itself */