17 #include "generated/flight_plan.h"
35 #define FORM_CARROT 2.
38 #ifndef FORM_POS_PGAIN
39 #define FORM_POS_PGAIN 0.
42 #ifndef FORM_SPEED_PGAIN
43 #define FORM_SPEED_PGAIN 0.
46 #ifndef FORM_COURSE_PGAIN
47 #define FORM_COURSE_PGAIN 0.
50 #ifndef FORM_ALTITUDE_PGAIN
51 #define FORM_ALTITUDE_PGAIN 0.
75 old_cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
82 if (_id != AC_ID &&
ti_acs_id[_id] == 0) {
return false; }
95 for (i = 0; i <
NB_ACS; ++i) {
110 for (i = 0; i <
NB_ACS; ++i) {
117 old_cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
129 float ch = cosf(hspeed_dir);
130 float sh = sinf(hspeed_dir);
165 struct slot_ form[NB_ACS];
166 float cr = 0., sr = 1.;
171 for (i = 0; i <
NB_ACS; ++i) {
180 for (i = 0; i <
NB_ACS; ++i) {
181 if (
ti_acs[i].ac_id == AC_ID) {
continue; }
194 form_e += (ac->
x + ac_speed->
x * delta_t - my_pos->
x) - (form[i].east - form[
ti_acs_id[AC_ID]].east);
195 form_n += (ac->
y + ac_speed->
y * delta_t - my_pos->
y) - (form[i].north - form[
ti_acs_id[AC_ID]].north);
196 form_a += (ac->
z + ac_speed->
z * delta_t - my_pos->
z) - (form[i].alt - form[
ti_acs_id[AC_ID]].alt);
246 float cruise = V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE;
248 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).
static float acInfoGetGspeed(uint8_t ac_id)
Get vehicle ground speed (float).
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
vector in East North Up coordinates Units: meters
static float acInfoGetCourse(uint8_t ac_id)
Get vehicle course (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
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.
uint32_t tow
GPS time of week in ms.
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.
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.
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.
Fixedwing Navigation library.
struct GpsState gps
global GPS state
uint8_t ti_acs_id[NB_ACS_ID]