Page 1 of 1

SOLVED: How to dynamically change the log interval of LogConfig?

Posted: Fri Mar 08, 2019 2:01 pm
by salocinx
Hi. I am currently working with Crazyflies 2.0 and Road-Runners. I am successfully gathering data from the devices, such as the stabilizer and loco position values using Python and the LogConfig class. Is it somehow possible to alter the "period_in_ms" value dynamically without disconnecting and connecting to the Crazyflies again?

Re: How to dynamically change the log interval of LogConfig?

Posted: Mon Mar 11, 2019 10:52 am
by arnaud
The log block period is set when you start the block, so it is possible to stop the block and restart it with a new period.

Unfortunatly, in the lib, it is not possible to set the period of the LogConfig object after it was created (this would be quite easy to fix, pull request welcome :). So you cannot just stop and restart the log block, you have to delete it with the delete method (https://github.com/bitcraze/crazyflie-l ... og.py#L282) and then create a new log config.

A more efficient way with the current lib would be to create two log config with two periods and to start/stop them when you need to change the period.

Re: How to dynamically change the log interval of LogConfig?

Posted: Mon Mar 11, 2019 10:35 pm
by salocinx
Thanks for the quick and detailed answer! For now, the current implementation does meet my requirements. In case I need more responsive interval modifications, I will follow your suggestion and take a closer look on the LogConfig implementation.

Re: SOLVED: How to dynamically change the log interval of LogConfig?

Posted: Tue Apr 16, 2019 1:15 pm
by ricardo.halfeld
arnaud wrote:
Mon Mar 11, 2019 10:52 am
...you have to delete it with the delete method...
Is there an example for this?