Autonomous sequence and logging data

Firmware/software/electronics/mechanics
Post Reply
simonjohansson
Beginner
Posts: 16
Joined: Thu Feb 08, 2018 9:10 pm

Autonomous sequence and logging data

Post 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
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Autonomous sequence and logging data

Post 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.
simonjohansson
Beginner
Posts: 16
Joined: Thu Feb 08, 2018 9:10 pm

Re: Autonomous sequence and logging data

Post by simonjohansson »

Okey, thanks for the answers!

/Simon J
Post Reply