Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
nav_lace.c File Reference
#include "modules/nav/nav_lace.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_lace.c:

Go to the source code of this file.

Data Structures

struct  NavLace
 

Macros

#define NAV_LACE_RECOVER_MAX_TURN   1.5f
 
#define NAV_LACE_BORDER_FILTER   20.f
 
#define NAV_LACE_LWC_ID   ABI_BROADCAST
 

Enumerations

enum  LaceStatus {
  LACE_ENTER , LACE_INSIDE_START , LACE_INSIDE , LACE_OUTSIDE_START ,
  LACE_OUTSIDE , LACE_RECOVER_START , LACE_RECOVER_INSIDE , LACE_RECOVER_OUTSIDE
}
 
enum  RotationDir {
  LACE_LEFT , LACE_RIGHT , RSTT_LEFT , RSTT_RIGHT ,
  TRINITY_LEFT , TRINITY_RIGHT
}
 

Functions

static float change_rep (float dir)
 
static struct EnuCoor_f process_new_point_lace (struct EnuCoor_f *position, float alt_sp, float uav_direction)
 
static void update_target_point (struct EnuCoor_f *target, struct EnuCoor_f *border, float dt, float tau)
 
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_lace_init (void)
 Init function called by modules init. More...
 
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 with mission parameters. More...
 
bool nav_lace_run (void)
 Navigation function Called by flight plan or mission run function. More...
 

Variables

static struct NavLace nav_lace
 
static const float nav_dt = 1.f / NAVIGATION_FREQUENCY
 
static abi_event lwc_ev
 

Detailed Description

Author
VERDU Titouan

Adaptive border pattern for cloud exploration

Definition in file nav_lace.c.


Data Structure Documentation

◆ NavLace

struct NavLace

Definition at line 61 of file nav_lace.c.

+ Collaboration diagram for NavLace:
Data Fields
struct EnuCoor_f actual
struct EnuCoor_f circle
float direction
struct EnuCoor_f estim_border
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 LaceStatus status
struct EnuCoor_f target

Macro Definition Documentation

◆ NAV_LACE_BORDER_FILTER

#define NAV_LACE_BORDER_FILTER   20.f

Definition at line 42 of file nav_lace.c.

◆ NAV_LACE_LWC_ID

#define NAV_LACE_LWC_ID   ABI_BROADCAST

Definition at line 170 of file nav_lace.c.

◆ NAV_LACE_RECOVER_MAX_TURN

#define NAV_LACE_RECOVER_MAX_TURN   1.5f

Definition at line 38 of file nav_lace.c.

Enumeration Type Documentation

◆ LaceStatus

enum LaceStatus
Enumerator
LACE_ENTER 
LACE_INSIDE_START 
LACE_INSIDE 
LACE_OUTSIDE_START 
LACE_OUTSIDE 
LACE_RECOVER_START 
LACE_RECOVER_INSIDE 
LACE_RECOVER_OUTSIDE 

Definition at line 45 of file nav_lace.c.

◆ RotationDir

Enumerator
LACE_LEFT 
LACE_RIGHT 
RSTT_LEFT 
RSTT_RIGHT 
TRINITY_LEFT 
TRINITY_RIGHT 

Definition at line 56 of file nav_lace.c.

Function Documentation

◆ change_rep()

static float change_rep ( float  dir)
static

Definition at line 83 of file nav_lace.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 175 of file nav_lace.c.

References NavLace::inside_cloud, and nav_lace.

Referenced by nav_lace_init().

+ Here is the caller graph for this function:

◆ nav_lace_init()

void nav_lace_init ( void  )

Init function called by modules init.

Definition at line 181 of file nav_lace.c.

References DEFAULT_CIRCLE_RADIUS, NavLace::inside_cloud, LACE_ENTER, NavLace::last_border_time, lwc_cb(), lwc_ev, NavLace::max_recover_radius, mission_register(), nav_lace, NAV_LACE_LWC_ID, NavLace::radius, NavLace::recover_radius, and NavLace::status.

+ Here is the call graph for this function:

◆ nav_lace_run()

bool nav_lace_run ( void  )

Navigation function Called by flight plan or mission run function.

Returns
true until pattern ends or fail

Definition at line 222 of file nav_lace.c.

◆ nav_lace_setup()

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

Definition at line 197 of file nav_lace.c.

References NavLace::actual, NavLace::inside_cloud, LACE_ENTER, LACE_LEFT, LACE_RIGHT, nav_dt, nav_lace, NavLace::pos_incr, NavLace::radius, NavLace::radius_sign, NavLace::rotation, stateGetPositionEnu_f(), NavLace::status, NavLace::target, and VECT3_ASSIGN.

+ Here is the call graph for this function:

◆ process_new_point_lace()

static struct EnuCoor_f process_new_point_lace ( struct EnuCoor_f position,
float  alt_sp,
float  uav_direction 
)
static

Definition at line 83 of file nav_lace.c.

◆ update_target_point()

static void update_target_point ( struct EnuCoor_f target,
struct EnuCoor_f border,
float  dt,
float  tau 
)
static

Definition at line 108 of file nav_lace.c.

References alpha, target, EnuCoor_f::x, and EnuCoor_f::y.

Variable Documentation

◆ lwc_ev

abi_event lwc_ev
static

Definition at line 173 of file nav_lace.c.

Referenced by nav_lace_init().

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static

Definition at line 81 of file nav_lace.c.

Referenced by nav_lace_setup().

◆ nav_lace

struct NavLace nav_lace
static

Definition at line 1 of file nav_lace.c.

Referenced by lwc_cb(), nav_lace_init(), and nav_lace_setup().