vehicle_local_position: rename yaw -> heading and add reset logic

- vehicle_global_position yaw removed (redundant)
This commit is contained in:
Daniel Agar
2020-08-10 11:42:03 +02:00
committed by Mathieu Bresciani
parent 33fb9d0c62
commit 97fc1db768
24 changed files with 75 additions and 86 deletions
@@ -294,8 +294,9 @@ bool MavlinkStreamHighLatency2::write_geofence_result(mavlink_high_latency2_t *m
bool MavlinkStreamHighLatency2::write_global_position(mavlink_high_latency2_t *msg)
{
vehicle_global_position_s global_pos;
vehicle_local_position_s local_pos;
if (_global_pos_sub.update(&global_pos)) {
if (_global_pos_sub.update(&global_pos) && _local_pos_sub.update(&local_pos)) {
msg->latitude = global_pos.lat * 1e7;
msg->longitude = global_pos.lon * 1e7;
@@ -310,7 +311,7 @@ bool MavlinkStreamHighLatency2::write_global_position(mavlink_high_latency2_t *m
msg->altitude = altitude;
msg->heading = static_cast<uint8_t>(math::degrees(wrap_2pi(global_pos.yaw)) * 0.5f);
msg->heading = static_cast<uint8_t>(math::degrees(wrap_2pi(local_pos.heading)) * 0.5f);
return true;
}