|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
Guidance for the obstacle avoidance methods. More...
#include "guidance_OA.h"#include <stdio.h>#include "firmwares/rotorcraft/stabilization/stabilization_attitude.h"#include "firmwares/rotorcraft/guidance/guidance_v.h"#include "autopilot.h"#include "modules/datalink/downlink.h"#include "modules/datalink/telemetry.h"#include "modules/energy/electrical.h"#include "std.h" Include dependency graph for guidance_OA.c:
 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. | |
| void | guidance_module_run (bool in_flight) | 
| Main guidance loop. | |
| void | OA_update () | 
| Update the controls based on a vision result. | |
| 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} | 
Guidance for the obstacle avoidance methods.
Definition in file guidance_OA.c.
| #define CMD_OF_SAT 1500 | 
Definition at line 41 of file guidance_OA.c.
| #define VISION_DESIRED_VX 0 | 
Definition at line 65 of file guidance_OA.c.
| #define VISION_DESIRED_VY 0 | 
Definition at line 70 of file guidance_OA.c.
| #define VISION_PHI_IGAIN 20 | 
Definition at line 50 of file guidance_OA.c.
| #define VISION_PHI_PGAIN 400 | 
Definition at line 45 of file guidance_OA.c.
| #define VISION_THETA_IGAIN 20 | 
Definition at line 60 of file guidance_OA.c.
| #define VISION_THETA_PGAIN 400 | 
Definition at line 55 of file guidance_OA.c.
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:
 Here is the call graph for this function:Main guidance loop.
| [in] | in_flight | Whether we are in flight or not | 
Definition at line 164 of file guidance_OA.c.
References Stabilization::cmd, opticflow_stab_t::cmd, foo, 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:
 Here is the call graph for this function:Update the controls based on a vision result.
| [in] | *result | The opticflow calculation result used for control | 
Definition at line 177 of file guidance_OA.c.
References alpha_fil, ANGLE_BFP_OF_REAL, opticflow_stab_t::cmd, CMD_OF_SAT, opticflow_stab_t::desired_vx, opticflow_stab_t::desired_vy, err_vx, opticflow_stab_t::err_vx_int, err_vy, opticflow_stab_t::err_vy_int, foo, INT32_ANGLE_NORMALIZE, LOGICBASED, new_heading, NO_OBSTACLE_AVOIDANCE, OA_method_flag, opti_speed_flag, opti_speed_read, opticflow_stab, Int32Eulers::phi, opticflow_stab_t::phi_igain, opticflow_stab_t::phi_pgain, PINGPONG, POT_HEADING, FloatEulers::psi, Int32Eulers::psi, r_dot_new, ref_pitch, ref_roll, SAFETYZONE, speed_pot, stateGetNedToBodyEulers_f(), stateGetNedToBodyEulers_i(), stateGetSpeedNed_f(), Int32Eulers::theta, opticflow_stab_t::theta_igain, opticflow_stab_t::theta_pgain, Total_Kan_x, Total_Kan_y, vref_max, NedCoor_f::x, NedCoor_f::y, and yaw_rate.
Referenced by guidance_module_run().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| float alpha_fil = 1.0 | 
Definition at line 112 of file guidance_OA.c.
Referenced by CN_potential_velocity(), and OA_update().
| float desired_vx = 0.0 | 
Definition at line 108 of file guidance_OA.c.
| float desired_vy = 0.0 | 
Definition at line 109 of file guidance_OA.c.
| float err_vx = 0 | 
Definition at line 123 of file guidance_OA.c.
Referenced by OA_update(), and stabilization_opticflow_vel_cb().
| float err_vy = 0 | 
Definition at line 124 of file guidance_OA.c.
Referenced by OA_update(), and stabilization_opticflow_vel_cb().
| int8_t filter_flag = 0 | 
Definition at line 93 of file guidance_OA.c.
| float heading_target = 0 | 
Definition at line 113 of file guidance_OA.c.
| int32_t keep_turning = 0 | 
Definition at line 121 of file guidance_OA.c.
| int32_t keep_yaw_rate = 0 | 
Definition at line 120 of file guidance_OA.c.
| float new_heading = 0 | 
Definition at line 114 of file guidance_OA.c.
Referenced by CN_escape_velocity(), CN_potential_velocity(), CN_vector_escape_velocity(), guidance_module_enter(), increase_nav_heading(), increase_nav_heading(), nav_fish_velocity_run(), and OA_update().
| oa_method OA_method_flag | 
Definition at line 96 of file guidance_OA.c.
Referenced by CN_calculate_target(), OA_update(), and serial_update().
| int8_t opti_speed_flag = 1 | 
Definition at line 98 of file guidance_OA.c.
Referenced by OA_update().
| struct NedCoor_f opti_speed_read | 
Definition at line 129 of file guidance_OA.c.
Referenced by OA_update().
| struct opticflow_stab_t opticflow_stab | 
Definition at line 83 of file guidance_OA.c.
Referenced by guidance_module_enter(), guidance_module_run(), and OA_update().
| 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().
| float ref_pitch = 0.0 | 
Definition at line 103 of file guidance_OA.c.
Referenced by CN_escape_velocity(), CN_potential_velocity(), CN_vector_escape_velocity(), CN_vector_velocity(), OA_update(), and pingpong_euler().
| float ref_roll = 0.0 | 
Definition at line 104 of file guidance_OA.c.
Referenced by CN_escape_velocity(), CN_vector_escape_velocity(), CN_vector_velocity(), OA_update(), and pingpong_euler().
| 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().
| float speed_pot = 0.0 | 
Definition at line 110 of file guidance_OA.c.
Referenced by CN_escape_velocity(), CN_potential_heading(), CN_potential_velocity(), CN_vector_escape_velocity(), and OA_update().
| struct FloatVect3 Total_force = {0, 0, 0} | 
Definition at line 130 of file guidance_OA.c.
| float Total_Kan_x = 0 | 
Definition at line 126 of file guidance_OA.c.
Referenced by OA_update().
| float Total_Kan_y = 0 | 
Definition at line 127 of file guidance_OA.c.
Referenced by OA_update().
| float v_desired = 0.0 | 
Definition at line 115 of file guidance_OA.c.
| float vref_max = 100 | 
Definition at line 99 of file guidance_OA.c.
Referenced by CN_escape_velocity(), CN_potential_heading(), CN_potential_velocity(), CN_vector_escape_velocity(), and OA_update().
| float yaw_diff = 0.0 | 
Definition at line 111 of file guidance_OA.c.
| int32_t yaw_rate = 0 | 
Definition at line 117 of file guidance_OA.c.
Referenced by OA_update().
| float yaw_rate_write = 0 | 
Definition at line 118 of file guidance_OA.c.
| float yaw_ref_write = 0 | 
Definition at line 119 of file guidance_OA.c.