Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving more IMU data per second #14

Open
annalena00 opened this issue Apr 29, 2016 · 3 comments
Open

Receiving more IMU data per second #14

annalena00 opened this issue Apr 29, 2016 · 3 comments

Comments

@annalena00
Copy link

Hi there,

while using the library, I wondered that I get the IMU data at only 10 Hz. In contrast, the python library received data at 100 Hz. My inspections give that the m_lstLoggingPackets from CCrazyRadio.cpp filled with new data only at 60 Hz (10 Hz for one sensor e.g. accelerometer).
Is it possible that this deals with the use of synchronous functions of libusb? Or does someone have a solution to accelerate the receive of sensor data?

Thank you very much!

@fairlight1337
Copy link
Owner

Ah, just replied to your mail. How did you figure out the 60 Hz exactly?
That definitely could be (for a number of reasons..), the most prominent being:

  • std::list might not have been the best choice for this or
  • the way sending/receive is implemented limits the receiving bandwidth

I don't have the hardware at hand anymore, but will gladly look into the algorithms

@annalena00
Copy link
Author

annalena00 commented Apr 29, 2016

Thanks for your reply! I figured out the 60 Hz by counting the function calls per second of CCrazyRadio::sendPacket() where m_lstLoggingPackets is filled.
Changing the default value of sendAndReceive() unfortunately do not increase the frequency.
I found out that the length of a crtpPacket is 0 in many cases, which arises from readAck(), which calls readData() where the libusb function is called. Maybe you are right and sending/receiving should be checked.

@annalena00
Copy link
Author

Hello again,

I find a way to accelerate the data arrival and for my purposes it should be working now but in my opinion there is somewhere a bottleneck, which I do not find yet.

Since I only need the accelerometer and gyroscope data, I set their frequency to 10ms ( -> m_tocLogs->registerLoggingBlock("accelerometer", 10000) instead of 1000 ) and log the other sensor data every 100ms. Additionally, I changed the m_dSendSetpointPeriod to 0.001s instead of 0.01s.

Now I get accelermeter and gyroscope data at round about 100Hz. In my case it works for max. 3 of 6 sensor logs. More logs cause a very low data rate, it seems they split the data rate. Maybe somewhere the bandwidth is not enough, or some functions should be parallelized or something like that.

Greetings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants