Stopping my crazyflie

Discussions about all things Bitcraze
Post Reply
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Stopping my crazyflie

Post by RyanMco »

Hi guys, I'm controlling my crazyflie by python script and I would like to know how can I stop immediately my crazyflie eventhough if he didn't land, I mean whenever I press for example the button "f" then my crazyflie should be land immediately(shut down) .. any clue?
what command/code should I add to my python script for letting my crazyflie to stop immediately even though it was hovering/running ?! any clue?

because sometimes my crazyflie goes crazy and I need a away to stop it while running the script of crazyflie's controlling .
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Stopping my crazyflie

Post by arnaud »

The exact answer depends of what API you are using in your python script. If you are sending commander serpoints at regular interval, you can just call "cf.commander.send_stop_setpoint()" and the motors will stop directly.

If you are using the motion commander, unfortunately there is no stop functionality for it yet. One thing you can try (I have not tried it myself but in theory it should work) is to raise an exception and at the end of your program, outside the motion commander context, call "cf.commander.send_stop_setpoint()".
Post Reply