23#define AUTOPILOT_CORE_GUIDANCE_C
28#include "generated/airframe.h"
29#include "generated/autopilot_core_guidance.h"
36#ifndef ROVER_GUIDANCE_POS_KP
37#define ROVER_GUIDANCE_POS_KP 1.f
40#ifndef ROVER_GUIDANCE_HEADING_KP
41#define ROVER_GUIDANCE_HEADING_KP 1.f
44#ifndef ROVER_GUIDANCE_SPEED_KP
45#define ROVER_GUIDANCE_SPEED_KP 10.f
48#ifndef ROVER_GUIDANCE_SPEED_KI
49#define ROVER_GUIDANCE_SPEED_KI 100.f
52#ifndef ROVER_GUIDANCE_MAX_POS_ERR
53#define ROVER_GUIDANCE_MAX_POS_ERR 10.f
56#ifndef ROVER_GUIDANCE_MAX_SPEED
57#define ROVER_GUIDANCE_MAX_SPEED 10.f
60#ifndef ROVER_GUIDANCE_PROXIMITY_DISTANCE
61#define ROVER_GUIDANCE_PROXIMITY_DISTANCE 2.f
Core autopilot interface common to all firmwares.
static float float_vect2_norm(struct FloatVect2 *v)
#define VECT2_DIFF(_c, _a, _b)
#define VECT2_COPY(_a, _b)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Several forms of PID controllers.
float sum
integral of input
static float get_pid_f(struct PID_f *pid)
Get current value of the PID command.
static void set_gains_pid_f(struct PID_f *pid, float Kp, float Kd, float Ki)
Set gains of the PID struct.
static void reset_pid_f(struct PID_f *pid)
Reset PID struture, gains left unchanged.
static float update_pid_f(struct PID_f *pid, float value, float dt)
Update PID with a new value and return new command.
static void init_pid_f(struct PID_f *pid, float Kp, float Kd, float Ki, float max_sum)
Simple PID structure floating point.
vector in East North Up coordinates Units: meters
void rover_guidance_steering_kill(void)
#define ROVER_GUIDANCE_MAX_SPEED
rover_ctrl guidance_control
void rover_guidance_steering_speed_ctrl(void)
#define ROVER_GUIDANCE_MAX_POS_ERR
void rover_guidance_steering_set_speed_igain(float igain)
void rover_guidance_steering_periodic(void)
#define ROVER_GUIDANCE_SPEED_KI
#define ROVER_GUIDANCE_HEADING_KP
#define ROVER_GUIDANCE_POS_KP
Mandatory dependencies header.
void rover_guidance_steering_init(void)
INIT function.
#define ROVER_GUIDANCE_SPEED_KP
static struct PID_f rover_pid
#define ROVER_GUIDANCE_PROXIMITY_DISTANCE
void rover_guidance_steering_pid_reset(void)
PID RESET function.
void rover_guidance_steering_setpoints(struct EnuCoor_f pos_sp, float *heading_sp)
void rover_guidance_steering_heading_ctrl(float omega)
CTRL functions.
void rover_guidance_steering_set_speed_pgain(float pgain)
#define BoundDelta(delta)
MACROS.
#define BoundThrottle(throttle)
float omega_sp
omega setpoint
float heading_sp
heading setpoint
#define BoundSpeed(speed)
#define DRIVE_SHAFT_DISTANCE
API to get/set the generic vehicle states.