Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
c7d0feb6
Commit
c7d0feb6
authored
3 years ago
by
Colton Glick
Committed by
Ryan Hunt
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Emergency stop disable
parent
4e7750ff
No related branches found
No related tags found
1 merge request
!71
Emergency stop disable
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crazyflie_software/crazyflie-firmware-2021.06/src/modules/src/supervisor.c
+16
-1
16 additions, 1 deletion
...e/crazyflie-firmware-2021.06/src/modules/src/supervisor.c
with
16 additions
and
1 deletion
crazyflie_software/crazyflie-firmware-2021.06/src/modules/src/supervisor.c
+
16
−
1
View file @
c7d0feb6
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment