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);
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 ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
Common code for AP and FBW telemetry.
float v_ctl_auto_throttle_cruise_throttle
Vertical control for fixed wing vehicles.
struct GpsState gps
global GPS state
uint32_t tow
GPS time of week in ms.
static struct EnuCoor_f * acInfoGetPositionEnu_f(uint8_t ac_id)
Get position in local ENU coordinates (float).
static float acInfoGetCourse(uint8_t ac_id)
Get vehicle course (float).
static float acInfoGetGspeed(uint8_t ac_id)
Get vehicle ground speed (float).
static uint32_t acInfoGetItow(uint8_t ac_id)
Get time of week from latest message (ms).
struct acInfo ti_acs[NB_ACS]
uint8_t ti_acs_id[NB_ACS_ID]
static struct EnuCoor_f * acInfoGetVelocityEnu_f(uint8_t ac_id)
Get position from ENU coordinates (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
float flight_altitude
Dynamically adjustable, reset to nav_altitude when it is changing.
void fly_to_xy(float x, float y)
Computes desired_x, desired_y and desired_course.
Fixedwing Navigation library.
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
vector in East North Up coordinates Units: meters
API to get/set the generic vehicle states.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.