Page 1 of 1

Autonomous sequence and logging data

Posted: Tue Apr 17, 2018 7:39 pm
by simonjohansson
Hi!

I just started my bachelor thesis about PID tuning for the crazyflie 2.0. I want to look at the PIDs with different weights applied to the CF. I will begin with looking at a movement in z-direction. So I wonder if it is possible to combine the two example scripts autonomousSequence.py and basiclog.py from https://github.com/bitcraze/crazyflie-lib-python.git to fly to a certain point and log the position variables during the flight? Also I would like to save the data to a file so I can analyze it further.
Thank you!

/Simon J

Re: Autonomous sequence and logging data

Posted: Wed Apr 18, 2018 5:46 am
by arnaud
Hi,

If you uncomment the function call start_position_printing, a log block will be setup and the function position_callback will be called twice a second with the position of the Crazyflie. You can change the log rate and log variables in start_position_printing. The API used by these function is the same as the one used in basiclog.

To save the data, the simplest is usually to write them as CSV in a file. There is no function in the Crazyflie lib for that but it is quite easy to do in python.

ps. I moved the thread in the developer discussions forum since it seemed more appropriate.

Re: Autonomous sequence and logging data

Posted: Wed Apr 18, 2018 8:36 am
by simonjohansson
Okey, thanks for the answers!

/Simon J