Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
guidance_h.c File Reference
+ Include dependency graph for guidance_h.c:

Go to the source code of this file.

Macros

#define GUIDANCE_H_C
 
#define GUIDANCE_H_AGAIN   0
 
#define GUIDANCE_H_MAX_BANK   RadOfDeg(20)
 
#define GuidanceHSetRef(_pos, _speed, _accel)
 
#define MAX_POS_ERR   POS_BFP_OF_REAL(16.)
 
#define MAX_SPEED_ERR   SPEED_BFP_OF_REAL(16.)
 
#define MAX_POS_ERR_SUM   ((int32_t)(MAX_POS_ERR)<< 12)
 
#define GH_GAIN_SCALE   2
 
#define TRAJ_MAX_BANK   BFP_OF_REAL(GUIDANCE_H_MAX_BANK, INT32_ANGLE_FRAC)
 maximum bank angle: default 20 deg More...
 

Functions

static void guidance_h_update_reference (bool_t use_ref)
 
static void guidance_h_traj_run (bool_t in_flight)
 
static void guidance_h_hover_enter (void)
 
static void guidance_h_nav_enter (void)
 
void guidance_h_init (void)
 
void guidance_h_mode_changed (uint8_t new_mode)
 
void guidance_h_read_rc (bool_t in_flight)
 
void guidance_h_run (bool_t in_flight)
 

Variables

uint8_t guidance_h_mode
 
struct Int32Vect2 guidance_h_pos_sp
 horizontal position setpoint in NED. More...
 
struct Int32Vect2 guidance_h_pos_ref
 
struct Int32Vect2 guidance_h_speed_ref
 
struct Int32Vect2 guidance_h_accel_ref
 
struct Int32Vect2 guidance_h_pos_err
 
struct Int32Vect2 guidance_h_speed_err
 
struct Int32Vect2 guidance_h_pos_err_sum
 
struct Int32Vect2 guidance_h_nav_err
 
struct Int32Eulers guidance_h_rc_sp
 with INT32_ANGLE_FRAC More...
 
struct Int32Vect2 guidance_h_command_earth
 
struct Int32Vect2 guidance_h_stick_earth_sp
 
struct Int32Eulers guidance_h_command_body
 with INT32_ANGLE_FRAC More...
 
int32_t guidance_h_pgain
 
int32_t guidance_h_dgain
 
int32_t guidance_h_igain
 
int32_t guidance_h_again
 

Macro Definition Documentation

#define GH_GAIN_SCALE   2

Definition at line 261 of file guidance_h.c.

Referenced by guidance_h_traj_run().

#define GUIDANCE_H_AGAIN   0

Definition at line 70 of file guidance_h.c.

Referenced by guidance_h_init().

#define GUIDANCE_H_C

Definition at line 27 of file guidance_h.c.

#define GUIDANCE_H_MAX_BANK   RadOfDeg(20)

Definition at line 78 of file guidance_h.c.

#define GuidanceHSetRef (   _pos,
  _speed,
  _accel 
)
Value:
{ \
b2_gh_set_ref(_pos, _speed, _accel); \
}
struct Int32Vect2 guidance_h_pos_ref
Definition: guidance_h.c:42
struct Int32Vect2 guidance_h_accel_ref
Definition: guidance_h.c:44
struct Int32Vect2 guidance_h_speed_ref
Definition: guidance_h.c:43
#define VECT2_COPY(_a, _b)
Definition: pprz_algebra.h:45

Definition at line 86 of file guidance_h.c.

Referenced by guidance_h_nav_enter().

#define MAX_POS_ERR   POS_BFP_OF_REAL(16.)

Definition at line 255 of file guidance_h.c.

Referenced by guidance_h_traj_run().

#define MAX_POS_ERR_SUM   ((int32_t)(MAX_POS_ERR)<< 12)

Definition at line 257 of file guidance_h.c.

Referenced by guidance_h_traj_run().

#define MAX_SPEED_ERR   SPEED_BFP_OF_REAL(16.)

Definition at line 256 of file guidance_h.c.

Referenced by guidance_h_traj_run().

#define TRAJ_MAX_BANK   BFP_OF_REAL(GUIDANCE_H_MAX_BANK, INT32_ANGLE_FRAC)

maximum bank angle: default 20 deg

Definition at line 264 of file guidance_h.c.

Referenced by guidance_h_traj_run().

Function Documentation

static void guidance_h_hover_enter ( void  )
inlinestatic

Definition at line 327 of file guidance_h.c.

References ahrs, guidance_h_pos_err_sum, guidance_h_pos_sp, guidance_h_rc_sp, ins_ltp_pos, INT_VECT2_ZERO, Ahrs::ltp_to_body_euler, Int32Eulers::psi, reset_psi_ref_from_body(), and VECT2_COPY.

Referenced by guidance_h_mode_changed().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void guidance_h_mode_changed ( uint8_t  new_mode)
static void guidance_h_nav_enter ( void  )
inlinestatic
static void guidance_h_update_reference ( bool_t  use_ref)
inlinestatic

Variable Documentation

struct Int32Vect2 guidance_h_accel_ref

Definition at line 44 of file guidance_h.c.

Referenced by guidance_h_traj_run(), and guidance_h_update_reference().

int32_t guidance_h_again

Definition at line 59 of file guidance_h.c.

Referenced by guidance_h_init(), and guidance_h_traj_run().

struct Int32Eulers guidance_h_command_body

with INT32_ANGLE_FRAC

Definition at line 54 of file guidance_h.c.

Referenced by guidance_h_init(), guidance_h_run(), and guidance_h_traj_run().

struct Int32Vect2 guidance_h_command_earth

Definition at line 52 of file guidance_h.c.

Referenced by guidance_h_traj_run().

int32_t guidance_h_dgain

Definition at line 57 of file guidance_h.c.

Referenced by guidance_h_init(), and guidance_h_traj_run().

int32_t guidance_h_igain

Definition at line 58 of file guidance_h.c.

Referenced by guidance_h_init(), and guidance_h_traj_run().

uint8_t guidance_h_mode
struct Int32Vect2 guidance_h_nav_err

Definition at line 49 of file guidance_h.c.

int32_t guidance_h_pgain

Definition at line 56 of file guidance_h.c.

Referenced by guidance_h_init(), and guidance_h_traj_run().

struct Int32Vect2 guidance_h_pos_err

Definition at line 46 of file guidance_h.c.

Referenced by guidance_h_traj_run().

struct Int32Vect2 guidance_h_pos_err_sum
struct Int32Vect2 guidance_h_pos_ref

Definition at line 42 of file guidance_h.c.

Referenced by guidance_h_traj_run(), and guidance_h_update_reference().

struct Int32Vect2 guidance_h_pos_sp

horizontal position setpoint in NED.

fixed point representation: Q23.8 accuracy 0.0039, range 8388km

Definition at line 41 of file guidance_h.c.

Referenced by guidance_h_hover_enter(), guidance_h_init(), guidance_h_nav_enter(), guidance_h_run(), and guidance_h_update_reference().

struct Int32Vect2 guidance_h_speed_err

Definition at line 47 of file guidance_h.c.

Referenced by guidance_h_traj_run().

struct Int32Vect2 guidance_h_speed_ref

Definition at line 43 of file guidance_h.c.

Referenced by guidance_h_traj_run(), and guidance_h_update_reference().

struct Int32Vect2 guidance_h_stick_earth_sp

Definition at line 53 of file guidance_h.c.