mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 22:03:34 +08:00
vehicle_attitude_setpoint: get rid of unused q_d_valid flag
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user