autonomousSequence.py

All discussions related to the Loco Positioning system
Post Reply
ole
Beginner
Posts: 2
Joined: Wed Jan 11, 2017 4:55 pm

autonomousSequence.py

Post by ole » Sun Jan 29, 2017 11:22 am

Hi,
I working with the LPS. My ambition is to perform a circle or an eight with the the crazyflie 2.0.
I found the python script autonomousSequence.py. So i created an array of points to perform the circle, but the script has an delay of 5 seconds between the points. Is there a way to get rid of this or maybe a better way to perform a path in the air?
Thanks for help.
Ole



arnaud
Bitcraze
Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: autonomousSequence.py

Post by arnaud » Mon Jan 30, 2017 1:44 pm

Hi Ole,

This loop is responsible for the timing: https://github.com/bitcraze/crazyflie-l ... #L141-L145. It loops 10 times a second, for 50 times, which means 50 seconds. The example in intended at getting you started so if you want to change setpoint more often you can change this 50 into a smaller number. You could also refactor the program to calculate the new serpoint at each loop. The key here is that the setpoint needs to be sent at regular interval: there is a watchdog in the Crazyflie that will take over if you do not send at least two setpoint per seconds.

With the current firmware, sending setpoint like this at regular interval is the way to perform path in the air (you can do it either from python or using ROS). Hopefully we will soon be able to merge the new controller from Mike hammer (https://github.com/bitcraze/crazyflie-f ... -273224981) that allows for much better trajectory since you can feed acceleration, velocity, and position setpoint all at once.

/Arnaud

ole
Beginner
Posts: 2
Joined: Wed Jan 11, 2017 4:55 pm

Re: autonomousSequence.py

Post by ole » Wed Feb 01, 2017 3:01 pm

Thank you this helps a lot. But since I've run "updatet all projects" the estimator doesn't find the cf anymore. The cf-client also fails, when I tri to start it. Any ideas how to fix this problem?
Ole

arnaud
Bitcraze
Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: autonomousSequence.py

Post by arnaud » Thu Feb 02, 2017 10:26 am

This is strange, update all should just pull the latest version of the project and do nothing on the radio connection.

If you are running the virtual machine on windows I have seen that it can be useful to install the crazyradio driver on windows, you can try to install it: https://wiki.bitcraze.io/doc:crazyradio ... dows_zadig.

Post Reply