Increasing the logging rate

Firmware/software/electronics/mechanics
Post Reply
smokedasphalt
Beginner
Posts: 16
Joined: Sun May 19, 2013 1:51 pm
Location: Pune, India

Increasing the logging rate

Post by smokedasphalt »

Hello!
How can I go about increasing the remote logging frequency (currently limited to 100Hz) ?
I want to gather accelerometer data from the Crazyflie 1.0 at a rate of about 250Hz to 300Hz. No data is going to be sent to the flie during this period, so I think bandwidth should not be an issue.
I had a cursory look at log.c, but didn't find any explicit declaration of the 100Hz limit.
Thanks!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Increasing the logging rate

Post by arnaud »

Hi,

The limit is a bit hiden in the protocol: the delay between log values is set in step of 10ms. One quick hack that we already experimented once is to set it to step of 1ms. This can be done by removing the *10 in this line: https://github.com/bitcraze/crazyflie-f ... log.c#L283

Doing that will use a lot of bandwidth if you connect to the normal client but then if you ask for data at 100Hz you will actually get them at 1000Hz (and if you ask for 25Hz you will get 250Hz). If you want to use the client, use the "Log Blocks" tab to stop all log blocks but the one you want to see.
smokedasphalt
Beginner
Posts: 16
Joined: Sun May 19, 2013 1:51 pm
Location: Pune, India

Re: Increasing the logging rate

Post by smokedasphalt »

Thanks a lot Arnaud, that worked.
I am using basiclog.py from the examples folder. So, just setting the period_in_ms here https://github.com/bitcraze/crazyflie-c ... log.py#L80 to 20 ms gives me 500Hz.
Post Reply