Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
nav_bungee_takeoff.c File Reference

Takeoff functions for bungee takeoff. More...

#include "modules/nav/nav_bungee_takeoff.h"
#include "state.h"
#include "paparazzi.h"
#include "firmwares/fixedwing/nav.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "generated/airframe.h"
#include "math/pprz_algebra_float.h"
+ Include dependency graph for nav_bungee_takeoff.c:

Go to the source code of this file.

Macros

#define BUNGEE_TAKEOFF_DISTANCE   10.0
 
#define BUNGEE_TAKEOFF_HEIGHT   30.0
 
#define BUNGEE_TAKEOFF_MIN_SPEED   5.0
 
#define BUNGEE_TAKEOFF_THROTTLE   1.0
 
#define BUNGEE_TAKEOFF_PITCH   RadOfDeg(15.)
 

Enumerations

enum  TakeoffStatus { Launch , Throttle , Finished }
 

Functions

static void compute_points_from_bungee (void)
 
void nav_bungee_takeoff_setup (uint8_t bungee_wp)
 Initialization function. More...
 
bool nav_bungee_takeoff_run (void)
 Bungee takeoff run function. More...
 

Variables

static enum TakeoffStatus CTakeoffStatus
 
static struct FloatVect2 init_point
 
static struct FloatVect2 throttle_point
 
static struct FloatVect2 takeoff_dir
 
static struct FloatVect3 bungee_point
 

Detailed Description

Takeoff functions for bungee takeoff.

Run initialize function when the plane is on the bungee, the bungee is fully extended and you are ready to launch the plane. After initialized, the plane will follow a line drawn by the position of the plane on initialization and the position of the bungee (given in the arguments). Once the plane crosses the throttle line, which is perpendicular to the line the plane is following, and intersects the position of the bungee (plus or minus a fixed distance (BUNGEE_TAKEOFF_DISTANCE in airframe file) from the bungee just in case the bungee doesn't release exactly above the bungee) the prop will come on. The plane will then continue to follow the line until it has reached a specific height (defined in as BUNGEE_TAKEOFF_HEIGHT in airframe file) above the bungee waypoint and airspeed (defined as BUNGEE_TAKEOFF_AIRSPEED in the airframe file). The airspeed limit is only used if USE_AIRSPEED flag is defined or set to true (and assuming the airspeed is then available). It is also possible to specify the pitch angle (BUNGEE_TAKEOFF_PITCH) and the throttle (BUNGEE_TAKEOFF_THROTTLE, between 0 and 1).

* <section name="BUNGEE" prefix="BUNGEE_TAKEOFF_">
*   <define name="HEIGHT" value="30" unit="m"/>
*   <define name="AIRSPEED" value="15" unit="m/s"/>
*   <define name="DISTANCE" value="10" unit="m"/>
*   <define name="MIN_SPEED" value="5" unit="m/s"/>
*   <define name="PITCH" value="15." unit="deg"/>
*   <define name="THROTTLE" value="1.0"/>
* </section>
* 

initial code from OSAM advanced navigation routines

Definition in file nav_bungee_takeoff.c.

Macro Definition Documentation

◆ BUNGEE_TAKEOFF_DISTANCE

#define BUNGEE_TAKEOFF_DISTANCE   10.0

Definition at line 91 of file nav_bungee_takeoff.c.

◆ BUNGEE_TAKEOFF_HEIGHT

#define BUNGEE_TAKEOFF_HEIGHT   30.0

Definition at line 94 of file nav_bungee_takeoff.c.

◆ BUNGEE_TAKEOFF_MIN_SPEED

#define BUNGEE_TAKEOFF_MIN_SPEED   5.0

Definition at line 106 of file nav_bungee_takeoff.c.

◆ BUNGEE_TAKEOFF_PITCH

#define BUNGEE_TAKEOFF_PITCH   RadOfDeg(15.)

Definition at line 115 of file nav_bungee_takeoff.c.

◆ BUNGEE_TAKEOFF_THROTTLE

#define BUNGEE_TAKEOFF_THROTTLE   1.0

Definition at line 109 of file nav_bungee_takeoff.c.

Enumeration Type Documentation

◆ TakeoffStatus

Enumerator
Launch 
Throttle 
Finished 

Definition at line 119 of file nav_bungee_takeoff.c.

Function Documentation

◆ compute_points_from_bungee()

static void compute_points_from_bungee ( void  )
static

Definition at line 132 of file nav_bungee_takeoff.c.

References bungee_point, BUNGEE_TAKEOFF_DISTANCE, float_vect2_normalize(), init_point, stateGetPositionEnu_f(), takeoff_dir, throttle_point, VECT2_ASSIGN, VECT2_DIFF, VECT2_SMUL, VECT2_SUM, FloatVect3::x, and FloatVect3::y.

Referenced by nav_bungee_takeoff_run(), and nav_bungee_takeoff_setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nav_bungee_takeoff_run()

◆ nav_bungee_takeoff_setup()

void nav_bungee_takeoff_setup ( uint8_t  bungee_wp)

Initialization function.

called in the flight plan before the 'run' function

Parameters
[in]bungee_wpWaypoint ID correcponding to the bungee location

Definition at line 145 of file nav_bungee_takeoff.c.

References autopilot_set_kill_throttle(), bungee_point, compute_points_from_bungee(), CTakeoffStatus, Launch, stateGetPositionUtm_f(), VECT3_ASSIGN, WaypointX, and WaypointY.

+ Here is the call graph for this function:

Variable Documentation

◆ bungee_point

struct FloatVect3 bungee_point
static

◆ CTakeoffStatus

enum TakeoffStatus CTakeoffStatus
static

Definition at line 1 of file nav_bungee_takeoff.c.

Referenced by nav_bungee_takeoff_run(), and nav_bungee_takeoff_setup().

◆ init_point

struct FloatVect2 init_point
static

Definition at line 1 of file nav_bungee_takeoff.c.

Referenced by compute_points_from_bungee(), and nav_bungee_takeoff_run().

◆ takeoff_dir

struct FloatVect2 takeoff_dir
static

Definition at line 1 of file nav_bungee_takeoff.c.

Referenced by compute_points_from_bungee(), and nav_bungee_takeoff_run().

◆ throttle_point

struct FloatVect2 throttle_point
static

Definition at line 1 of file nav_bungee_takeoff.c.

Referenced by compute_points_from_bungee(), and nav_bungee_takeoff_run().