9 #include "pprzlink/dl_protocol.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.
71 for (i = 0; i <
NB_ACS; ++i) {
77 if (delta_t >
CARROT) {
continue; }
85 float dist = sqrtf(de * de + dn * dn + da * da);
86 if (dist == 0.) {
continue; }
90 float scal = dve * de + dvn * dn + dva * da;
91 if (scal < 0.) {
continue; }
92 float d3 = dist * dist * dist;
99 if (nb == 0) {
return true; }
116 float cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
118 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).
vector in East North Up coordinates Units: meters
#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).
Fixed wing horizontal control.
static struct EnuCoor_f * acInfoGetPositionEnu_f(uint8_t ac_id)
Get position in local ENU coordinates (float).
static uint32_t acInfoGetItow(uint8_t ac_id)
Get time of week from latest message (ms).
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)
static struct EnuCoor_f * acInfoGetVelocityEnu_f(uint8_t ac_id)
Get position from ENU coordinates (float).
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
void potential_init(void)
Core autopilot interface common to all firmwares.
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
float v_ctl_auto_throttle_cruise_throttle
API to get/set the generic vehicle states.
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
struct acInfo ti_acs[NB_ACS]
void fly_to_xy(float x, float y)
Computes desired_x, desired_y and desired_course.
Common code for AP and FBW telemetry.
struct GpsState gps
global GPS state
#define CARROT
default approaching_time for a wp