vehicle_attitude_setpoint: get rid of unused q_d_valid flag

This commit is contained in:
Matthias Grob
2020-02-27 09:17:52 +01:00
parent b53bd2b77f
commit f90d3671c0
13 changed files with 2 additions and 30 deletions
+1 -11
View File
@@ -3516,17 +3516,7 @@ protected:
mavlink_attitude_target_t msg = {};
msg.time_boot_ms = att_sp.timestamp / 1000;
if (att_sp.q_d_valid) {
memcpy(&msg.q[0], &att_sp.q_d[0], sizeof(msg.q));
} else {
matrix::Quatf q = matrix::Eulerf(att_sp.roll_body, att_sp.pitch_body, att_sp.yaw_body);
for (size_t i = 0; i < 4; i++) {
msg.q[i] = q(i);
}
}
matrix::Quatf(att_sp.q_d).copyTo(msg.q);
msg.body_roll_rate = att_rates_sp.roll;
msg.body_pitch_rate = att_rates_sp.pitch;
-1
View File
@@ -1491,7 +1491,6 @@ MavlinkReceiver::handle_message_set_attitude_target(mavlink_message_t *msg)
if (!ignore_attitude_msg) { // only copy att sp if message contained new data
matrix::Quatf q(set_attitude_target.q);
q.copyTo(att_sp.q_d);
att_sp.q_d_valid = true;
matrix::Eulerf euler{q};
att_sp.roll_body = euler.phi();