Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_h_ref.h File Reference
#include "inttypes.h"
#include "math/pprz_algebra.h"
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "generated/airframe.h"
+ Include dependency graph for guidance_h_ref.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GuidanceHRef
 

Macros

#define GUIDANCE_H_REF_MAX_SPEED   5.
 Default speed saturation. More...
 
#define GUIDANCE_H_REF_MAX_ACCEL   5.66
 Accel saturation. More...
 
#define GH_POS_REF_FRAC   37
 fixedpoint representation: Q26.37 will give a range of 67e3 km and a resolution of 1.5e-11 m. More...
 

Functions

void gh_ref_init (void)
 
void gh_set_ref (struct Int32Vect2 pos, struct FloatVect2 speed, struct FloatVect2 accel)
 
void gh_update_ref_from_pos_sp (struct Int32Vect2 pos_sp)
 
void gh_update_ref_from_speed_sp (struct FloatVect2 speed_sp)
 
float gh_set_max_speed (float max_speed)
 Set a new maximum speed for waypoint navigation. More...
 
float gh_set_tau (float tau)
 
float gh_set_omega (float omega)
 
float gh_set_zeta (float zeta)
 

Variables

float gh_max_speed
 Current maximum speed for waypoint navigation. More...
 
struct GuidanceHRef gh_ref
 

Detailed Description

Reference generation for horizontal guidance.

Definition in file guidance_h_ref.h.


Data Structure Documentation

◆ GuidanceHRef

struct GuidanceHRef

Definition at line 60 of file guidance_h_ref.h.

+ Collaboration diagram for GuidanceHRef:
Data Fields
struct FloatVect2 accel Reference model acceleration.

in meters/sec2 (output)

float dt Integration timestep.
float inv_tau
float max_speed Current maximum speed for waypoint navigation.

Defaults to GUIDANCE_H_REF_MAX_SPEED

float omega second order model natural frequency
float omega_2
struct Int64Vect2 pos Reference model position.

in meters with fixedpoint representation: Q37.26

struct FloatVect2 speed Reference model speed.

in meters/sec accuracy 0.0000076 , range 16384m/s

float tau first order time constant
float zeta second order model damping
float zeta_omega

Macro Definition Documentation

◆ GH_POS_REF_FRAC

#define GH_POS_REF_FRAC   37

fixedpoint representation: Q26.37 will give a range of 67e3 km and a resolution of 1.5e-11 m.

At a rate of 500Hz, a ref speed of 7.3e-9 m/s could still update the position.

Definition at line 58 of file guidance_h_ref.h.

◆ GUIDANCE_H_REF_MAX_ACCEL

#define GUIDANCE_H_REF_MAX_ACCEL   5.66

Accel saturation.

tanf(RadOfDeg(30.))*9.81 = 5.66

Definition at line 51 of file guidance_h_ref.h.

◆ GUIDANCE_H_REF_MAX_SPEED

#define GUIDANCE_H_REF_MAX_SPEED   5.

Default speed saturation.

Definition at line 39 of file guidance_h_ref.h.

Function Documentation

◆ gh_ref_init()

void gh_ref_init ( void  )

Definition at line 51 of file guidance_h_ref.c.

References GuidanceHRef::dt, gh_ref, gh_set_max_speed(), gh_set_tau(), GUIDANCE_H_REF_MAX_SPEED, GUIDANCE_H_REF_OMEGA, GUIDANCE_H_REF_TAU, GUIDANCE_H_REF_ZETA, GuidanceHRef::omega, GuidanceHRef::omega_2, GuidanceHRef::zeta, and GuidanceHRef::zeta_omega.

Referenced by guidance_h_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gh_set_max_speed()

float gh_set_max_speed ( float  max_speed)

Set a new maximum speed for waypoint navigation.

Parameters
max_speedspeed saturation in m/s
Returns
new maximum speed

Definition at line 63 of file guidance_h_ref.c.

References f, gh_ref, GuidanceHRef::max_speed, and Min.

Referenced by gh_ref_init(), and guidance_h_SetMaxSpeed().

+ Here is the caller graph for this function:

◆ gh_set_omega()

float gh_set_omega ( float  omega)

Definition at line 78 of file guidance_h_ref.c.

References gh_ref, GuidanceHRef::omega, GuidanceHRef::omega_2, GuidanceHRef::zeta, and GuidanceHRef::zeta_omega.

Referenced by guidance_h_SetOmega().

+ Here is the caller graph for this function:

◆ gh_set_ref()

void gh_set_ref ( struct Int32Vect2  pos,
struct FloatVect2  speed,
struct FloatVect2  accel 
)

◆ gh_set_tau()

float gh_set_tau ( float  tau)

Definition at line 70 of file guidance_h_ref.c.

References gh_ref, GuidanceHRef::inv_tau, and GuidanceHRef::tau.

Referenced by gh_ref_init(), and guidance_h_SetTau().

+ Here is the caller graph for this function:

◆ gh_set_zeta()

float gh_set_zeta ( float  zeta)

Definition at line 87 of file guidance_h_ref.c.

References gh_ref, GuidanceHRef::omega, GuidanceHRef::zeta, and GuidanceHRef::zeta_omega.

Referenced by guidance_h_SetZeta().

+ Here is the caller graph for this function:

◆ gh_update_ref_from_pos_sp()

◆ gh_update_ref_from_speed_sp()

void gh_update_ref_from_speed_sp ( struct FloatVect2  speed_sp)

Variable Documentation

◆ gh_max_speed

float gh_max_speed

Current maximum speed for waypoint navigation.

Defaults to GUIDANCE_H_REF_MAX_SPEED

◆ gh_ref