Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_OA.c File Reference

Guidance for the obstacle avoidance methods. More...

+ Include dependency graph for guidance_OA.c:

Go to the source code of this file.

Macros

#define CMD_OF_SAT   1500
 
#define VISION_PHI_PGAIN   400
 
#define VISION_PHI_IGAIN   20
 
#define VISION_THETA_PGAIN   400
 
#define VISION_THETA_IGAIN   20
 
#define VISION_DESIRED_VX   0
 
#define VISION_DESIRED_VY   0
 

Functions

void guidance_module_enter (void)
 Horizontal guidance mode enter resets the errors and starts the controller. More...
 
void guidance_module_run (bool in_flight)
 Main guidance loop. More...
 
void OA_update ()
 Update the controls based on a vision result. More...
 

Variables

struct opticflow_stab_t opticflow_stab
 
int8_t filter_flag = 0
 
int8_t repulsionforce_filter_flag = 0
 
oa_method OA_method_flag
 
int8_t opti_speed_flag = 1
 
float vref_max = 100
 
float ref_pitch = 0.0
 
float ref_roll = 0.0
 
float r_dot_new = 0.0
 
float desired_vx = 0.0
 
float desired_vy = 0.0
 
float speed_pot = 0.0
 
float yaw_diff = 0.0
 
float alpha_fil = 1.0
 
float heading_target = 0
 
float new_heading = 0
 
float v_desired = 0.0
 
int32_t yaw_rate = 0
 
float yaw_rate_write = 0
 
float yaw_ref_write = 0
 
int32_t keep_yaw_rate = 0
 
int32_t keep_turning = 0
 
float err_vx = 0
 
float err_vy = 0
 
float Total_Kan_x = 0
 
float Total_Kan_y = 0
 
struct NedCoor_f opti_speed_read
 
struct FloatVect3 Total_force = {0, 0, 0}
 

Detailed Description

Guidance for the obstacle avoidance methods.

Definition in file guidance_OA.c.

Macro Definition Documentation

◆ CMD_OF_SAT

#define CMD_OF_SAT   1500

Definition at line 41 of file guidance_OA.c.

◆ VISION_DESIRED_VX

#define VISION_DESIRED_VX   0

Definition at line 65 of file guidance_OA.c.

◆ VISION_DESIRED_VY

#define VISION_DESIRED_VY   0

Definition at line 70 of file guidance_OA.c.

◆ VISION_PHI_IGAIN

#define VISION_PHI_IGAIN   20

Definition at line 50 of file guidance_OA.c.

◆ VISION_PHI_PGAIN

#define VISION_PHI_PGAIN   400

Definition at line 45 of file guidance_OA.c.

◆ VISION_THETA_IGAIN

#define VISION_THETA_IGAIN   20

Definition at line 60 of file guidance_OA.c.

◆ VISION_THETA_PGAIN

#define VISION_THETA_PGAIN   400

Definition at line 55 of file guidance_OA.c.

Function Documentation

◆ guidance_module_enter()

void guidance_module_enter ( void  )

Horizontal guidance mode enter resets the errors and starts the controller.

Entering the module (user switched to module)

Definition at line 142 of file guidance_OA.c.

References opticflow_stab_t::cmd, opticflow_stab_t::err_vx_int, opticflow_stab_t::err_vy_int, guidance_v_mode_changed(), GUIDANCE_V_MODE_HOVER, new_heading, opticflow_stab, Int32Eulers::phi, Int32Eulers::psi, stateGetNedToBodyEulers_i(), and Int32Eulers::theta.

+ Here is the call graph for this function:

◆ guidance_module_run()

void guidance_module_run ( bool  in_flight)

Main guidance loop.

Parameters
[in]in_flightWhether we are in flight or not

Definition at line 164 of file guidance_OA.c.

References Stabilization::cmd, opticflow_stab_t::cmd, guidance_v_run(), OA_update(), opticflow_stab, StabilizationSetpoint::sp, ThrustSetpoint::sp, stab_sp_from_eulers_i(), stabilization, and stabilization_attitude_run().

+ Here is the call graph for this function:

◆ OA_update()

Variable Documentation

◆ alpha_fil

float alpha_fil = 1.0

Definition at line 112 of file guidance_OA.c.

Referenced by CN_potential_velocity(), and OA_update().

◆ desired_vx

float desired_vx = 0.0

Definition at line 108 of file guidance_OA.c.

◆ desired_vy

float desired_vy = 0.0

Definition at line 109 of file guidance_OA.c.

◆ err_vx

float err_vx = 0

Definition at line 123 of file guidance_OA.c.

Referenced by OA_update(), and stabilization_opticflow_vel_cb().

◆ err_vy

float err_vy = 0

Definition at line 124 of file guidance_OA.c.

Referenced by OA_update(), and stabilization_opticflow_vel_cb().

◆ filter_flag

int8_t filter_flag = 0

Definition at line 93 of file guidance_OA.c.

◆ heading_target

float heading_target = 0

Definition at line 113 of file guidance_OA.c.

◆ keep_turning

int32_t keep_turning = 0

Definition at line 121 of file guidance_OA.c.

◆ keep_yaw_rate

int32_t keep_yaw_rate = 0

Definition at line 120 of file guidance_OA.c.

◆ new_heading

◆ OA_method_flag

oa_method OA_method_flag
Initial value:
=
@ PINGPONG
Definition: guidance_OA.h:52

Definition at line 96 of file guidance_OA.c.

Referenced by CN_calculate_target(), OA_update(), and serial_update().

◆ opti_speed_flag

int8_t opti_speed_flag = 1

Definition at line 98 of file guidance_OA.c.

Referenced by OA_update().

◆ opti_speed_read

struct NedCoor_f opti_speed_read

Definition at line 127 of file guidance_OA.c.

Referenced by OA_update().

◆ opticflow_stab

struct opticflow_stab_t opticflow_stab
Initial value:
= {
.phi_pgain = VISION_PHI_PGAIN,
.phi_igain = VISION_PHI_IGAIN,
.theta_pgain = VISION_THETA_PGAIN,
.theta_igain = VISION_THETA_IGAIN,
.desired_vx = VISION_DESIRED_VX,
.desired_vy = VISION_DESIRED_VY
}
#define VISION_THETA_PGAIN
Definition: guidance_OA.c:55
#define VISION_DESIRED_VY
Definition: guidance_OA.c:70
#define VISION_DESIRED_VX
Definition: guidance_OA.c:65
#define VISION_PHI_PGAIN
Definition: guidance_OA.c:45
#define VISION_PHI_IGAIN
Definition: guidance_OA.c:50
#define VISION_THETA_IGAIN
Definition: guidance_OA.c:60

Definition at line 1 of file guidance_OA.c.

Referenced by guidance_module_enter(), guidance_module_run(), and OA_update().

◆ r_dot_new

float r_dot_new = 0.0

Definition at line 107 of file guidance_OA.c.

Referenced by CN_potential_heading(), CN_potential_velocity(), and OA_update().

◆ ref_pitch

◆ ref_roll

float ref_roll = 0.0

◆ repulsionforce_filter_flag

int8_t repulsionforce_filter_flag = 0

Definition at line 94 of file guidance_OA.c.

Referenced by CN_vector_escape_velocity(), and CN_vector_velocity().

◆ speed_pot

float speed_pot = 0.0

◆ Total_force

struct FloatVect3 Total_force = {0, 0, 0}

Definition at line 127 of file guidance_OA.c.

◆ Total_Kan_x

float Total_Kan_x = 0

Definition at line 126 of file guidance_OA.c.

Referenced by OA_update().

◆ Total_Kan_y

float Total_Kan_y = 0

Definition at line 127 of file guidance_OA.c.

Referenced by OA_update().

◆ v_desired

float v_desired = 0.0

Definition at line 115 of file guidance_OA.c.

◆ vref_max

float vref_max = 100

◆ yaw_diff

float yaw_diff = 0.0

Definition at line 111 of file guidance_OA.c.

◆ yaw_rate

int32_t yaw_rate = 0

Definition at line 117 of file guidance_OA.c.

Referenced by OA_update().

◆ yaw_rate_write

float yaw_rate_write = 0

Definition at line 118 of file guidance_OA.c.

◆ yaw_ref_write

float yaw_ref_write = 0

Definition at line 119 of file guidance_OA.c.