Page 1 of 2
Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Tue Sep 13, 2016 11:57 am
by sicaria
Hi i have gotten my crazyflie working with the basic ramp python script. I have also created a gui in tkinter. I need to poll pitch,roll,yaw data when it's pushed to me my program fails or the read of the pitch,roll,yaw data fails. I am using the log example to get the data but don't know how to stop it pushing data to my computer.
Please help! I'm not very good with python.
Thank you.
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Mon Sep 19, 2016 2:20 pm
by tobias
Welcome to the forum!
I don't really get what you meed with "but don't know how to stop it pushing data to my computer. "
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Sat Oct 01, 2016 9:37 am
by sicaria
Thanks, basically I want to use althold but I'm not sure how to do it with the crazyflie 2.0. I thought I could read the stabiliser data and compensate but this does not seem to be the way. I really need to use althold with python. I've tried it but get a TOC error saying it's althold isn't there. I've seen the posts for the crazyflie 1 but it doesn't seem to work for crazyflie 2. I have the latest firmware. Also have a gui with a kill switch for safety. Please help
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Tue Oct 04, 2016 9:50 am
by arnaud
Hi,
For alt-hold you can look at this post:
viewtopic.php?f=5&t=2167&p=10968&hilit=althold#p10974
As for the python lib, if you want to stop getting data you can disconnect the Crazyflie by calling the method close_link() the way it is done in the ramp example.
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Tue Oct 11, 2016 8:33 am
by sicaria
Thanks but it doesn't seem to work well for me I get massive drops from the Crazyflie. I do have extra weight on the Crazyflie, I have IR markers that I'm using to locate the position of the Crazyflie in a room of cameras. I have tried to compensate for this by increasing the value of the althold setting. I have also read a paper that said the altituide hold on the quadcopter is only good to a few meters because of the barometer. If this is true how did that fellow get his althold working?
Thanks for the option to close the link but I can't do this because by the time I open the link again to send a command the Crazyflie will have dropped.
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Wed Oct 12, 2016 8:44 am
by arnaud
How is altitude hold behaving when flying manually? The current implementation is not stellar and adding weight is typically something that could affect it. Though I have hope that we could get better performance with the new Kallman filter. You could also use the kalman filter by pushing-in the location you measure by your mocap by the way, that has been tested and it works quite well. You then get not only altitude hold but full x/y/z control.
As for the log, there is function to stop the log block so that you can interrupt the data flow without disconnecting.
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Wed Oct 12, 2016 12:06 pm
by sicaria
Thanks that's interesting your saying I can feed back the position data into the crazyflie and make it react to that?
No problems I thought that was the case.
Thanks again!
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Wed Oct 12, 2016 12:17 pm
by arnaud
You can look there to enable the Kalman filter:
https://wiki.bitcraze.io/doc:lps:index# ... man_filter
And this is the pull request that enabled pushing external position measurement:
https://github.com/bitcraze/crazyflie-firmware/pull/147
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Sun Oct 23, 2016 12:04 am
by sicaria
Sorry I missed that when reading before. There is a function to stop the log without disconnecting? Could you please tell me which function to use. Thank you.
Re: Need Help to control crazyflie 2.0 polling pitch,yaw,roll
Posted: Mon Oct 24, 2016 11:29 am
by marcus
Yes, you can either call stop() on the log configuration or delete() on it. The difference is that if you call stop on the log configuration it is still present in the Crazyflie 2.0 but the data stop coming. If you call delete it is removed (and the data stopps coming). There's a limited amount of logging configurations that the Crazyflie 2.0 can handle that's why you can remove it.