33 #include "generated/flight_plan.h"
36 #ifndef NAV_ROSETTE_RECOVER_MAX_TURN
37 #define NAV_ROSETTE_RECOVER_MAX_TURN 1.5f
40 #ifndef NAV_ROSETTE_BORDER_FILTER
41 #define NAV_ROSETTE_BORDER_FILTER 60.f
91 bary->
x = (border->
x +
first->
x) / 2.f;
92 bary->
y = (border->
y +
first->
y) / 2.f;
97 float alpha = dt / (dt + tau);
136 float start_x = params[0];
137 float start_y = params[1];
138 float start_z = params[2];
139 int first_turn = params[3];
140 float circle_radius = params[4];
141 float vx = params[5];
142 float vy = params[6];
143 float vz = params[7];
144 nav_rosette_setup(start_x, start_y, start_z, first_turn, circle_radius, vx, vy, vz);
157 float vx = params[0];
158 float vy = params[1];
165 float vz = params[0];
178 #ifndef NAV_ROSETTE_LWC_ID
179 #define NAV_ROSETTE_LWC_ID ABI_BROADCAST
186 if (data_type == 1 && size == 1) {
208 int turn,
float desired_radius,
209 float vx,
float vy,
float vz)
211 struct EnuCoor_f start = {init_x, init_y, init_z};
235 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_ROSETTE_BORDER_FILTER
static struct NavRosette nav_rosette
void nav_rosette_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...
void nav_rosette_init(void)
Init function called by modules init.
enum RosetteStatus status
#define NAV_ROSETTE_RECOVER_MAX_TURN
struct FloatVect3 pos_incr
struct EnuCoor_f recover_circle
#define NAV_ROSETTE_LWC_ID
struct EnuCoor_f estim_border
static void update_barycenter(struct EnuCoor_f *bary, struct EnuCoor_f *border, struct EnuCoor_f *first, float alt_sp, float dt, float tau)
bool nav_rosette_run(void)
Navigation function Called by flight plan or mission run function.
static const float nav_dt
enum RotationDir rotation
static float change_rep(float dir)
static struct EnuCoor_f process_new_point_rosette(struct EnuCoor_f *position, float uav_direction)
Adaptive flower 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.