30#include "generated/airframe.h"
36#define Sign(_x) ((_x) > 0 ? 1 : (-1))
37#define Norm2Pi(x) ({ uint8_t _i=1; float _x = x; while (_i && _x < 0.) { _i++;_x += 2*M_PI; } while (_i && _x > 2*M_PI) { _i++; _x -= 2*M_PI; } _x; })
52 radius =
fabs(radius);
151#define ANGLE_STEP (2.*M_PI/NB_ANGLES)
173 float delta = 4 * (
scal *
scal - c);
#define WaypointAlt(_wp)
waypoint altitude in m above MSL
static float ground_speed
struct GpsState gps
global GPS state
Device independent GPS code (interface)
uint32_t tow
GPS time of week in ms.
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
static float stateGetAirspeed_f(void)
Get airspeed (float).
static struct FloatVect2 * stateGetHorizontalWindspeed_f(void)
Get horizontal windspeed (float).
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.
void nav_route_xy(float last_wp_x, float last_wp_y, float wp_x, float wp_y)
Computes the carrot position along the desired segment.
void nav_circle_XY(float x, float y, float radius)
Navigates around (x, y).
Fixedwing Navigation library.
#define NavQdrCloseTo(x)
True if x (in degrees) is close to the current QDR (less than 10 degrees)
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command.
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
bool snav_init(uint8_t a, float desired_course_rad, float radius)
static float ground_speeds[NB_ANGLES]
bool snav_on_time(float nominal_radius)
static struct point wp_cd wp_td wp_ca wp_ta
static uint8_t ground_speed_timer
static float ground_speed_of_course(float x)
static bool compute_ground_speed(float airspeed, float wind_east, float wind_north)
Smooth navigation to wp_a along an arc (around wp_cd), a segment (from wp_rd to wp_ta) and a second a...
#define CARROT
default approaching_time for a wp
API to get/set the generic vehicle states.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.