34 #include "generated/flight_plan.h"
37 #ifndef NAV_LACE_RECOVER_MAX_TURN
38 #define NAV_LACE_RECOVER_MAX_TURN 1.5f
41 #ifndef NAV_LACE_BORDER_FILTER
42 #define NAV_LACE_BORDER_FILTER 20.f
101 new_point.x = position->
x + (cosf(rot_angle + uav_direction) *
nav_lace.
radius);
102 new_point.y = position->
y + (sinf(rot_angle + uav_direction) *
nav_lace.
radius);
103 new_point.z = alt_sp;
114 float alpha = dt / (dt + tau);
127 float start_x = params[0];
128 float start_y = params[1];
129 float start_z = params[2];
130 int first_turn = params[3];
131 float circle_radius = params[4];
132 float vx = params[5];
133 float vy = params[6];
134 float vz = params[7];
135 nav_lace_setup(start_x, start_y, start_z, first_turn, circle_radius, vx, vy, vz);
148 float vx = params[0];
149 float vy = params[1];
156 float vz = params[0];
169 #ifndef NAV_LACE_LWC_ID
170 #define NAV_LACE_LWC_ID ABI_BROADCAST
176 if (data_type == 1 && size == 1) {
198 float init_z,
int turn,
199 float desired_radius,
float vx,
202 struct EnuCoor_f start = {init_x, init_y, init_z};
224 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)
#define NAV_LACE_BORDER_FILTER
enum RotationDir rotation
#define NAV_LACE_RECOVER_MAX_TURN
bool nav_lace_run(void)
Navigation function Called by flight plan or mission run function.
static struct EnuCoor_f process_new_point_lace(struct EnuCoor_f *position, float alt_sp, float uav_direction)
struct EnuCoor_f recover_circle
static void update_target_point(struct EnuCoor_f *target, struct EnuCoor_f *border, float dt, float tau)
static const float nav_dt
void nav_lace_init(void)
Init function called by modules init.
static float change_rep(float dir)
static struct NavLace nav_lace
void nav_lace_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...
struct FloatVect3 pos_incr
struct EnuCoor_f estim_border
Adaptive border pattern for cloud exploration Can be used in mission mode with custom pattern and ID ...
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.