aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-04-25 09:44:40 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-04-25 09:44:40 +0200
commit5285eb2f997b590071186a8f695af4375f96e779 (patch)
tree23618c1f447ef9c67cbc9b5cd59c6bcf2d20738c /src
parent7e1ea35571149a9d766cc7122738f206f1ed3427 (diff)
downloadpx4-firmware-5285eb2f997b590071186a8f695af4375f96e779.tar.gz
px4-firmware-5285eb2f997b590071186a8f695af4375f96e779.tar.bz2
px4-firmware-5285eb2f997b590071186a8f695af4375f96e779.zip
fw att pos estimator: use map projection reference values for local pos
Diffstat (limited to 'src')
-rw-r--r--src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
index 420a03644..45ca13a7f 100644
--- a/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
+++ b/src/modules/fw_att_pos_estimator/fw_att_pos_estimator_main.cpp
@@ -797,7 +797,7 @@ FixedwingEstimator::task_main()
if (hrt_elapsed_time(&start_time) > 100000) {
- if (!_gps_initialized && (_ekf->GPSstatus == 3)) {
+ if (!_gps_initialized && (_ekf->GPSstatus == 3) && map_projection_initialized()) {
_ekf->velNED[0] = _gps.vel_n_m_s;
_ekf->velNED[1] = _gps.vel_e_m_s;
_ekf->velNED[2] = _gps.vel_d_m_s;
@@ -809,10 +809,9 @@ FixedwingEstimator::task_main()
_ekf->InitialiseFilter(_ekf->velNED);
// Initialize projection
- _local_pos.ref_lat = _gps.lat;
- _local_pos.ref_lon = _gps.lon;
+ map_projection_reference(&_local_pos.ref_lat, &_local_pos.ref_lon);
_local_pos.ref_alt = alt;
- _local_pos.ref_timestamp = _gps.timestamp_position;
+ _local_pos.ref_timestamp = map_projection_timestamp();
// Store
orb_copy(ORB_ID(sensor_baro), _baro_sub, &_baro);