[ros-users] problems receiving messages

gustavo freitas gustavomfreitas at yahoo.com
Tue May 3 14:17:57 UTC 2011

	p { margin-bottom: 0.08in; }a:link {  }


am having some problems receiving messages.
idea is to implement an EKF using data from odometry, gps, laser scan
and row detection.
messages are recorded in bags, with frequencies of 45, 95, 75 and 15
Hz, respectively.

I implemented a code that just receives the messages, with the
callback associated functions printing on screen the time stamp of
each message, and in the end the program prints the received messages
total number.

first strange thing noticed is that, using subscribers queue size = 1
and spinOnce() with  loop_rate.sleep() of 1 KHz, I am missing about
50% of the messages recorded in the bags. It is strange, because the
total frequency of the messages in the bags is 230 Hz, and the code
is running at 1 KHz.
that, to solve this, I changed to subscribers queue size = 50 with

it, I started to receive all the messages. But looking to the screen,
it is possible to see that the different type messages are arriving
out of time order.  ROS processes the entire queue of one message
type before starting to process the others. This could be the reason
for receiving messages in wrong order. But even looking to the first
message of each block type, the time stamps are still out of order.

tried different things, like spin() with multi threads and the
approximate time message filter, and I am still receiving the
messages out of order. My last try was to store all the messages in a
single bag, and run the code in
to order the messages in the bag to match the timestamps. The results
got much better, but I am still receiving some messages out of time

ROS supposed to work like this? Do you have any suggestion to solve
these problems?

a lot,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20110503/6c49dc28/attachment-0001.html>

More information about the ros-users mailing list