Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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 }

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.
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.
bool nav_lace_run (void)
 Navigation function Called by flight plan or mission run function.

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.

Referenced by nav_lace_run().

◆ NAV_LACE_LWC_ID

#define NAV_LACE_LWC_ID   ABI_BROADCAST

Definition at line 170 of file nav_lace.c.

Referenced by nav_lace_init().

◆ NAV_LACE_RECOVER_MAX_TURN

#define NAV_LACE_RECOVER_MAX_TURN   1.5f

Definition at line 38 of file nav_lace.c.

Referenced by nav_lace_run().

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 

Definition at line 56 of file nav_lace.c.

Function Documentation

◆ change_rep()

float change_rep ( float dir)
static

Definition at line 83 of file nav_lace.c.

References dir.

Referenced by nav_lace_run().

Here is the caller graph for this function:

◆ lwc_cb()

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 nav_lace, and UNUSED.

Referenced by nav_lace_init(), nav_rosette_init(), and nav_trinity_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, LACE_ENTER, lwc_cb(), lwc_ev, mission_register(), nav_lace, and NAV_LACE_LWC_ID.

Here is the call graph for this function:

◆ nav_lace_run()

◆ 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 LACE_ENTER, LACE_LEFT, LACE_RIGHT, nav_dt, nav_lace, stateGetPositionEnu_f(), and VECT3_ASSIGN.

Here is the call graph for this function:

◆ process_new_point_lace()

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

Definition at line 88 of file nav_lace.c.

References LACE_LEFT, LACE_RIGHT, nav_lace, process_new_point_lace(), EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by nav_lace_run(), and process_new_point_lace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_target_point()

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.

Referenced by nav_lace_run().

Here is the caller graph for this function:

Variable Documentation

◆ lwc_ev

abi_event lwc_ev
static

Definition at line 173 of file nav_lace.c.

Referenced by nav_lace_init(), nav_rosette_init(), and nav_trinity_init().

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static

Definition at line 81 of file nav_lace.c.

◆ nav_lace

struct NavLace nav_lace
static