35 #include "generated/airframe.h"
41 #ifndef GUIDANCE_H_USE_REF
42 #define GUIDANCE_H_USE_REF TRUE
49 #ifndef GUIDANCE_H_USE_SPEED_REF
50 #define GUIDANCE_H_USE_SPEED_REF TRUE
53 #define GUIDANCE_H_MODE_KILL 0
54 #define GUIDANCE_H_MODE_RATE 1
55 #define GUIDANCE_H_MODE_ATTITUDE 2
56 #define GUIDANCE_H_MODE_HOVER 3
57 #define GUIDANCE_H_MODE_NAV 4
58 #define GUIDANCE_H_MODE_RC_DIRECT 5
59 #define GUIDANCE_H_MODE_CARE_FREE 6
60 #define GUIDANCE_H_MODE_FORWARD 7
61 #define GUIDANCE_H_MODE_MODULE 8
62 #define GUIDANCE_H_MODE_FLIP 9
63 #define GUIDANCE_H_MODE_GUIDED 10
171 #define guidance_h_SetUseRef(_val) { \
172 guidance_h.use_ref = _val && GUIDANCE_H_USE_REF; \
Reference generation for horizontal guidance.
struct Int32Vect2 pos
horizontal position setpoint in NED.
bool guidance_h_set_guided_vel(float vx, float vy)
Set horizontal velocity setpoint in GUIDED mode.
float gh_set_max_speed(float max_speed)
Set a new maximum speed for waypoint navigation.
void guidance_h_mode_changed(uint8_t new_mode)
bool approx_force_by_thrust
bool guidance_h_set_guided_pos(float x, float y)
Set horizontal position setpoint in GUIDED mode.
static void guidance_h_SetZeta(float zeta)
struct HorizontalGuidanceReference ref
reference calculated from setpoints
struct HorizontalGuidanceGains gains
void guidance_h_set_igain(uint32_t igain)
bool guidance_h_set_guided_body_vel(float vx, float vy)
Set body relative horizontal velocity setpoint in GUIDED mode.
uint8_t mask
bit 5: vx & vy, bit 6: vz, bit 7: vyaw
float gh_set_omega(float omega)
struct Int32Vect2 speed
with INT32_SPEED_FRAC
float gh_set_tau(float tau)
static void guidance_h_SetMaxSpeed(float speed)
Paparazzi floating point algebra.
struct Int32Vect2 speed
only used in HOVER mode if GUIDANCE_H_USE_SPEED_REF or in GUIDED mode
int32_t transition_theta_offset
struct HorizontalGuidance guidance_h
void guidance_h_run(bool in_flight)
void guidance_h_read_rc(bool in_flight)
bool guidance_h_set_guided_heading_rate(float rate)
Set heading rate setpoint in GUIDED mode.
struct Int32Vect2 pos
with INT32_POS_FRAC
void guidance_h_hover_enter(void)
void guidance_h_guided_run(bool in_flight)
Run GUIDED mode control.
struct Int32Vect2 accel
with INT32_ACCEL_FRAC
void guidance_h_init(void)
void guidance_h_nav_enter(void)
int32_t transition_percentage
float gh_set_zeta(float zeta)
bool guidance_h_set_guided_heading(float heading)
Set heading setpoint in GUIDED mode.
const struct Int32Vect2 * guidance_h_get_pos_err(void)
Gets the position error.
void guidance_h_from_nav(bool in_flight)
Set horizontal guidance from NAV and run control loop.
static void guidance_h_SetTau(float tau)
struct HorizontalGuidanceSetpoint sp
setpoints
Paparazzi fixed point algebra.
static void guidance_h_SetOmega(float omega)