Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_h.h File Reference

Horizontal guidance for rotorcrafts. More...

#include "math/pprz_algebra_int.h"
#include "firmwares/rotorcraft/guidance/guidance_h_ref.h"
#include "generated/airframe.h"
#include "std.h"
+ Include dependency graph for guidance_h.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GUIDANCE_H_USE_REF   TRUE
 Use horizontal guidance reference trajectory. More...
 
#define GUIDANCE_H_USE_SPEED_REF   TRUE
 Use horizontal guidance speed reference. More...
 
#define GUIDANCE_H_MODE_KILL   0
 
#define GUIDANCE_H_MODE_RATE   1
 
#define GUIDANCE_H_MODE_ATTITUDE   2
 
#define GUIDANCE_H_MODE_HOVER   3
 
#define GUIDANCE_H_MODE_NAV   4
 
#define GUIDANCE_H_MODE_RC_DIRECT   5
 
#define GUIDANCE_H_MODE_CARE_FREE   6
 
#define GUIDANCE_H_MODE_FORWARD   7
 
#define guidance_h_SetKi(_val)
 
#define guidance_h_SetUseRef(_val)
 
#define guidance_h_SetMaxSpeed(_val)
 

Functions

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
 
bool_t guidance_h_use_ref
 
bool_t guidance_h_approx_force_by_thrust
 
struct Int32Vect2 guidance_h_pos_sp
 horizontal position setpoint in NED. More...
 
struct Int32Vect2 guidance_h_pos_ref
 with INT32_POS_FRAC More...
 
struct Int32Vect2 guidance_h_speed_ref
 with INT32_SPEED_FRAC More...
 
struct Int32Vect2 guidance_h_accel_ref
 with INT32_ACCEL_FRAC More...
 
struct Int32Vect2 guidance_h_pos_err
 
struct Int32Vect2 guidance_h_speed_err
 
struct Int32Vect2 guidance_h_trim_att_integrator
 
struct Int32Vect2 guidance_h_cmd_earth
 horizontal guidance command. More...
 
struct Int32Eulers guidance_h_rc_sp
 with INT32_ANGLE_FRAC More...
 
int32_t guidance_h_heading_sp
 with INT32_ANGLE_FRAC More...
 
int32_t guidance_h_pgain
 
int32_t guidance_h_dgain
 
int32_t guidance_h_igain
 
int32_t guidance_h_vgain
 
int32_t guidance_h_again
 
int32_t transition_percentage
 
int32_t transition_theta_offset
 

Detailed Description

Horizontal guidance for rotorcrafts.

Definition in file guidance_h.h.

Macro Definition Documentation

#define GUIDANCE_H_MODE_ATTITUDE   2
#define GUIDANCE_H_MODE_CARE_FREE   6
#define GUIDANCE_H_MODE_FORWARD   7
#define GUIDANCE_H_MODE_HOVER   3
#define GUIDANCE_H_MODE_KILL   0

Definition at line 52 of file guidance_h.h.

Referenced by autopilot_set_mode(), guidance_h_init(), and guidance_h_mode_changed().

#define GUIDANCE_H_MODE_NAV   4
#define GUIDANCE_H_MODE_RATE   1
#define GUIDANCE_H_MODE_RC_DIRECT   5
#define guidance_h_SetKi (   _val)
Value:
{ \
}
struct Int32Vect2 guidance_h_trim_att_integrator
Definition: guidance_h.c:82
#define INT_VECT2_ZERO(_v)
int32_t guidance_h_igain
Definition: guidance_h.c:90

Definition at line 104 of file guidance_h.h.

#define guidance_h_SetMaxSpeed (   _val)
Value:
{ \
}
float gh_set_max_speed(float max_speed)
Set a new maximum speed for waypoint navigation.

Definition at line 116 of file guidance_h.h.

#define guidance_h_SetUseRef (   _val)
Value:
{ \
}
bool_t guidance_h_use_ref
Definition: guidance_h.c:70
#define GUIDANCE_H_USE_REF
Use horizontal guidance reference trajectory.
Definition: guidance_h.h:41

Definition at line 112 of file guidance_h.h.

#define GUIDANCE_H_USE_REF   TRUE

Use horizontal guidance reference trajectory.

Default is TRUE, define to FALSE to always disable it.

Definition at line 41 of file guidance_h.h.

Referenced by guidance_h_init().

#define GUIDANCE_H_USE_SPEED_REF   TRUE

Use horizontal guidance speed reference.

This also allows to give velocity commands via RC in GUIDANCE_H_MODE_HOVER. Default is TRUE, define to FALSE to always disable it.

Definition at line 49 of file guidance_h.h.

Function Documentation

void guidance_h_init ( void  )

Definition at line 163 of file guidance_h.c.

References GUIDANCE_H_AGAIN, GUIDANCE_H_APPROX_FORCE_BY_THRUST, GUIDANCE_H_MODE_KILL, guidance_h_pos_sp, guidance_h_rc_sp, guidance_h_trim_att_integrator, GUIDANCE_H_USE_REF, GUIDANCE_H_VGAIN, INT_EULERS_ZERO, INT_VECT2_ZERO, and register_periodic_telemetry().

Referenced by autopilot_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

int32_t guidance_h_again

Definition at line 91 of file guidance_h.c.

bool_t guidance_h_approx_force_by_thrust

Definition at line 71 of file guidance_h.c.

struct Int32Vect2 guidance_h_cmd_earth

horizontal guidance command.

In north/east with INT32_ANGLE_FRAC

Todo:
convert to real force command

Definition at line 84 of file guidance_h.c.

Referenced by guidance_h_run(), and guidance_h_traj_run().

int32_t guidance_h_dgain

Definition at line 89 of file guidance_h.c.

int32_t guidance_h_heading_sp

with INT32_ANGLE_FRAC

Definition at line 86 of file guidance_h.c.

Referenced by send_fp().

int32_t guidance_h_igain

Definition at line 90 of file guidance_h.c.

uint8_t guidance_h_mode

Definition at line 69 of file guidance_h.c.

Referenced by send_status().

int32_t guidance_h_pgain

Definition at line 88 of file guidance_h.c.

struct Int32Vect2 guidance_h_pos_err

Definition at line 80 of file guidance_h.c.

Referenced by guidance_h_traj_run().

struct Int32Vect2 guidance_h_pos_sp

horizontal position setpoint in NED.

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

Definition at line 73 of file guidance_h.c.

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

struct Int32Eulers guidance_h_rc_sp
struct Int32Vect2 guidance_h_speed_err

Definition at line 81 of file guidance_h.c.

Referenced by guidance_h_traj_run().

struct Int32Vect2 guidance_h_trim_att_integrator
bool_t guidance_h_use_ref

Definition at line 70 of file guidance_h.c.

int32_t guidance_h_vgain

Definition at line 92 of file guidance_h.c.

int32_t transition_percentage

Definition at line 94 of file guidance_h.c.

int32_t transition_theta_offset

Definition at line 95 of file guidance_h.c.

Referenced by stabilization_attitude_read_rc_roll_pitch_earth_quat_f().