USC-ACTLab / crazyswarm

A Large Quadcopter Swarm
MIT License
319 stars 316 forks source link

Logging Frequency Bug #738

Closed rossizero closed 1 year ago

rossizero commented 1 year ago

A colleague of mine and I happened to be investigating the logging functionality of crazyflies and came across this little bug that prevents data from being logged at the intended frequency. Example: You want to log with a frequency of 3 hz. Then we should givem_logBlocksGeneric[i]->start() a period of 333ms (1000ms / 3). Right now the calculation 3 / 10 returns 0. But, in the m_logBlocksGeneric[i]->start() function there is a comment that says logging period needs to be given in increments of 10ms. Therefore we need to calculate 100 / 3, since after that a * 10 is applied onto that value. Is there anything we might have missed? Cheers!

whoenig commented 1 year ago

Your calculation and fix is correct - the current implementation is simply not a frequency.

I don't think we can merge it for two reasons:

  1. It will break existing configuration files, that rely on the previous wrong semantics.
  2. Our attention is now on Crazyswarm2, since ROS(1) will not be supported for much longer.