15 #include "autopilot.h"
17 #include "generated/flight_plan.h"
18 #include "generated/airframe.h"
19 #include "dl_protocol.h"
39 #define FORM_CARROT 2.
42 #ifndef FORM_POS_PGAIN
43 #define FORM_POS_PGAIN 0.
46 #ifndef FORM_SPEED_PGAIN
47 #define FORM_SPEED_PGAIN 0.
50 #ifndef FORM_COURSE_PGAIN
51 #define FORM_COURSE_PGAIN 0.
54 #ifndef FORM_ALTITUDE_PGAIN
55 #define FORM_ALTITUDE_PGAIN 0.
79 old_cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
80 old_alt = GROUND_ALT + SECURITY_HEIGHT;
99 for (i = 0; i <
NB_ACS; ++i) {
114 for (i = 0; i <
NB_ACS; ++i) {
121 old_cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
123 old_alt = GROUND_ALT + SECURITY_HEIGHT;
134 float ch = cosf(hspeed_dir);
135 float sh = sinf(hspeed_dir);
173 struct slot_ form[NB_ACS];
174 float cr = 0., sr = 1.;
176 cr = cosf(leader->
course);
177 sr = sinf(leader->
course);
179 for (i = 0; i <
NB_ACS; ++i) {
187 for (i = 0; i <
NB_ACS; ++i) {
188 if (
the_acs[i].ac_id == AC_ID) {
continue; }
253 float cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
255 Bound(cruise, V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE);
float flight_altitude
Dynamically adjustable, reset to nav_altitude when it is changing.
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
uint8_t the_acs_id[NB_ACS_ID]
struct ac_info_ the_acs[NB_ACS]
float alt
in meters above WGS84 reference ellipsoid
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
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.
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.
#define SetAcInfo(_id, _utm_x, _utm_y, _course, _alt, _gspeed, _climb, _itow)
#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.
struct GpsState gps
global GPS state