0
$\begingroup$

Rosanswers logo

Hi all,

So I have these load cells (4 of them) for which I have written a nice C++ class wrapper to interface with the sensors in a ROS environment. I have 4 topics, called "loadSensorX" where X = 0,1,2,3. These topics publish the force felt by these sensors in millipounds.

Now the load cells are actually LoadStar Sensor capacitive sensors with serial USB output. Here is the link to it

http://www.loadstarsensors.com/lc003-iload-tr-series-tilt-resistant-usb-load-cell.html

To the left of the page, you can see that default data rate for a standard sensor is 150 Hz. I have 4 of these sensors connected to my PC with a USB hub. Now all the topics and everything work fine. But when I do

rostopic hz /loadSensor0

instead of getting 150 Hz, I get only about 10-15 Hz. Also, when I connect just a single load cell instead of all 4 and try

rostopic hz /loadSensor0

I get about 50-55 Hz.

In both cases, I get much less data output rate compared to the promised 150 Hz. Which brings me to my question. Why does this happen? Is it because I am using a USB hub? Or is it my laptop specifications? Or is it ROS using up a lot of CPU power for just publishing 4 topics? Also, why do multiple load cells being connected with the hub affect my data rate?

My laptop specifications are

Intel Pentium CPU B960 Processor @ 2.20 GHz

64-bit Windows 8 OS with 32-bit Ubuntu 12.04 on VMWare Player.

4 GB RAM for host OS, 1 GB RAM for Ubuntu 12.04.

Thanks and any help is greatly appreciated.


Originally posted by Nishant on ROS Answers with karma: 143 on 2013-01-08

Post score: 0


Original comments

Comment by Eric Perko on 2013-01-09:
Can you try on Ubuntu installed on an actual machine? I'm curious if maybe there is some odd interaction in the VMWare USB stack that could be affecting this. Try @dornhege's suggestion first, but if it doesn't look like your code that is the problem, try removing the VM.

Comment by Nishant on 2013-01-09:
Yes, I had that feeling too. Plus, the computer I am using has only 1 processor. On an different computer that I used earlier, with 4 processors (pentium core i7), I got 16-20 Hz when I used 4 sensors and 60-65 Hz with 1 sensor. In any case, I will first try dornheges solution and post updates here.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I suspect that this is not a ROS problem. This can be simply tested: Just take your driver code and don't do anything ROS related. You'll need to check the frequency yourself manually and see the result. Depending on the result you can look further.

The data rate with one sensor connected seems 4x data rate with 4 sensors, so there seems to be some general bottleneck.


Originally posted by dornhege with karma: 31395 on 2013-01-09

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Nishant on 2013-01-09:
I was planning on doing exactly that. Isolate the serial reading and writing parts, and see how many times I can write to a file in say 1 second. However, I need to use the force logging feature in the background while I am doing something else. Do you suggest I use threads instead of topics then?

Comment by dornhege on 2013-01-09:
Not sure what you mean by "force logging feature". I wouldn't do anything with the data first, but get it, discard it and count the frequency. Once that is fine, you can go to processing (or check why it is too slow).

Comment by Nishant on 2013-01-09:
By force logging feature, I basically meant reading the force data from the sensor and writing it to a text file. I shall update this post as soon as I get results from the manual frequency tests.

Comment by Nishant on 2013-01-31:
@dornhege : I know this is a bit late, but I did try out your suggestion. Without the ROS stuff and manually measuring the frequency, I get about 55 Hz frequency per sensor. This means that I am losing out some data somewhere. What do you suggest I do now?

Comment by tfoote on 2013-03-05:
Make sure your send and receive buffers are large enough to receive messages from all senders simultaneously

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.