Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
nav_rosette.c File Reference

Adaptive flower pattern for cloud exploration. More...

#include "modules/nav/nav_rosette.h"
#include "firmwares/fixedwing/nav.h"
#include "state.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "modules/core/abi.h"
+ Include dependency graph for nav_rosette.c:

Go to the source code of this file.

Data Structures

struct  NavRosette
 

Macros

#define NAV_ROSETTE_RECOVER_MAX_TURN   1.5f
 
#define NAV_ROSETTE_BORDER_FILTER   60.f
 
#define NAV_ROSETTE_LWC_ID   ABI_BROADCAST
 

Enumerations

enum  RosetteStatus {
  RSTT_ENTER , RSTT_CROSSING_FIRST , RSTT_CROSSING_START , RSTT_CROSSING ,
  RSTT_TURNING_START , RSTT_TURNING , RSTT_RECOVER_START , RSTT_RECOVER_OUTSIDE
}
 
enum  RotationDir {
  LACE_LEFT , LACE_RIGHT , RSTT_LEFT , RSTT_RIGHT ,
  TRINITY_LEFT , TRINITY_RIGHT
}
 

Functions

static float change_rep (float dir)
 
static void update_barycenter (struct EnuCoor_f *bary, struct EnuCoor_f *border, struct EnuCoor_f *first, float alt_sp, float dt, float tau)
 
static struct EnuCoor_f process_new_point_rosette (struct EnuCoor_f *position, float uav_direction)
 
static void lwc_cb (uint8_t sender_id UNUSED, uint32_t stamp UNUSED, int32_t data_type, uint32_t size, uint8_t *data)
 
void nav_rosette_init (void)
 Init function called by modules init. More...
 
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 with mission parameters. More...
 
bool nav_rosette_run (void)
 Navigation function Called by flight plan or mission run function. More...
 

Variables

static struct NavRosette nav_rosette
 
static const float nav_dt = 1.f / NAVIGATION_FREQUENCY
 
static abi_event lwc_ev
 

Detailed Description

Adaptive flower pattern for cloud exploration.

Definition in file nav_rosette.c.


Data Structure Documentation

◆ NavRosette

struct NavRosette

Definition at line 60 of file nav_rosette.c.

+ Collaboration diagram for NavRosette:
Data Fields
struct EnuCoor_f actual
struct EnuCoor_f circle
float direction
struct EnuCoor_f estim_border
struct EnuCoor_f * first
bool inside_cloud
float last_border_time
float max_recover_radius
struct FloatVect3 pos_incr
float radius
float radius_sign
struct EnuCoor_f recover_circle
float recover_radius
enum RotationDir rotation
enum RosetteStatus status
struct EnuCoor_f target

Macro Definition Documentation

◆ NAV_ROSETTE_BORDER_FILTER

#define NAV_ROSETTE_BORDER_FILTER   60.f

Definition at line 41 of file nav_rosette.c.

◆ NAV_ROSETTE_LWC_ID

#define NAV_ROSETTE_LWC_ID   ABI_BROADCAST

Definition at line 179 of file nav_rosette.c.

◆ NAV_ROSETTE_RECOVER_MAX_TURN

#define NAV_ROSETTE_RECOVER_MAX_TURN   1.5f

Definition at line 37 of file nav_rosette.c.

Enumeration Type Documentation

◆ RosetteStatus

Enumerator
RSTT_ENTER 
RSTT_CROSSING_FIRST 
RSTT_CROSSING_START 
RSTT_CROSSING 
RSTT_TURNING_START 
RSTT_TURNING 
RSTT_RECOVER_START 
RSTT_RECOVER_OUTSIDE 

Definition at line 44 of file nav_rosette.c.

◆ RotationDir

Enumerator
LACE_LEFT 
LACE_RIGHT 
RSTT_LEFT 
RSTT_RIGHT 
TRINITY_LEFT 
TRINITY_RIGHT 

Definition at line 55 of file nav_rosette.c.

Function Documentation

◆ change_rep()

static float change_rep ( float  dir)
static

Definition at line 83 of file nav_rosette.c.

References dir.

◆ lwc_cb()

static void lwc_cb ( uint8_t sender_id  UNUSED,
uint32_t stamp  UNUSED,
int32_t  data_type,
uint32_t  size,
uint8_t data 
)
static

Definition at line 184 of file nav_rosette.c.

References NavRosette::inside_cloud, and nav_rosette.

Referenced by nav_rosette_init().

+ Here is the caller graph for this function:

◆ nav_rosette_init()

void nav_rosette_init ( void  )

◆ nav_rosette_run()

bool nav_rosette_run ( void  )

Navigation function Called by flight plan or mission run function.

Returns
true until pattern ends or fail

Definition at line 233 of file nav_rosette.c.

◆ nav_rosette_setup()

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 with mission parameters.

Definition at line 207 of file nav_rosette.c.

References NavRosette::actual, NavRosette::first, get_sys_time_float(), NavRosette::inside_cloud, NavRosette::last_border_time, nav_dt, nav_rosette, NavRosette::pos_incr, NavRosette::radius, NavRosette::radius_sign, NavRosette::rotation, RSTT_ENTER, RSTT_LEFT, RSTT_RIGHT, stateGetPositionEnu_f(), NavRosette::status, NavRosette::target, and VECT3_ASSIGN.

+ Here is the call graph for this function:

◆ process_new_point_rosette()

static struct EnuCoor_f process_new_point_rosette ( struct EnuCoor_f position,
float  uav_direction 
)
static

Definition at line 88 of file nav_rosette.c.

References alpha, NavRosette::first, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

◆ update_barycenter()

static void update_barycenter ( struct EnuCoor_f bary,
struct EnuCoor_f border,
struct EnuCoor_f first,
float  alt_sp,
float  dt,
float  tau 
)
static

Definition at line 88 of file nav_rosette.c.

Variable Documentation

◆ lwc_ev

abi_event lwc_ev
static

Definition at line 182 of file nav_rosette.c.

Referenced by nav_rosette_init().

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static

Definition at line 81 of file nav_rosette.c.

Referenced by nav_rosette_setup().

◆ nav_rosette

struct NavRosette nav_rosette
static

Definition at line 1 of file nav_rosette.c.

Referenced by lwc_cb(), nav_rosette_init(), and nav_rosette_setup().