Ideation Code

Takeoff

  1. Get our current altitude to see if we are taking off and set the ground height

  2. Figure out the required takeoff speed

    1. Ask about velocity and how the fixed-wing drone actually takes off

    2. Ask about sensor fusion and how to obtain velocity

  3. Compute the angle to obtain the altitude, longitude, and latitude of the way points

  4. Reverse compute turning point and intersection point based on the required velocity to reach the requested altitude

  5. Send to whoever is controlling the engines

Variables

Sensor fusion

struct SFPathOutput_t{ float altitude; //m float rateOfClimb; //m/s long double latitude; //Decimal degrees float latitudeSpeed; //m/s long double longitude; //Decimal degrees float longitudeSpeed; //m/s };

Attitude Manager Input

struct AttitudeManagerInput { float dist_forward; float dist_right; float dist_up; float magnitude = 0; float heading = 0; double speed = 0; };

Functions

Takeoff

AM::AttitudeManagerInput LandingTakeoffManager::createTakeoffWaypointFixedWing(const LOS::LosSFData & input) { AM::AttitudeManagerInput desiredWaypoint; double currentSpeed = input.airspeed; // rolling stage if (currentSpeed < TAKEOFF_TARGET_SPEED_FIXED_WING) { desiredWaypoint.dist_forward = 1; desiredWaypoint.dist_right = 0; desiredWaypoint.dist_up = 0; desiredWaypoint.speed = TAKEOFF_TARGET_SPEED_FIXED_WING; desiredWaypoint.magnitude = 0; // Use velocity controller } // climbing stage else if(currentSpeed >= TAKEOFF_TARGET_SPEED_FIXED_WING){ desiredWaypoint.dist_forward = 1; desiredWaypoint.dist_right = 0; desiredWaypoint.dist_up = 1; desiredWaypoint.speed = input.rateOfClimb; // TODO: Figure out if this is correct desiredWaypoint.magnitude = 0; // Use velocity controller } return desiredWaypoint; }

Landing

  1. Compute a waypoint that is a certain height above the aiming point

  2. Compute landing waypoint for the flaring state

    1. Figure out the height and speed to start flaring

  3. Compute stopping waypoint

Functions