|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
37 #ifndef MULTI_RANGER_EARLY_INIT
38 #define MULTI_RANGER_EARLY_INIT TRUE
45 #ifndef MULTI_RANGER_TIMINGBUDGET_MS
46 #define MULTI_RANGER_TIMINGBUDGET_MS 100
51 #ifndef MULTI_RANGER_DISTANCEMODE
52 #define MULTI_RANGER_DISTANCEMODE 2
59 #ifndef MULTI_RANGER_INTERMEASUREMENT_MS
60 #define MULTI_RANGER_INTERMEASUREMENT_MS MULTI_RANGER_TIMINGBUDGET_MS
62 #if MULTI_RANGER_INTERMEASUREMENT_MS < MULTI_RANGER_TIMINGBUDGET_MS
63 #warning MULTI_RANGER_INTERMEASUREMENT_MS should be greater than or equal to MULTI_RANGER_TIMINGBUDGET_MS
67 #define MULTI_RANGER_PIN_FRONT PCA95XX_P4
68 #define MULTI_RANGER_PIN_BACK PCA95XX_P1
69 #define MULTI_RANGER_PIN_RIGHT PCA95XX_P2
70 #define MULTI_RANGER_PIN_LEFT PCA95XX_P6
71 #define MULTI_RANGER_PIN_UP PCA95XX_P0
72 #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)
77 #ifdef MULTI_RANGER_EXTRA_DEV
78 MULTI_RANGER_CONF_EXTRA,
102 #ifndef MULTI_RANGER_ARRAY_ORIENTATION
103 #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}}
144 #if MULTI_RANGER_EARLY_INIT
168 bool new_data =
false;
bool pca95xx_set_output(struct pca95xx *dev, uint8_t mask, bool blocking)
Set output value.
bool pca95xx_configure(struct pca95xx *dev, uint8_t val, bool blocking)
Configure PCA95XX.
static bool multi_ranger_read(struct SingleRanger *ranger UNUSED)
Read data from a device.
void VL53L1X_BootDevice(VL53L1_DEV dev, uint16_t TimingBudgetInMs, uint16_t DistanceMode, uint32_t InterMeasurementInMs)
Implement boot sequence of VL53L1 device as described in documentation See VL53L1X_SetTimingBudgetInM...
@ MULTI_RANGER_READ_RIGHT
#define MULTI_RANGER_PIN_RIGHT
Non-blocking runtime functions for the VL53L1X.
#define MULTI_RANGER_PIN_BACK
static void multi_ranger_boot_device(VL53L1_Dev_t *dev UNUSED)
Boot a device.
float bearing
bearing [rad] relative to body frame
@ MULTI_RANGER_READ_FRONT
void multi_ranger_report(void)
void multi_ranger_event(void)
#define MULTI_RANGER_PIN_ALL
VL53L1_Dev_t dev
sensor driver
#define PCA95XX_DEFAULT_ADDRESS
uint8_t read_state
current reading state
enum MultiRangerStatus status
static const struct usb_device_descriptor dev
bool VL53L1X_NonBlocking_RequestData(VL53L1_DEV dev)
Request a new reading.
void pca95xx_init(struct pca95xx *dev, struct i2c_periph *i2c_p, uint8_t addr)
Init PCA95XX.
float distance
raw distance measurement
@ MULTI_RANGER_CONF_FRONT
#define MULTI_RANGER_DISTANCEMODE
#define MULTI_RANGER_TIMINGBUDGET_MS
Common code for AP and FBW telemetry.
uint8_t slave_addr
Slave address.
bool VL53L1X_NonBlocking_ReadDataEvent(VL53L1_DEV dev, uint16_t *distance_mm, bool *new_data)
Implement non-blocking read sequence The data reading actually starts when the read_state is set to V...
#define OBS_DETECTION_MULTI_RANGER_DECK_ID
void multi_ranger_init(void)
Module init.
#define MULTI_RANGER_INTERMEASUREMENT_MS
bool VL53L1X_NonBlocking_IsIdle(VL53L1_DEV dev)
Test is read status is on idle.
struct SingleRanger ranger[MULTI_RANGER_NB]
sensor array
static const float multi_ranger_array_orientation[][2]
#define MULTI_RANGER_ARRAY_ORIENTATION
#define MULTI_RANGER_PIN_FRONT
void multi_ranger_periodic(void)
Module periodic function.
#define MULTI_RANGER_PIN_LEFT
static struct cf_deck_multi_ranger multi_ranger
float azimuth
azimuth [rad] relative to body frame
@ MULTI_RANGER_CONF_RIGHT