Skip to content
Snippets Groups Projects
Commit 98eb3137 authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Merge branch 'remove_emergency_stop' into 'master'

Emergency stop disable

See merge request !71
parents 4e7750ff c7d0feb6
No related branches found
No related tags found
1 merge request!71Emergency stop disable
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "log.h" #include "log.h"
#include "param.h"
#include "motors.h" #include "motors.h"
#include "pm.h" #include "pm.h"
#include "stabilizer.h" #include "stabilizer.h"
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
static bool canFly; static bool canFly;
static bool isFlying; static bool isFlying;
static bool isTumbled; static bool isTumbled;
static bool emergencyStopEnable = 1;
bool supervisorCanFly() bool supervisorCanFly()
{ {
...@@ -118,7 +120,9 @@ void supervisorUpdate(const sensorData_t *data) ...@@ -118,7 +120,9 @@ void supervisorUpdate(const sensorData_t *data)
isTumbled = isTumbledCheck(data); isTumbled = isTumbledCheck(data);
if (isTumbled && isFlying) { if (isTumbled && isFlying) {
stabilizerSetEmergencyStop(); if(emergencyStopEnable){
stabilizerSetEmergencyStop();
}
} }
canFly = canFlyCheck(); canFly = canFlyCheck();
...@@ -141,3 +145,14 @@ LOG_ADD_CORE(LOG_UINT8, isFlying, &isFlying) ...@@ -141,3 +145,14 @@ LOG_ADD_CORE(LOG_UINT8, isFlying, &isFlying)
*/ */
LOG_ADD_CORE(LOG_UINT8, isTumbled, &isTumbled) LOG_ADD_CORE(LOG_UINT8, isTumbled, &isTumbled)
LOG_GROUP_STOP(sys) LOG_GROUP_STOP(sys)
PARAM_GROUP_START(sys)
/**
* @brief If 1 (default) enables the emergency stop when the crazyflie is tumbling,
* if 0 disables emergency stop (used for testing purposes)
*
*/
PARAM_ADD(PARAM_TYPE_INT, e_stop, &emergencyStopEnable)
PARAM_GROUP_STOP(sys)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment