41 #define CMD_OF_SAT 1500
44 #ifndef VISION_PHI_PGAIN
45 #define VISION_PHI_PGAIN 400
49 #ifndef VISION_PHI_IGAIN
50 #define VISION_PHI_IGAIN 20
54 #ifndef VISION_THETA_PGAIN
55 #define VISION_THETA_PGAIN 400
59 #ifndef VISION_THETA_IGAIN
60 #define VISION_THETA_IGAIN 20
64 #ifndef VISION_DESIRED_VX
65 #define VISION_DESIRED_VX 0
69 #ifndef VISION_DESIRED_VY
70 #define VISION_DESIRED_VY 0
75 #if (VISION_PHI_PGAIN < 0) || \
76 (VISION_PHI_IGAIN < 0) || \
77 (VISION_THETA_PGAIN < 0) || \
78 (VISION_THETA_IGAIN < 0)
79 #error "ALL control gains have to be positive!!!"
193 float s_psi = sin(psi);
194 float c_psi = cos(psi);
202 v_x = speed_cur.
y * 100;
203 v_y = speed_cur.
x * 100;
299 float v_desired_total;
Core autopilot interface common to all firmwares.
Common code for AP and FBW telemetry.
Interface for electrical status: supply voltage, current, battery status, etc.
int32_t phi
in rad with INT32_ANGLE_FRAC
int32_t psi
in rad with INT32_ANGLE_FRAC
int32_t theta
in rad with INT32_ANGLE_FRAC
#define ANGLE_BFP_OF_REAL(_af)
#define INT32_ANGLE_NORMALIZE(_a)
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
struct NedCoor_f opti_speed_read
struct opticflow_stab_t opticflow_stab
struct FloatVect3 Total_force
#define VISION_THETA_PGAIN
#define VISION_DESIRED_VY
void guidance_module_enter(void)
Horizontal guidance mode enter resets the errors and starts the controller.
int8_t repulsionforce_filter_flag
void guidance_module_run(bool in_flight)
Main guidance loop.
#define VISION_DESIRED_VX
#define VISION_THETA_IGAIN
void OA_update()
Update the controls based on a vision result.
Guidance for the obstacle avoidance methods.
float err_vx_int
The integrated velocity error in x direction (m/s)
struct Int32Eulers cmd
The commands that are send to the hover loop.
float err_vy_int
The integrated velocity error in y direction (m/s)
int32_t theta_pgain
The pitch P gain on the err_vy.
int32_t theta_igain
The pitch I gain on the err_vy_int.
float desired_vy
The desired velocity in the y direction (cm/s)
float desired_vx
The desired velocity in the x direction (cm/s)
int32_t phi_pgain
The roll P gain on the err_vx.
int32_t phi_igain
The roll I gain on the err_vx_int.
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
vector in North East Down coordinates Units: meters
void guidance_v_mode_changed(uint8_t new_mode)
struct ThrustSetpoint guidance_v_run(bool in_flight)
Guidance vertical run functions.
Vertical guidance for rotorcrafts.
#define GUIDANCE_V_MODE_HOVER
General attitude stabilization interface for rotorcrafts.
void stabilization_attitude_run(bool in_flight, struct StabilizationSetpoint *sp, struct ThrustSetpoint *thrust, int32_t *cmd)
Attitude control run function.
struct Stabilization stabilization
struct StabilizationSetpoint stab_sp_from_eulers_i(struct Int32Eulers *eulers)
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
union StabilizationSetpoint::@278 sp
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
union ThrustSetpoint::@284 sp
Periodic telemetry system header (includes downlink utility and generated code).
int int32_t
Typedef defining 32 bit int type.
signed char int8_t
Typedef defining 8 bit char type.