diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-05-06 16:59:09 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-05-06 16:59:09 +0200 |
commit | a6a2efb651d875171aaec698a836f26b548ca0d6 (patch) | |
tree | 816c022dd2ed33e349b6cf8ac9b98d9f2f5ffa35 | |
parent | 32ba39c696f1adf8dfe6f6dfb17d1ee94fed2596 (diff) | |
download | px4-firmware-a6a2efb651d875171aaec698a836f26b548ca0d6.tar.gz px4-firmware-a6a2efb651d875171aaec698a836f26b548ca0d6.tar.bz2 px4-firmware-a6a2efb651d875171aaec698a836f26b548ca0d6.zip |
mavlink receiver: switch back to use local and not systemwide map projection
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 1cfbde1d2..7c93c1c00 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -778,7 +778,8 @@ 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_global_timestamp(); + map_projection_init(&_hil_local_proj_ref, hil_state.lat, hil_state.lon); + hil_local_pos.ref_timestamp = timestamp; hil_local_pos.ref_lat = lat; hil_local_pos.ref_lon = lon; hil_local_pos.ref_alt = _hil_local_alt0; @@ -786,7 +787,7 @@ MavlinkReceiver::handle_message_hil_state_quaternion(mavlink_message_t *msg) float x; float y; - map_projection_global_project(lat, lon, &x, &y); + map_projection_project(&_hil_local_proj_ref, lat, lon, &x, &y); hil_local_pos.timestamp = timestamp; hil_local_pos.xy_valid = true; hil_local_pos.z_valid = true; |