Update spiral detection code

pull/1/head
YohanHadji 2022-03-29 23:09:43 +02:00
rodzic 14b26605cf
commit b56a259026
2 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -28,11 +28,12 @@
#define LINEAR_MODE 0 // command is linear (0), or linear but with a large deadband set using servo_start etc (1)
#define DROP true // R2Home's version, drop or motorised
#define DESCENT_TIMER 1000
#define GLIDING_TIMER 3000
#define DEP_ALT 100 // m above ground
#define VUP 1 // m/s
#define VDOWN -1.5 // m/s
#define DESCENT_TIMER 15000
#define OPENING_TIMER 6000
#define SPIRAL_RECOVER 5000
#define DEP_ALT 300 // m above ground
#define VUP 5 // m/s
#define VDOWN -6 // m/s
#define NKP 1
#define NKI 0.05

Wyświetl plik

@ -8,6 +8,7 @@ bool flight_started = false;
bool deployed = false;
bool wing_opened = false;
bool spiral = false;
unsigned long spiral_time = 0;
unsigned long init_time = 0;
@ -155,9 +156,10 @@ void flight_gliding_auto() {
if (is_descent(v_down(-5), 0)) {
spiral = true;
spiral_time = millis();
}
if (is_ascent(v_down(-2), 0)) {
if (millis()-spiral_time>SPIRAL_RECOVER) {
spiral = false;
}