Browse Source

ACM: Added a filtered version of Location for GPS lag.

I did this because when you are close to a WP the Yaw angle can go a bit wacky as the location jumps around. The filtered loc is only used in the wp_distance calculation now.
mission-4.1.18
Jason Short 13 years ago
parent
commit
a4bc5950cf
  1. 12
      ArduCopter/ArduCopter.pde

12
ArduCopter/ArduCopter.pde

@ -735,6 +735,8 @@ static struct Location home;
static boolean home_is_set; static boolean home_is_set;
// Current location of the copter // Current location of the copter
static struct Location current_loc; static struct Location current_loc;
// lead filtered loc
static struct Location filtered_loc;
// Next WP is the desired location of the copter - the next waypoint or loiter location // Next WP is the desired location of the copter - the next waypoint or loiter location
static struct Location next_WP; static struct Location next_WP;
// Prev WP is used to get the optimum path from one WP to the next // Prev WP is used to get the optimum path from one WP to the next
@ -746,8 +748,6 @@ static struct Location command_cond_queue;
// Holds the current loaded command from the EEPROM for guided mode // Holds the current loaded command from the EEPROM for guided mode
static struct Location guided_WP; static struct Location guided_WP;
// should we take the waypoint quickly or slow down?
static bool fast_corner;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Crosstrack // Crosstrack
@ -757,6 +757,8 @@ static bool fast_corner;
static int32_t original_target_bearing; static int32_t original_target_bearing;
// The amount of angle correction applied to target_bearing to bring the copter back on its optimum path // The amount of angle correction applied to target_bearing to bring the copter back on its optimum path
static int16_t crosstrack_error; static int16_t crosstrack_error;
// should we take the waypoint quickly or slow down?
static bool fast_corner;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -1533,10 +1535,8 @@ static void update_GPS(void)
} }
} }
// the saving of location moved into calc_XY_velocity current_loc.lng = g_gps->longitude; // Lon * 10^7
current_loc.lat = g_gps->latitude; // Lat * 10^7
//current_loc.lng = g_gps->longitude; // Lon * 10 * *7
//current_loc.lat = g_gps->latitude; // Lat * 10 * *7
calc_XY_velocity(); calc_XY_velocity();

Loading…
Cancel
Save