Skip to content

Implemented Multithreaded Executor example#251

Merged
clalancette merged 21 commits intoros2:masterfrom
jhdcs:master
Oct 8, 2019
Merged

Implemented Multithreaded Executor example#251
clalancette merged 21 commits intoros2:masterfrom
jhdcs:master

Conversation

@jhdcs
Copy link
Copy Markdown
Contributor

@jhdcs jhdcs commented Aug 29, 2019

Release Version of Multithreaded Executor example
Pertains to issue #208
Signed-off-by: Jacob Hassold jhassold@dcscorp.com
Distro A; OPSEC #2893

Release Version of Multithreaded Executor example

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@jhdcs jhdcs changed the title Distro A; OPSEC #2893 Implemented Multithreaded Executor example Aug 29, 2019
// You MUST use the MultiThreadedExecutor to use, well, multiple threads
rclcpp::executors::MultiThreadedExecutor executor;
auto pubnode = std::make_shared<PublisherNode>();
auto subnode = std::make_shared<DualThreadedNode>(); // This contains BOTH subscriber nodes. They will still run on different threads
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe clarify which parts of the node are being run on multiple threads?

I also think that "subscriber nodes" should be rephrased to "subscription callbacks" (since it's still just one node).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have taken your suggestion and renamed "subscriber nodes" to "subscription callbacks". Definitely makes more sense.

I was hoping that the constructor would make the two threads clear enough. Should I add a few more comments around subscription1_ and subscription2_ to make it completely unambiguous?

Copy link
Copy Markdown
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.

Thanks so much for implementing this; it's a long-standing missing example.

I have a few different things to fix inline, but they are mostly easy. Once those are in, we can run CI and then get this merged.

Jacob Hassold added 2 commits October 1, 2019 10:47
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A; OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Copy link
Copy Markdown
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.

Looking pretty good. A few more comments, then we can give this a run in CI.

Jacob Hassold added 2 commits October 2, 2019 07:50
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@jhdcs
Copy link
Copy Markdown
Contributor Author

jhdcs commented Oct 2, 2019

Hopefully the latest version should take care of the remaining issues. Unless you see something else that can be improved?

Copy link
Copy Markdown
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.

Still a few more minor things.

Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Copy link
Copy Markdown
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.

A couple more small things, then I'll run CI.

Jacob Hassold added 2 commits October 2, 2019 10:37
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Copy link
Copy Markdown
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.

Looking good to me. I'll fire up CI on this now.

Jacob Hassold added 8 commits October 3, 2019 12:41
Release Version of Multithreaded Executor example

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A; OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Jacob Hassold and others added 2 commits October 3, 2019 12:41
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Copy Markdown
Contributor

FYI: I renamed this to multithreaded_executor, and I rebased the whole thing on master.

@clalancette
Copy link
Copy Markdown
Contributor

CI:

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

Jacob Hassold added 2 commits October 3, 2019 13:54
Distro A, OPSEC #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Distro A, Opsec #2893

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Copy link
Copy Markdown
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.

Code looks good, CI looks good, I'm happy with this. @allenh1 I'm planning on merging this later today unless you have any objections.

@clalancette clalancette merged commit e483811 into ros2:master Oct 8, 2019
@allenh1
Copy link
Copy Markdown

allenh1 commented Oct 8, 2019

@clalancette Looks fine to me.

@jhdcs thanks for iterating!

@jhdcs
Copy link
Copy Markdown
Contributor Author

jhdcs commented Oct 8, 2019

@allenh1, @clalancette, You are quite welcome. Happy to help.

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