Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo for callback-group-level executor concept. #302

Merged
merged 17 commits into from
Mar 11, 2021
Merged

Demo for callback-group-level executor concept. #302

merged 17 commits into from
Mar 11, 2021

Conversation

ralph-lange
Copy link
Contributor

Moved PR from ros2/demos to this repository as discussed in ros2/demos#485.

Copy link
Contributor

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

ralph-lange and others added 2 commits February 13, 2021 15:49
Co-authored-by: Karsten Knese <[email protected]>
Signed-off-by: Ralph Lange <[email protected]>
@ralph-lange
Copy link
Contributor Author

Hi @Karsten1987, I fixed the warnings caused by the line lengths in the CMakeLists.txt. Could you please re-trigger the job on ci.ros2.org?

@ralph-lange
Copy link
Contributor Author

Converted it to a draft until macOS support is implemented.

@ralph-lange
Copy link
Contributor Author

Hi @Karsten1987, I tried to add support for macOS - without having any practical C++ experience on this platform. Could you please test and my implementation?

ralph-lange and others added 4 commits February 18, 2021 10:03
Signed-off-by: Karsten Knese <[email protected]>
Signed-off-by: Karsten Knese <[email protected]>
@Karsten1987
Copy link
Contributor

Karsten1987 commented Feb 25, 2021

@ralph-lange the CPU affinity indeed required the threads to the suspended while being configured. The condition variable seemed to have work according to the following output:

 ➭ ros2 run examples_rclcpp_cbg_executor ping_pong
1614233204.026369 [71]   12615970: using network interface en0 (udp/10.0.0.222) selected arbitrarily from: en0, vnic0, vnic1, vboxnet0, en8
[INFO] [1614233204.055699564] [pong_node]: Running experiment from now on for 10 s ...
[INFO] [1614233214.057528441] [ping_node]: High prio path: Sent 988 pings, received 985 pongs.
[INFO] [1614233214.057547680] [ping_node]: High prio path: Average RTT is 27.9 ms.
[INFO] [1614233214.057557175] [ping_node]: Low prio path: Sent 988 pings, received 0 pongs.
[INFO] [1614233214.057563656] [pong_node]: High priority executor thread ran for 9987 ms.
[INFO] [1614233214.057569745] [pong_node]: Low priority executor thread ran for 0 ms.

I could do this without requiring root rights, so maybe that'll also reduce the need for it on Linux.

I further went ahead and refactored the nodes from being compile dependent on the compiler options (ADD_PING, ADD_PONG, ...) into three individual files. I hope you don't mind that I renamed the executables accordingly.

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@Karsten1987 Karsten1987 marked this pull request as ready for review February 25, 2021 06:14
Signed-off-by: Karsten Knese <[email protected]>
@ralph-lange
Copy link
Contributor Author

Great that you got the core pinning for macOS working. However, we have to use separate mutexes for each executor instance. Otherwise, with the current lock mechanism, only one of the two executor instances will eventually run. I'll fix this in the evening.

@ralph-lange
Copy link
Contributor Author

@Karsten1987, could you please re-trigger the job on ci.ros2.org?

@Karsten1987
Copy link
Contributor

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@Karsten1987
Copy link
Contributor

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me with green CI.

However, @clalancette if you could give it a pair of eyes as well. I've ended up contributing to the PR quite a bit.

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable enough to me. @Karsten1987 I'll let you merge.

@Karsten1987 Karsten1987 merged commit 73e3849 into ros2:master Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants