Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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 { RSTT_LEFT , RSTT_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.
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.
bool nav_rosette_run (void)
 Navigation function Called by flight plan or mission run function.

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.

Referenced by nav_rosette_run().

◆ NAV_ROSETTE_LWC_ID

#define NAV_ROSETTE_LWC_ID   ABI_BROADCAST

Definition at line 179 of file nav_rosette.c.

Referenced by nav_rosette_init().

◆ NAV_ROSETTE_RECOVER_MAX_TURN

#define NAV_ROSETTE_RECOVER_MAX_TURN   1.5f

Definition at line 37 of file nav_rosette.c.

Referenced by nav_rosette_run().

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
RSTT_LEFT 
RSTT_RIGHT 

Definition at line 55 of file nav_rosette.c.

Function Documentation

◆ change_rep()

float change_rep ( float dir)
static

Definition at line 83 of file nav_rosette.c.

References dir.

Referenced by nav_rosette_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 184 of file nav_rosette.c.

References nav_rosette, and UNUSED.

◆ nav_rosette_init()

void nav_rosette_init ( void )

Init function called by modules init.

Definition at line 191 of file nav_rosette.c.

References DEFAULT_CIRCLE_RADIUS, lwc_cb(), lwc_ev, mission_register(), nav_rosette, NAV_ROSETTE_LWC_ID, and RSTT_ENTER.

Here is the call graph for this function:

◆ nav_rosette_run()

◆ 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 get_sys_time_float(), nav_dt, nav_rosette, RSTT_ENTER, RSTT_LEFT, RSTT_RIGHT, stateGetPositionEnu_f(), and VECT3_ASSIGN.

Here is the call graph for this function:

◆ process_new_point_rosette()

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

Definition at line 105 of file nav_rosette.c.

References nav_rosette, process_new_point_rosette(), RSTT_RIGHT, EnuCoor_f::x, EnuCoor_f::y, and EnuCoor_f::z.

Referenced by nav_rosette_run(), and process_new_point_rosette().

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

◆ update_barycenter()

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.

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

Referenced by nav_rosette_run().

Here is the caller graph for this function:

Variable Documentation

◆ lwc_ev

abi_event lwc_ev
static

Definition at line 182 of file nav_rosette.c.

◆ nav_dt

const float nav_dt = 1.f / NAVIGATION_FREQUENCY
static

Definition at line 81 of file nav_rosette.c.

◆ nav_rosette

struct NavRosette nav_rosette
static