Skip to content
Snippets Groups Projects
Commit 9530b6c2 authored by Bart Slinger's avatar Bart Slinger Committed by Daniel Agar
Browse files

bebop 2 disable motors on kill (#10605)

parent b83cb795
No related branches found
No related tags found
No related merge requests found
......@@ -432,14 +432,16 @@ void task_main(int argc, char *argv[])
orb_copy(ORB_ID(actuator_armed), _armed_sub, &_armed);
}
const bool lockdown = _armed.manual_lockdown || _armed.lockdown;
// Start the motors if armed but not alreay running
if (_armed.armed && !_motors_running) {
if (_armed.armed && !lockdown && !_motors_running) {
g_dev->start_motors();
_motors_running = true;
}
// Stop motors if not armed but running
if (!_armed.armed && _motors_running) {
// Stop motors if not armed or killed, but running
if ((!_armed.armed || lockdown) && _motors_running) {
g_dev->stop_motors();
_motors_running = false;
}
......
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