29#include "generated/modules.h"
30#include "generated/flight_plan.h"
33#ifndef FOLLOW_ME_DISTANCE
34#define FOLLOW_ME_DISTANCE 45
38#ifndef FOLLOW_ME_HEIGHT
39#define FOLLOW_ME_HEIGHT 60
43#ifndef FOLLOW_ME_GPS_TIMEOUT
44#define FOLLOW_ME_GPS_TIMEOUT 5000
48#ifndef FOLLOW_ME_GROUND_TIMEOUT
49#define FOLLOW_ME_GROUND_TIMEOUT 5000
54#define FOLLOW_ME_FILT 0.9
58#ifndef FOLLOW_ME_MOVING_WPS
59#define FOLLOW_ME_MOVING_WPS
243 else if(speed == 0) {
uint32_t get_sys_time_msec(void)
Get the time in milliseconds since startup.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
static float ground_course
void follow_me_parse_target_pos(uint8_t *buf)
on receiving a TARGET_POS message
float follow_me_min_height
Follow me minimum height in meters when approaching with a speed.
float follow_me_min_dist
Follow me minimum distance in meters when trying to approach with a certain speed.
void follow_me_periodic(void)
periodic function
float follow_me_height
height from the ground gps
static struct LlaCoor_i ground_lla
float follow_me_distance
distance from the ground gps
float follow_me_heading
heading direction in which to hover from (automatically set if ground is exceeding speed)
void follow_me_set_wp(uint8_t wp_id, float speed)
run function
float follow_me_gps_delay
Follow me GPS delay from the relative positionb packet (in ms)
static uint8_t moving_wps_cnt
static uint32_t ground_time_msec
static uint8_t moving_wps[]
static float ground_speed
void follow_me_init(void)
init function
#define FOLLOW_ME_MOVING_WPS
float follow_me_advance_ms
Follow me waypoint advance time in ms (multiplied by the ground speed)
#define FOLLOW_ME_DISTANCE
#define FOLLOW_ME_GROUND_TIMEOUT
static struct EnuCoor_f last_targetpos
static bool last_targetpos_valid
float follow_me_datalink_delay
Follow me datalink delay from the ground GPS packet (in ms)
float follow_me_diag_speed
Diagonal speed for follow me.
static float last_targetpos_heading
static float ground_heading
static float ground_climb
float follow_me_filt
Follow me course sin/cos filter value (higher is harder filter)
#define VECT3_COPY(_a, _b)
#define VECT3_DIFF(_c, _a, _b)
#define ENU_OF_TO_NED(_po, _pi)
int32_t lat
in degrees*1e7
int32_t alt
in millimeters above WGS84 reference ellipsoid
int32_t lon
in degrees*1e7
void ned_of_lla_point_i(struct NedCoor_i *ned, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local NED.
void enu_of_lla_point_i(struct EnuCoor_i *enu, struct LtpDef_i *def, struct LlaCoor_i *lla)
Convert a point from LLA to local ENU.
#define VECT3_FLOAT_OF_CM(_o, _i)
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
vector in North East Down coordinates
bool ned_initialized_i
true if local int coordinate frame is initialsed
static struct LtpDef_i * stateGetNedOrigin_i(void)
Get the coordinate NED frame origin (int)
struct EnuCoor_f * waypoint_get_enu_f(uint8_t wp_id)
Get ENU coordinates (float)
void waypoint_set_enu(uint8_t wp_id, struct EnuCoor_f *enu)
Set local ENU waypoint coordinates.
vector in East North Up coordinates Units: meters
vector in North East Down coordinates Units: meters
Periodic telemetry system header (includes downlink utility and generated code).
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.