From d962e6c403678e14a64a6b01be8773e98660bb24 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 6 Feb 2013 13:50:32 -0800 Subject: Removed some unnecessairy flags, home position back working --- apps/commander/commander.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/commander') diff --git a/apps/commander/commander.c b/apps/commander/commander.c index f19f1d0e6..6b1bc0f9b 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1683,7 +1683,8 @@ int commander_thread_main(int argc, char *argv[]) /* check if gps fix is ok */ // XXX magic number - float dop_threshold_m = 2.0f; + float hdop_threshold_m = 4.0f; + float vdop_threshold_m = 8.0f; /* * If horizontal dilution of precision (hdop / eph) @@ -1694,8 +1695,10 @@ int commander_thread_main(int argc, char *argv[]) * the system is currently not armed, set home * position to the current position. */ - if (gps_position.fix_type == GPS_FIX_TYPE_3D && (hdop_m < dop_threshold_m) - && (vdop_m < dop_threshold_m) + + if (gps_position.fix_type == GPS_FIX_TYPE_3D + && (hdop_m < hdop_threshold_m) + && (vdop_m < vdop_threshold_m) && !home_position_set && (hrt_absolute_time() - gps_position.timestamp_position < 2000000) && !current_status.flag_system_armed) { -- cgit v1.2.3