Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
cf_deck_multi_ranger.c File Reference
+ Include dependency graph for cf_deck_multi_ranger.c:

Go to the source code of this file.

Data Structures

struct  SingleRanger
 
struct  cf_deck_multi_ranger
 

Macros

#define MULTI_RANGER_EARLY_INIT   TRUE
 
#define MULTI_RANGER_TIMINGBUDGET_MS   100
 
#define MULTI_RANGER_DISTANCEMODE   2
 
#define MULTI_RANGER_INTERMEASUREMENT_MS   MULTI_RANGER_TIMINGBUDGET_MS
 
#define MULTI_RANGER_PIN_FRONT   PCA95XX_P4
 
#define MULTI_RANGER_PIN_BACK   PCA95XX_P1
 
#define MULTI_RANGER_PIN_RIGHT   PCA95XX_P2
 
#define MULTI_RANGER_PIN_LEFT   PCA95XX_P6
 
#define MULTI_RANGER_PIN_UP   PCA95XX_P0
 
#define MULTI_RANGER_PIN_ALL   (MULTI_RANGER_PIN_FRONT | MULTI_RANGER_PIN_BACK | MULTI_RANGER_PIN_RIGHT | MULTI_RANGER_PIN_LEFT | MULTI_RANGER_PIN_UP)
 
#define MULTI_RANGER_ARRAY_ORIENTATION   {{0.f, 0.f}, {0.f, M_PI}, {0.f, M_PI_2}, {0.f, -M_PI_2}, {M_PI_2, 0.f}}
 

Enumerations

enum  MultiRangerStatus {
  MULTI_RANGER_UNINIT , MULTI_RANGER_CONF_IO , MULTI_RANGER_CONF_FRONT , MULTI_RANGER_CONF_BACK ,
  MULTI_RANGER_CONF_RIGHT , MULTI_RANGER_CONF_LEFT , MULTI_RANGER_CONF_UP , MULTI_RANGER_READ_FRONT ,
  MULTI_RANGER_READ_BACK , MULTI_RANGER_READ_RIGHT , MULTI_RANGER_READ_LEFT , MULTI_RANGER_READ_UP
}
 
enum  MultiRangerDev {
  MULTI_RANGER_FRONT = 0 , MULTI_RANGER_BACK , MULTI_RANGER_RIGHT , MULTI_RANGER_LEFT ,
  MULTI_RANGER_UP , MULTI_RANGER_NB
}
 

Functions

static void multi_ranger_boot_device (VL53L1_Dev_t *dev UNUSED)
 Boot a device. More...
 
void multi_ranger_init (void)
 Module init. More...
 
static bool multi_ranger_read (struct SingleRanger *ranger UNUSED)
 Read data from a device. More...
 
void multi_ranger_periodic (void)
 Module periodic function. More...
 
void multi_ranger_event (void)
 
void multi_ranger_report (void)
 

Variables

static const float multi_ranger_array_orientation [][2] = MULTI_RANGER_ARRAY_ORIENTATION
 
static struct cf_deck_multi_ranger multi_ranger
 

Detailed Description

Author
Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r Multi-ranger deck from Bitcraze for Crazyflie drones

Definition in file cf_deck_multi_ranger.c.


Data Structure Documentation

◆ SingleRanger

struct SingleRanger

Definition at line 107 of file cf_deck_multi_ranger.c.

+ Collaboration diagram for SingleRanger:
Data Fields
float azimuth azimuth [rad] relative to body frame
float bearing bearing [rad] relative to body frame
VL53L1_Dev_t dev sensor driver
float distance raw distance measurement
uint8_t read_state current reading state

◆ cf_deck_multi_ranger

struct cf_deck_multi_ranger

Definition at line 115 of file cf_deck_multi_ranger.c.

+ Collaboration diagram for cf_deck_multi_ranger:
Data Fields
struct pca95xx pca
struct SingleRanger ranger[MULTI_RANGER_NB] sensor array
enum MultiRangerStatus status

Macro Definition Documentation

◆ MULTI_RANGER_ARRAY_ORIENTATION

#define MULTI_RANGER_ARRAY_ORIENTATION   {{0.f, 0.f}, {0.f, M_PI}, {0.f, M_PI_2}, {0.f, -M_PI_2}, {M_PI_2, 0.f}}

Definition at line 103 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_DISTANCEMODE

#define MULTI_RANGER_DISTANCEMODE   2

Definition at line 52 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_EARLY_INIT

#define MULTI_RANGER_EARLY_INIT   TRUE

Definition at line 38 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_INTERMEASUREMENT_MS

#define MULTI_RANGER_INTERMEASUREMENT_MS   MULTI_RANGER_TIMINGBUDGET_MS

Definition at line 60 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_PIN_ALL

◆ MULTI_RANGER_PIN_BACK

#define MULTI_RANGER_PIN_BACK   PCA95XX_P1

Definition at line 68 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_PIN_FRONT

#define MULTI_RANGER_PIN_FRONT   PCA95XX_P4

Definition at line 67 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_PIN_LEFT

#define MULTI_RANGER_PIN_LEFT   PCA95XX_P6

Definition at line 70 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_PIN_RIGHT

#define MULTI_RANGER_PIN_RIGHT   PCA95XX_P2

Definition at line 69 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_PIN_UP

#define MULTI_RANGER_PIN_UP   PCA95XX_P0

Definition at line 71 of file cf_deck_multi_ranger.c.

◆ MULTI_RANGER_TIMINGBUDGET_MS

#define MULTI_RANGER_TIMINGBUDGET_MS   100

Definition at line 46 of file cf_deck_multi_ranger.c.

Enumeration Type Documentation

◆ MultiRangerDev

Enumerator
MULTI_RANGER_FRONT 
MULTI_RANGER_BACK 
MULTI_RANGER_RIGHT 
MULTI_RANGER_LEFT 
MULTI_RANGER_UP 
MULTI_RANGER_NB 

Definition at line 92 of file cf_deck_multi_ranger.c.

◆ MultiRangerStatus

Enumerator
MULTI_RANGER_UNINIT 
MULTI_RANGER_CONF_IO 
MULTI_RANGER_CONF_FRONT 
MULTI_RANGER_CONF_BACK 
MULTI_RANGER_CONF_RIGHT 
MULTI_RANGER_CONF_LEFT 
MULTI_RANGER_CONF_UP 
MULTI_RANGER_READ_FRONT 
MULTI_RANGER_READ_BACK 
MULTI_RANGER_READ_RIGHT 
MULTI_RANGER_READ_LEFT 
MULTI_RANGER_READ_UP 

Definition at line 74 of file cf_deck_multi_ranger.c.

Function Documentation

◆ multi_ranger_boot_device()

static void multi_ranger_boot_device ( VL53L1_Dev_t *dev  UNUSED)
static

Boot a device.

Definition at line 128 of file cf_deck_multi_ranger.c.

References dev, MULTI_RANGER_DISTANCEMODE, MULTI_RANGER_INTERMEASUREMENT_MS, MULTI_RANGER_TIMINGBUDGET_MS, and VL53L1X_BootDevice().

Referenced by multi_ranger_periodic().

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

◆ multi_ranger_event()

void multi_ranger_event ( void  )

◆ multi_ranger_init()

◆ multi_ranger_periodic()

◆ multi_ranger_read()

static bool multi_ranger_read ( struct SingleRanger *ranger  UNUSED)
static

Read data from a device.

Returns
true when read cycle is finished

Definition at line 164 of file cf_deck_multi_ranger.c.

References SingleRanger::azimuth, SingleRanger::bearing, SingleRanger::dev, SingleRanger::distance, OBS_DETECTION_MULTI_RANGER_DECK_ID, cf_deck_multi_ranger::ranger, and VL53L1X_NonBlocking_ReadDataEvent().

Referenced by multi_ranger_event().

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

◆ multi_ranger_report()

void multi_ranger_report ( void  )

Variable Documentation

◆ multi_ranger

◆ multi_ranger_array_orientation

const float multi_ranger_array_orientation[][2] = MULTI_RANGER_ARRAY_ORIENTATION
static

Definition at line 105 of file cf_deck_multi_ranger.c.

Referenced by multi_ranger_init().