9 #include "dl_protocol.h"
15 #include "autopilot.h"
17 #include "generated/airframe.h"
27 #ifndef FORCE_POS_GAIN
28 #define FORCE_POS_GAIN 1.
31 #ifndef FORCE_SPEED_GAIN
32 #define FORCE_SPEED_GAIN 1.
35 #ifndef FORCE_CLIMB_GAIN
36 #define FORCE_CLIMB_GAIN 1.
39 #ifndef FORCE_MAX_DIST
40 #define FORCE_MAX_DIST 100.
69 for (i = 0; i <
NB_ACS; ++i) {
74 if (delta_t >
CARROT) {
continue; }
76 float sha = sinf(ac->
course);
77 float cha = cosf(ac->
course);
84 float dist = sqrtf(de * de + dn * dn + da * da);
85 if (dist == 0.) {
continue; }
89 float scal = dve * de + dvn * dn + dva * da;
90 if (scal < 0.) {
continue; }
91 float d3 = dist * dist * dist;
98 if (nb == 0) {
return TRUE; }
115 float cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
117 Bound(cruise, V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE);
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
struct ac_info_ the_acs[NB_ACS]
float alt
in meters above WGS84 reference ellipsoid
#define NavVerticalClimbMode(_climb)
Set the vertical mode to climb control with the specified climb setpoint.
struct force_ potential_force
#define V_CTL_ALTITUDE_MAX_CLIMB
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
struct ac_info_ * get_ac_info(uint8_t id)
Fixed wing horizontal control.
Vertical control for fixed wing vehicles.
flying with potential field to avoid collision
uint32_t tow
GPS time of week in ms.
Device independent GPS code (interface)
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
void potential_init(void)
#define DefaultChannel
SITL.
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
float v_ctl_auto_throttle_cruise_throttle
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
API to get/set the generic vehicle states.
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
void fly_to_xy(float x, float y)
Computes desired_x, desired_y and desired_course.
Common code for AP and FBW telemetry.
#define CARROT
default approaching_time for a wp
struct GpsState gps
global GPS state