Just a little more commenting work on global variables

This commit is contained in:
Doug Weibel 2012-01-15 16:11:02 -07:00
parent 69c7598db2
commit 0306bf97a0
2 changed files with 17 additions and 5 deletions

View File

@ -418,6 +418,7 @@ static byte led_mode = NORMAL_LEDS;
static const float t7 = 10000000.0;
// We use atan2 and other trig techniques to calaculate angles
// We need to scale the longitude up to make these calcs work
// to account for decreasing distance between lines of longitude away from the equator
static float scaleLongUp = 1;
// Sometimes we need to remove the scaling for distance calcs
static float scaleLongDown = 1;

View File

@ -354,14 +354,25 @@ static int ground_start_avg;
// If we do not detect GPS at startup, we stop trying and assume GPS is not connected
static bool GPS_enabled = false;
////////////////////////////////////////////////////////////////////////////////
// Location & Navigation
// ---------------------
////////////////////////////////////////////////////////////////////////////////
// Constants
const float radius_of_earth = 6378100; // meters
const float gravity = 9.81; // meters/ sec^2
static long nav_bearing; // deg * 100 : 0 to 360 current desired bearing to navigate
static long target_bearing; // deg * 100 : 0 to 360 location of the plane to the target
static long crosstrack_bearing; // deg * 100 : 0 to 360 desired angle of plane to target
static float nav_gain_scaler = 1; // Gain scaling for headwind/tailwind TODO: why does this variable need to be initialized to 1?
// This is the currently calculated direction to fly.
// deg * 100 : 0 to 360
static long nav_bearing;
// This is the direction to the next waypoint or loiter center
// deg * 100 : 0 to 360
static long target_bearing;
//This is the direction from the last waypoint to the next waypoint
// deg * 100 : 0 to 360
static long crosstrack_bearing;
// A gain scaler to account for ground speed/headwind/tailwind
static float nav_gain_scaler = 1;
// Direction held during phases of takeoff and landing
// deg * 100 dir of plane, A value of -1 indicates the course has not been set/is not in use
static long hold_course = -1; // deg * 100 dir of plane
static byte nav_command_index; // active nav command memory location