mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Collision Detection (#13010)
This commit is contained in:
parent
cfa5f0b2a1
commit
db44e9df9e
7 changed files with 99 additions and 56 deletions
|
@ -20,9 +20,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/axis.h"
|
||||
#include "common/time.h"
|
||||
#include "pg/pg.h"
|
||||
#include "common/vector.h"
|
||||
|
||||
#include "drivers/accgyro/accgyro.h"
|
||||
|
||||
#include "pg/pg.h"
|
||||
|
||||
#include "sensors/sensors.h"
|
||||
|
||||
// Type of accelerometer used/detected
|
||||
|
@ -54,10 +59,11 @@ typedef enum {
|
|||
typedef struct acc_s {
|
||||
accDev_t dev;
|
||||
uint16_t sampleRateHz;
|
||||
vector3_t accADC;
|
||||
vector3_t accADC; // rotated but unscaled ADC value
|
||||
vector3_t jerk;
|
||||
float accMagnitude; // in multiples of 1G
|
||||
float jerkMagnitude; // in multiples of 1G/s (measure of collision strength)
|
||||
bool isAccelUpdatedAtLeastOnce;
|
||||
float accMagnitude;
|
||||
float accDelta;
|
||||
} acc_t;
|
||||
|
||||
extern acc_t acc;
|
||||
|
@ -74,7 +80,7 @@ typedef union rollAndPitchTrims_u {
|
|||
|
||||
#if defined(USE_ACC)
|
||||
typedef struct accelerometerConfig_s {
|
||||
uint16_t acc_lpf_hz; // cutoff frequency for the low pass filter used on the acc z-axis for althold in Hz
|
||||
uint16_t acc_lpf_hz; // cutoff frequency for attitude anti-aliasing filter
|
||||
uint8_t acc_hardware; // Which acc hardware to use on boards with more than one device
|
||||
bool acc_high_fsr;
|
||||
flightDynamicsTrims_t accZero;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue