Altitude Hold in Script

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
Posts: 2
Joined: Wed Feb 12, 2020 7:42 am

Altitude Hold in Script

Post by JindO »


I was wondering if the "altitude hold" function is available to use in a script i.e. can I write a script in which the crazyflie starts up as usual with the motioncommander and then holds its height with the barometer? If so, where can I start looking to implement this in a way I can also adjust height 'set-points'.
I already wrote a script that works with the flow-deck. The CF hovers and then gets velocity-setpoints via the keyboard to move, this I want to implement without the flow-deck
The implementation is only used for testing. It is probably easiest to use the flow-deck or another positioning method, but I want to know if it is possible, I read here ... d-features that this function is deactivated due to safety reasons. I'm btw testing in a controlled environment, we have nets protecting us from crazy quads ;)

Posts: 700
Joined: Fri Jul 06, 2018 11:13 am

Re: Altitude Hold in Script

Post by kimberly »

So if you are using a script that is able to work with the flowdeck and position setpoints, that is pretty much the 'altitude hold' as the cfclient does it, so you are on the right track.

Making the drone hover on baro will be though since the baro changes a lot due to the flow of air caused by the propellers (and by the ground if the crazyflie is still on the ground). Also be aware that a different estimator (complementary filter) is used if the flowdeck is not connected.

Btw, the link that you send is from the android client and not the PC python library. Please look at this repo: and this doc: ... ter/index/
Post Reply