[ros-users] Another question about policy based synchronizer

Aditya Gadre agadre at vt.edu
Mon Oct 18 16:28:23 UTC 2010


I have a working test code for policy based (approximate time) 
synchronizer in which one node publishes two data messages and the other 
node runs a synchronizer. One message is published at 1Hz and the other 
at 0.5Hz. For each message, I increment the relevant sequence number in 
the header. However, when these messages are received by the node 
running the policy based synchronizer, the sequence numbers are off by 
1, although the time stamps match perfectly.

For example, following output shows a simple run -

Publisher log:
[ INFO] [1287418571.114515026]: Starting 
test_policy_synchronizer_publisher node.
[ INFO] [1287418571.122496486]: Publishing AHRS data: time = 
1287418571.122447, seq = 1
[ INFO] [1287418572.122643642]: Publishing AHRS data: time = 
1287418572.122516, seq = 2
[ INFO] [1287418572.122956042]: Publishing Alasca data: time = 
1287418572.122883, seq = 1
[ INFO] [1287418573.122685477]: Publishing AHRS data: time = 
1287418573.122559, seq = 3
[ INFO] [1287418574.122935718]: Publishing AHRS data: time = 
1287418574.122809, seq = 4
[ INFO] [1287418574.123219204]: Publishing Alasca data: time = 
1287418574.123158, seq = 2
[ INFO] [1287418581.122753362]: Shutting down 
test_policy_synchronizer_publisher node.

Synchronizer node log:
[ INFO] [1287418573.123472169]: ----------
[ INFO] [1287418573.123744969]: Received message set
[ INFO] [1287418573.123947997]: AHRS: timestamp = 1287418572.122516, seq = 1
[ INFO] [1287418573.124106258]: Alasca: timestamp = 1287418572.122883, 
seq = 0
[ INFO] [1287418575.122839197]: ----------
[ INFO] [1287418575.122900518]: Received message set
[ INFO] [1287418575.122951782]: AHRS: timestamp = 1287418574.122809, seq = 3
[ INFO] [1287418575.123003883]: Alasca: timestamp = 1287418574.123158, 
seq = 1

Comparing time stamps of sent and received messages, I see that the 
sequence numbers in the synchronizer node are off by 1 (if sent message 
seq = 3 then received message seq = 2). I am not sure why this 
discrepancy is popping up. I would appreciate any help in this regard! I 
have attached source code for both nodes.

Thank you.
- Aditya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_policy_synchronizer.cpp
Type: text/x-c++src
Size: 1448 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101018/4d79cdc3/attachment-0008.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_policy_synchronizer_publisher.cpp
Type: text/x-c++src
Size: 1792 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101018/4d79cdc3/attachment-0009.cpp>


More information about the ros-users mailing list