ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unreliable communication using executors

asked 2018-04-20 07:02:22 -0500

Dangield gravatar image

updated 2018-04-24 12:46:18 -0500

Hello. I have a problem I can’t solve by myself. I have 2 nodes inheriting from the main Node class, one of them receives data from an IMU and sends it to the other. In the other one frequency of received messages is being calculated.

When I run both nodes separately I get results close to expected ones, so eg for 50Hz publishing I receive messages with ~50Hz frequency, for 25Hz it’s also ~25Hz and so on. The issue starts when I try to start both nodes from an executor. In that case when publishing with 50Hz I receive messages with about 37-38 Hz, for 25Hz - ~18-19Hz and so on. Generally for every frequency above 1 Hz I receive messages with about 2/3-3/4 of the publishing frequency. I tried both single-threaded and multi-threaded executor but it doesn’t seem to change anything, nor does toggling the intra-process communication in nodes’ constructors. I’ve also tried modifying QoS options of this particular connection on both ends but with no effect. The publishing node has been confirmed to publish data with configured frequency.

I'm working on BeagleBone Green Wireless board with 4.4.113-ti-r149 linux kernel. I'm using ros2 ardent latest version (I updated this month but I am not aware if the issue was present before or not).

Publisher Node: https://github.com/GroupOfRobots/RysR...

Subscriber Node: https://github.com/GroupOfRobots/RysR...

Launching with executors: https://github.com/GroupOfRobots/RysR...

edit retag flag offensive close merge delete

Comments

Thanks for reporting back how you solved it.

Could you please post that as an answer yourself, and then accept your own answer?

We don't normally close questions here on ROS Answers if they have an actual answer.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-24 12:09:23 -0500 )edit

Just accepted it for you.

Thanks for posting the answer.

gvdhoorn gravatar image gvdhoorn  ( 2018-04-24 12:48:43 -0500 )edit

Of course. Sorry for inconvenience.

Dangield gravatar image Dangield  ( 2018-04-24 12:49:40 -0500 )edit

@Dangield I'm glad you figured it out, sorry I didn't have time to dig into it myself.

William gravatar image William  ( 2018-04-26 12:40:41 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-04-24 12:46:28 -0500

Dangield gravatar image

I found the solution. It seems that it was caused by a rclcpp::sleep_for() found in a different node ran from this executor.

edit flag offensive delete link more

Comments

Is it possible you could link to the line (permalink, not a branch in case you change it) which was using the sleep_for()? I'm curious where the sleep_for() was and as to why it was blocking all your multi-threaded executor threads.

William gravatar image William  ( 2018-04-26 12:43:41 -0500 )edit

Sorry, didn't see your comment earlier. It's here. There is a for loop with sleep_for() in it, that seemed to be the problem.

Dangield gravatar image Dangield  ( 2018-05-15 06:26:31 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2018-04-20 07:02:22 -0500

Seen: 266 times

Last updated: Apr 24 '18