Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/range_finder/cf_deck_multi_ranger.h"
#include "peripherals/pca95x4.h"
#include "peripherals/vl53l1x_nonblocking.h"
#include "peripherals/vl53l1x_api.h"
#include "subsystems/abi.h"
#include "subsystems/datalink/downlink.h"
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 PCA95X4_P4 |
#define | MULTI_RANGER_PIN_BACK PCA95X4_P1 |
#define | MULTI_RANGER_PIN_RIGHT PCA95X4_P2 |
#define | MULTI_RANGER_PIN_LEFT PCA95X4_P6 |
#define | MULTI_RANGER_PIN_UP PCA95X4_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}} |
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 |
Definition in file cf_deck_multi_ranger.c.
struct SingleRanger |
Definition at line 107 of file cf_deck_multi_ranger.c.
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 |
struct cf_deck_multi_ranger |
Definition at line 115 of file cf_deck_multi_ranger.c.
Data Fields | ||
---|---|---|
struct pca95x4 | pca | |
struct SingleRanger | ranger[MULTI_RANGER_NB] | sensor array |
enum MultiRangerStatus | status |
#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.
#define MULTI_RANGER_DISTANCEMODE 2 |
Definition at line 52 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_boot_device().
#define MULTI_RANGER_EARLY_INIT TRUE |
Definition at line 38 of file cf_deck_multi_ranger.c.
#define MULTI_RANGER_INTERMEASUREMENT_MS MULTI_RANGER_TIMINGBUDGET_MS |
Definition at line 60 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_boot_device().
#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) |
Definition at line 72 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_init(), and multi_ranger_periodic().
#define MULTI_RANGER_PIN_BACK PCA95X4_P1 |
Definition at line 68 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_periodic().
#define MULTI_RANGER_PIN_FRONT PCA95X4_P4 |
Definition at line 67 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_periodic().
#define MULTI_RANGER_PIN_LEFT PCA95X4_P6 |
Definition at line 70 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_periodic().
#define MULTI_RANGER_PIN_RIGHT PCA95X4_P2 |
Definition at line 69 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_periodic().
#define MULTI_RANGER_PIN_UP PCA95X4_P0 |
Definition at line 71 of file cf_deck_multi_ranger.c.
#define MULTI_RANGER_TIMINGBUDGET_MS 100 |
Definition at line 46 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_boot_device().
enum 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.
enum MultiRangerStatus |
Definition at line 74 of file cf_deck_multi_ranger.c.
|
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().
void multi_ranger_event | ( | void | ) |
Definition at line 251 of file cf_deck_multi_ranger.c.
References multi_ranger, MULTI_RANGER_BACK, MULTI_RANGER_FRONT, MULTI_RANGER_LEFT, multi_ranger_read(), MULTI_RANGER_RIGHT, MULTI_RANGER_UP, and cf_deck_multi_ranger::ranger.
void multi_ranger_init | ( | void | ) |
Module init.
Definition at line 138 of file cf_deck_multi_ranger.c.
References SingleRanger::azimuth, SingleRanger::bearing, SingleRanger::dev, SingleRanger::distance, VL53L1_Dev_t::i2c_p, VL53L1_Dev_t::i2c_trans, multi_ranger, multi_ranger_array_orientation, MULTI_RANGER_NB, MULTI_RANGER_PIN_ALL, MULTI_RANGER_UNINIT, cf_deck_multi_ranger::pca, pca95x4_configure(), PCA95X4_DEFAULT_ADDRESS, pca95x4_init(), pca95x4_set_output(), cf_deck_multi_ranger::ranger, VL53L1_Dev_t::read_status, i2c_transaction::slave_addr, cf_deck_multi_ranger::status, VL53L1_DEFAULT_ADDRESS, and VL53L1_READ_IDLE.
void multi_ranger_periodic | ( | void | ) |
Module periodic function.
Definition at line 181 of file cf_deck_multi_ranger.c.
References SingleRanger::dev, multi_ranger, MULTI_RANGER_BACK, multi_ranger_boot_device(), MULTI_RANGER_CONF_BACK, MULTI_RANGER_CONF_FRONT, MULTI_RANGER_CONF_IO, MULTI_RANGER_CONF_LEFT, MULTI_RANGER_CONF_RIGHT, MULTI_RANGER_CONF_UP, MULTI_RANGER_FRONT, MULTI_RANGER_LEFT, MULTI_RANGER_PIN_ALL, MULTI_RANGER_PIN_BACK, MULTI_RANGER_PIN_FRONT, MULTI_RANGER_PIN_LEFT, MULTI_RANGER_PIN_RIGHT, MULTI_RANGER_READ_BACK, MULTI_RANGER_READ_FRONT, MULTI_RANGER_READ_LEFT, MULTI_RANGER_READ_RIGHT, MULTI_RANGER_READ_UP, MULTI_RANGER_RIGHT, MULTI_RANGER_UNINIT, MULTI_RANGER_UP, cf_deck_multi_ranger::pca, pca95x4_configure(), pca95x4_set_output(), cf_deck_multi_ranger::ranger, cf_deck_multi_ranger::status, VL53L1X_NonBlocking_IsIdle(), and VL53L1X_NonBlocking_RequestData().
|
static |
Read data from a device.
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().
void multi_ranger_report | ( | void | ) |
Definition at line 261 of file cf_deck_multi_ranger.c.
References DefaultChannel, DefaultDevice, SingleRanger::distance, multi_ranger, MULTI_RANGER_NB, and cf_deck_multi_ranger::ranger.
|
static |
Definition at line 123 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_event(), multi_ranger_init(), multi_ranger_periodic(), and multi_ranger_report().
|
static |
Definition at line 105 of file cf_deck_multi_ranger.c.
Referenced by multi_ranger_init().