This repository was archived by the owner on May 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 926
This repository was archived by the owner on May 31, 2025. It is now read-only.
[message_filters] Python interface of approximate synchronizer hangs up with large queue size #800
Copy link
Copy link
Closed
Description
Issue
Topic's fps goes down. When I use the message_filter's approximate synchronizer with large queue size (100) and processing in the callback which takes time (1 second).
% roslaunch jsk_20160505_test_message_filters string.launch
% rostopic hz /join_strings/output
subscribed to [/join_strings/output]
average rate: 0.997
min: 1.003s max: 1.003s std dev: 0.00000s window: 2
average rate: 0.996
min: 1.003s max: 1.004s std dev: 0.00019s window: 3
average rate: 0.975
min: 1.003s max: 1.070s std dev: 0.03121s window: 4
average rate: 0.962
min: 1.003s max: 1.079s std dev: 0.03554s window: 5
average rate: 0.949
min: 1.003s max: 1.112s std dev: 0.04305s window: 6
average rate: 0.925
min: 1.003s max: 1.219s std dev: 0.07304s window: 7
average rate: 0.915
min: 1.003s max: 1.219s std dev: 0.07346s window: 8
no new messages
average rate: 0.887
min: 1.003s max: 1.373s std dev: 0.11528s window: 9
average rate: 0.871
min: 1.003s max: 1.373s std dev: 0.12357s window: 10
no new messages
average rate: 0.786
min: 1.003s max: 2.381s std dev: 0.38777s window: 11
no new messages
no new messages
no new messages
no new messages
average rate: 0.621
min: 1.003s max: 5.008s std dev: 1.13588s window: 12
no new messages
no new messages
average rate: 0.579
min: 1.003s max: 5.008s std dev: 1.15229s window: 13
no new messages
no new messages
no new messages
no new messages
average rate: 0.519
min: 1.003s max: 5.008s std dev: 1.30438s window: 14
no new messages
no new messages
no new messages
average rate: 0.470
min: 1.003s max: 5.008s std dev: 1.45689s window: 15
no new messages
Testing Code
- Package: https://github.com/wkentaro/jsk_20160505_test_message_filters
- string.launch: https://github.com/wkentaro/jsk_20160505_test_message_filters/blob/master/launch/string.launch
- publish_string: https://github.com/wkentaro/jsk_20160505_test_message_filters/blob/master/scripts/publish_string
- join_strings: https://github.com/wkentaro/jsk_20160505_test_message_filters/blob/master/scripts/join_strings (sync 3 topics with 1sec sleep in callback)
Solution
After some workaround with print debugging, I found this section takes time when the program hangs up.
https://github.com/ros/ros_comm/blob/kinetic-devel/utilities/message_filters/src/message_filters/__init__.py#L224-L231
So solutions are:
- Refactor code for searching the timestamp to do it with pure python [message_filters] Fast approximate time synchronization in message_filters (pure python) #802
- Use numpy for searching the timestamp [message_filters] Fast approximate time synchronization in message_filters (with numpy) #801
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels