mc_att_control fix and enforce code style

This commit is contained in:
Daniel Agar 2016-08-05 22:38:02 -04:00 committed by Lorenz Meier
parent 8f01324890
commit d4196f7f0c
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,6 @@ find src/ \
-path src/modules/commander -prune -o \
-path src/modules/ekf_att_pos_estimator -prune -o \
-path src/modules/mavlink -prune -o \
-path src/modules/mc_att_control -prune -o \
-path src/modules/mc_att_control_multiplatform -prune -o \
-path src/modules/mc_pos_control -prune -o \
-path src/modules/mc_pos_control_multiplatform -prune -o \

View File

@ -435,6 +435,7 @@ MulticopterAttitudeControl::~MulticopterAttitudeControl()
}
} while (_control_task != -1);
}
if (_ts_opt_recovery != nullptr) {
delete _ts_opt_recovery;
}
@ -717,7 +718,7 @@ MulticopterAttitudeControl::control_attitude(float dt)
* calculate angle and axis for R -> R_sp rotation directly */
math::Quaternion q_error;
q_error.from_dcm(R.transposed() * R_sp);
math::Vector<3> e_R_d = q_error(0) >= 0.0f ? q_error.imag() * 2.0f: -q_error.imag() * 2.0f;
math::Vector<3> e_R_d = q_error(0) >= 0.0f ? q_error.imag() * 2.0f : -q_error.imag() * 2.0f;
/* use fusion of Z axis based rotation and direct rotation */
float direct_w = e_R_z_cos * e_R_z_cos * yaw_w;