diff options
author | tumbili <bapstr@ethz.ch> | 2015-02-15 14:02:46 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-15 17:52:39 +0100 |
commit | e582da9ee79315c8fe5939ec869bf6a092ed9d4d (patch) | |
tree | 53b0b412a475e920e06dd71597b0ac28332f6cf0 /src/modules/attitude_estimator_ekf | |
parent | f4f4c72f05294ee3c84f28a6ca17be0d73a75f52 (diff) | |
download | px4-firmware-e582da9ee79315c8fe5939ec869bf6a092ed9d4d.tar.gz px4-firmware-e582da9ee79315c8fe5939ec869bf6a092ed9d4d.tar.bz2 px4-firmware-e582da9ee79315c8fe5939ec869bf6a092ed9d4d.zip |
compute quaternion
Diffstat (limited to 'src/modules/attitude_estimator_ekf')
-rwxr-xr-x | src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp index 86f59f0e6..c60d70b9f 100755 --- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp +++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp @@ -590,9 +590,11 @@ const unsigned int loop_interval_alarm = 6500; // loop interval in microseconds math::Matrix<3, 3> R_body = (&Rot_matrix[0]); R = R_decl * R_body; - + math::Quaternion q; + q.from_dcm(R); /* copy rotation matrix */ memcpy(&att.R[0], &R.data[0][0], sizeof(att.R)); + memcpy(&att.q[0],&q.data[0],sizeof(att.q)); att.R_valid = true; if (isfinite(att.roll) && isfinite(att.pitch) && isfinite(att.yaw)) { |