Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
takeoff_detect.c File Reference

Automatic takeoff assistance for fixed-wing. More...

#include "std.h"
#include "modules/nav/takeoff_detect.h"
#include "autopilot.h"
#include "state.h"
#include "generated/modules.h"
Include dependency graph for takeoff_detect.c:

Go to the source code of this file.

Data Structures

struct  takeoff_detect_struct
 Takeoff detection structure. More...

Macros

#define TAKEOFF_DETECT_LAUNCH_PITCH   RadOfDeg(30.)
 Default pitch angle to trigger launch.
#define TAKEOFF_DETECT_ABORT_PITCH   RadOfDeg(-20.)
 Default pitch angle to cancel launch.
#define TAKEOFF_DETECT_TIMER   2.
 Detection timer in seconds.
#define TAKEOFF_DETECT_DISABLE_TIMER   4.
 Disable timer in seconds.

Enumerations

enum  takeoff_detect_state { TO_DETECT_DISABLED , TO_DETECT_ARMED , TO_DETECT_LAUNCHING }
 Takeoff detection states. More...

Functions

void takeoff_detect_init (void)
 Init function.
void takeoff_detect_start (void)
 Start function called once before periodic.
void takeoff_detect_periodic (void)
 Periodic call.

Variables

static struct takeoff_detect_struct takeoff_detect

Detailed Description

Automatic takeoff assistance for fixed-wing.

The planes's launching can be triggered/aborted by pointing the nose up or down for a given time.

Definition in file takeoff_detect.c.


Data Structure Documentation

◆ takeoff_detect_struct

struct takeoff_detect_struct

Takeoff detection structure.

Definition at line 64 of file takeoff_detect.c.

Data Fields
enum takeoff_detect_state state
uint32_t timer

Macro Definition Documentation

◆ TAKEOFF_DETECT_ABORT_PITCH

#define TAKEOFF_DETECT_ABORT_PITCH   RadOfDeg(-20.)

Default pitch angle to cancel launch.

Definition at line 43 of file takeoff_detect.c.

Referenced by takeoff_detect_periodic().

◆ TAKEOFF_DETECT_DISABLE_TIMER

#define TAKEOFF_DETECT_DISABLE_TIMER   4.

Disable timer in seconds.

Definition at line 53 of file takeoff_detect.c.

Referenced by takeoff_detect_periodic().

◆ TAKEOFF_DETECT_LAUNCH_PITCH

#define TAKEOFF_DETECT_LAUNCH_PITCH   RadOfDeg(30.)

Default pitch angle to trigger launch.

Definition at line 38 of file takeoff_detect.c.

Referenced by takeoff_detect_periodic().

◆ TAKEOFF_DETECT_TIMER

#define TAKEOFF_DETECT_TIMER   2.

Detection timer in seconds.

Definition at line 48 of file takeoff_detect.c.

Referenced by takeoff_detect_periodic().

Enumeration Type Documentation

◆ takeoff_detect_state

Takeoff detection states.

Enumerator
TO_DETECT_DISABLED 
TO_DETECT_ARMED 
TO_DETECT_LAUNCHING 

Definition at line 57 of file takeoff_detect.c.

Function Documentation

◆ takeoff_detect_init()

void takeoff_detect_init ( void )

Init function.

Definition at line 72 of file takeoff_detect.c.

◆ takeoff_detect_periodic()

void takeoff_detect_periodic ( void )

Periodic call.

  • can be enabled or disabled from settings
  • enabled by default, disable himself after launch

Definition at line 85 of file takeoff_detect.c.

References AP_MODE_AUTO1, AP_MODE_AUTO2, autopilot, autopilot_get_mode(), stateGetNedToBodyEulers_f(), takeoff_detect, TAKEOFF_DETECT_ABORT_PITCH, TAKEOFF_DETECT_DISABLE_TIMER, TAKEOFF_DETECT_LAUNCH_PITCH, TAKEOFF_DETECT_TIMER, TO_DETECT_ARMED, TO_DETECT_DISABLED, and TO_DETECT_LAUNCHING.

Here is the call graph for this function:

◆ takeoff_detect_start()

void takeoff_detect_start ( void )

Start function called once before periodic.

Definition at line 78 of file takeoff_detect.c.

References takeoff_detect, and TO_DETECT_ARMED.

Variable Documentation

◆ takeoff_detect

struct takeoff_detect_struct takeoff_detect
static

Definition at line 69 of file takeoff_detect.c.

Referenced by takeoff_detect_periodic(), and takeoff_detect_start().