39 #include "generated/airframe.h"
45 #include "pprzlink/messages.h"
51 #ifndef NAV_CATAPULT_ACCELERATION_THRESHOLD
52 #define NAV_CATAPULT_ACCELERATION_THRESHOLD 1.5 // in g
55 #ifndef NAV_CATAPULT_ACCELERATION_DETECTION
56 #define NAV_CATAPULT_ACCELERATION_DETECTION 5 // number of valid measurements for launch detection
59 #ifndef NAV_CATAPULT_MOTOR_DELAY
60 #define NAV_CATAPULT_MOTOR_DELAY 0.75 // in seconds
63 #ifndef NAV_CATAPULT_HEADING_DELAY
64 #define NAV_CATAPULT_HEADING_DELAY 3.0 // in seconds
67 #ifndef NAV_CATAPULT_INITIAL_PITCH
68 #define NAV_CATAPULT_INITIAL_PITCH RadOfDeg(10) // in radians
71 #ifndef NAV_CATAPULT_INITIAL_THROTTLE
72 #define NAV_CATAPULT_INITIAL_THROTTLE 1.0 // [0, 1]
75 #ifndef NAV_CATAPULT_CLIMB_DISTANCE
76 #define NAV_CATAPULT_CLIMB_DISTANCE 300. // distance of the climb point ahead of catapult
79 #ifndef NAV_CATAPULT_TIMEOUT
80 #define NAV_CATAPULT_TIMEOUT 30. // disarm timeout (in seconds)
151 nav_catapult_nav_catapult_highrate_module_status = MODULES_STOP;
164 if (nav_catapult_nav_catapult_highrate_module_status != MODULES_RUN) {
165 nav_catapult_nav_catapult_highrate_module_status = MODULES_START;
193 float dir_L = sqrtf(dir_x * dir_x + dir_y * dir_y);
214 nav_catapult_nav_catapult_highrate_module_status = MODULES_STOP;
bool launch
request launch
uint32_t timer
internal timer
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define WaypointAlt(_wp)
waypoint altitude in m above MSL
float alt
in meters (above WGS84 reference ellipsoid or above MSL)
#define NAV_CATAPULT_INITIAL_THROTTLE
enum nav_catapult_state status
current procedure state
void nav_catapult_init(void)
#define NAV_CATAPULT_ACCELERATION_THRESHOLD
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
struct nav_catapult_struct nav_catapult
struct pprz_autopilot autopilot
Global autopilot structure.
float initial_throttle
throttle during first take-off phase (in radian)
#define NAV_CATAPULT_MOTOR_DELAY
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
Fixed wing horizontal control.
#define NavGotoWaypoint(_wp)
void float_rmat_transp_vmult(struct FloatVect3 *vb, struct FloatRMat *m_b2a, struct FloatVect3 *va)
rotate 3D vector by transposed rotation matrix.
#define NAV_CATAPULT_TIMEOUT
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command...
float accel_threshold
acceleration threshold for launch detection (in g)
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
void DownlinkSendWpNr(uint8_t _wp)
float heading_delay
delay to estimate initial heading after launch (in seconds)
struct FloatVect3 pos
catapult position
#define NavVerticalThrottleMode(_throttle)
Set the vertical mode to fixed throttle with the specified setpoint.
float initial_pitch
pitch angle during first take-off phase (in radian)
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
void nav_catapult_highrate_module(void)
#define NAV_CATAPULT_CLIMB_DISTANCE
Core autopilot interface common to all firmwares.
#define NavAttitude(_roll)
catapult launch timing system
#define NAV_CATAPULT_ACCELERATION_DETECTION
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
API to get/set the generic vehicle states.
Common code for AP and FBW telemetry.
#define NAV_CATAPULT_INITIAL_PITCH
bool nav_approaching_xy(float x, float y, float from_x, float from_y, float approaching_time)
Decide if the UAV is approaching the current waypoint.
Fixedwing Navigation library.
bool nav_catapult_run(uint8_t _climb)
float motor_delay
delay to start motor after launch detection (in seconds)
#define NAV_CATAPULT_HEADING_DELAY