mavlink interface: update mapprojection usage

This commit is contained in:
Thomas Gubler
2014-04-29 15:39:26 +02:00
parent 4f84cdc8b8
commit a7289a3266
3 changed files with 22 additions and 6 deletions
+2 -2
View File
@@ -766,7 +766,7 @@ MavlinkReceiver::handle_message_hil_state_quaternion(mavlink_message_t *msg)
if (!_hil_local_proj_inited) {
_hil_local_proj_inited = true;
_hil_local_alt0 = hil_state.alt / 1000.0f;
hil_local_pos.ref_timestamp = map_projection_timestamp();
hil_local_pos.ref_timestamp = map_projection_global_timestamp();
hil_local_pos.ref_lat = lat;
hil_local_pos.ref_lon = lon;
hil_local_pos.ref_alt = _hil_local_alt0;
@@ -774,7 +774,7 @@ MavlinkReceiver::handle_message_hil_state_quaternion(mavlink_message_t *msg)
float x;
float y;
map_projection_project(lat, lon, &x, &y);
map_projection_global_project(lat, lon, &x, &y);
hil_local_pos.timestamp = timestamp;
hil_local_pos.xy_valid = true;
hil_local_pos.z_valid = true;