mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
Fix mc att control multiplatform
This commit is contained in:
@@ -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 */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user