Replies: 2 comments 6 replies
-
Hi! There is an step-by-step example that at least has async logging, but not that for the motion commander I'm afraid: https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/user-guides/sbs_motion_commander/. I'm sure that if you start the motion commander instance in the right way, and find a way to pass that instance to the call back functions, this should be possible. However there is a lot of logic going on in that class that might block it from flying if the connection is setup probably, since it is meant as a wrapper around the basic commander class to make things (supposably) simpler. So if you want to do something special like that maybe the motion commander is not the right place to look. Their might be an 'easier' way How about you use the commander class instance? This is one step down in high-level-ness, but you are able to more easily send setpoints to the crazyflie (like send_hover_setpoint() ). As it is low level, it needs to be ensured that the setpoint is send constantly with a half-second interval at least. There are some examples in the python library repo that you could look at that use the basic commander class:
|
Beta Was this translation helpful? Give feedback.
-
The high level commander you could also have a look at. As this is for more onboard autonomy you don't need to send it setpoints every 0.5 seconds, but if you lose connection it won't turn off the motors either. Here is the api for that: https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/api/cflib/crazyflie/high_level_commander/ and it has a go_to functionality that can be done relative of your current position. |
Beta Was this translation helpful? Give feedback.
-
I apologize for the question I posted yesterday or the day before to which I could have easily found the answer in the documentation. There is however still something that is not clear to me: can you control the motion commander asynchronously? This would be useful for me because it would allow making a function that for example takes x and y displacement from the current position as an input and then makes the drone do that. If one were to use the synchronous way of doing things, it would land after this function which is not desired. Maybe there are alternatives, just let me know.
Thanks in advance,
Ethan Thiebaut
Beta Was this translation helpful? Give feedback.
All reactions