33 #include "generated/flight_plan.h"
36 #ifndef NAV_TRINITY_RECOVER_MAX_TURN
37 #define NAV_TRINITY_RECOVER_MAX_TURN 1.5f
40 #ifndef NAV_TRINITY_BORDER_FILTER
41 #define NAV_TRINITY_BORDER_FILTER 20.f
100 new_point.z = alt_sp;
122 float alpha = dt / (dt + tau);
135 float start_x = params[0];
136 float start_y = params[1];
137 float start_z = params[2];
138 int first_turn = params[3];
139 float circle_radius = params[4];
140 float vx = params[5];
141 float vy = params[6];
142 float vz = params[7];
143 nav_trinity_setup(start_x, start_y, start_z, first_turn, circle_radius, vx, vy, vz);
156 float vx = params[0];
157 float vy = params[1];
164 float vz = params[0];
177 #ifndef NAV_TRINITY_LWC_ID
178 #define NAV_TRINITY_LWC_ID ABI_BROADCAST
184 if (data_type == 1 && size == 1) {
206 float init_z,
int turn,
207 float desired_radius,
float vx,
210 struct EnuCoor_f start = {init_x, init_y, init_z};
232 float pre_climb = 0.f;
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
Core autopilot interface common to all firmwares.
void nav_send_waypoint(uint8_t wp_id)
Send a waypoint throught default telemetry channel.
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
void nav_move_waypoint_enu(uint8_t wp_id, float x, float y, float alt)
Move a waypoint in local frame.
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define VECT3_ADD(_a, _b)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
bool mission_register(mission_custom_cb cb, char *type)
Register a new navigation or action callback function.
@ MissionUpdate
param update
void nav_init_stage(void)
needs to be implemented by fixedwing and rotorcraft seperately
void nav_route_xy(float last_wp_x, float last_wp_y, float wp_x, float wp_y)
Computes the carrot position along the desired segment.
void nav_circle_XY(float x, float y, float radius)
Navigates around (x, y).
Fixedwing Navigation library.
#define NavCircleCountNoRewind()
#define NAVIGATION_FREQUENCY
Default fixedwing navigation frequency.
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command.
#define NavVerticalAutoThrottleMode(_pitch)
Set the climb control to auto-throttle with the specified pitch pre-command.
static void lwc_cb(uint8_t sender_id UNUSED, uint32_t stamp UNUSED, int32_t data_type, uint32_t size, uint8_t *data)
enum TrinityStatus status
enum RotationDir rotation
#define NAV_TRINITY_RECOVER_MAX_TURN
static struct EnuCoor_f process_first_point_trinity(struct EnuCoor_f *position, float alt_sp, float uav_direction)
#define NAV_TRINITY_LWC_ID
@ TRINITY_RECOVER_OUTSIDE
void nav_trinity_setup(float init_x, float init_y, float init_z, int turn, float desired_radius, float vx, float vy, float vz)
Initialized the exploration with a first target point inside the cloud Called from flight plan or wit...
static struct NavTrinity nav_trinity
static struct EnuCoor_f process_new_point_trinity(struct EnuCoor_f *position, float alt_sp, float uav_direction)
struct EnuCoor_f estim_border
struct EnuCoor_f recover_circle
#define NAV_TRINITY_BORDER_FILTER
struct FloatVect3 pos_incr
static void update_target_point(struct EnuCoor_f *target, struct EnuCoor_f *border, float dt, float tau)
static const float nav_dt
bool nav_trinity_run(void)
Navigation function Called by flight plan or mission run function.
static float change_rep(float dir)
void nav_trinity_init(void)
Init function called by modules init.
vector in East North Up coordinates Units: meters
#define DEFAULT_CIRCLE_RADIUS
default nav_circle_radius in meters
API to get/set the generic vehicle states.
static float get_sys_time_float(void)
Get the time in seconds since startup.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.