Skip to content

Add rclcpp action examples with member functions#230

Merged
jacobperron merged 2 commits intomasterfrom
composable_action_examples
Apr 26, 2019
Merged

Add rclcpp action examples with member functions#230
jacobperron merged 2 commits intomasterfrom
composable_action_examples

Conversation

@jacobperron
Copy link
Copy Markdown
Member

@jacobperron jacobperron commented Mar 12, 2019

  • Linux Build Status
  • Linux-aarch64 Build Status (unrelated failure)
  • macOS Build Status
  • Windows Build Status

Connects to ros2/rclcpp#635

@jacobperron jacobperron added the in progress Actively being worked on (Kanban column) label Mar 12, 2019
@jacobperron jacobperron self-assigned this Mar 12, 2019
@jacobperron jacobperron added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Mar 12, 2019
@jacobperron jacobperron added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Apr 12, 2019
@jacobperron jacobperron force-pushed the composable_action_examples branch from 0abbe73 to 82c7acb Compare April 18, 2019 06:53
Copy link
Copy Markdown
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.

I do believe the code as-is can't really be used in the new composition model. The constructor doesn't have the required form and the init function can't be called from the component manager.

@jacobperron
Copy link
Copy Markdown
Member Author

@Karsten1987 I've updated the examples to be more in line with the new composition model. Please take another look (thanks!).

Copy link
Copy Markdown
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

I've included some additional comments on how to bring this compatibility with the new composition interface. Additionally, anything that you want to use as a component needs to be in a shared library, so you would have to have a separate main function.

I'll leave it up to you if you actually want to implement this here, or it would better live as a demo in ros2/demos/composition

@jacobperron
Copy link
Copy Markdown
Member Author

jacobperron commented Apr 20, 2019

@mjcarroll Thanks for the review!

In the spirit of keeping the examples in this package minimal, I'd prefer not to make these actual components and bring in a dependency to rclcpp_component. They are really examples of action clients/servers that use member functions, though I've tried to set them up so they could easily be ported to be components. I think it would be better to add a components version to demos or even examples/rclcpp/minimal_composition.

@jacobperron jacobperron added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Apr 20, 2019
@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Apr 20, 2019

I'll just add that, our long term goal has been to use composition everywhere, and make things that have their own main as the "exceptional cases". However, I can see an argument for not doing this just here, but instead leaving this pr as-is and then updating all the examples at once.

This is probably a topic we should discuss at some point before the release...

@Karsten1987
Copy link
Copy Markdown
Contributor

@jacobperron This is still not fully composable. Each node has to be its own library and the node has to be registered with the class loader macro

#include "rclcpp_components/register_node_macro.hpp"
RCLCPP_COMPONENTS_REGISTER_NODE(MinimalActionClient)

as well as added to the ament index within the cmake context:

rclcpp_components_register_nodes(action_client_member_functions "MinimalActionClient")

Also, in order to support manual composition - besides the command line tool via ros2 component - I think it makes sense to separate the node library in a .hpp and .cpp.

@jacobperron jacobperron added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Apr 24, 2019
@jacobperron
Copy link
Copy Markdown
Member Author

Based on our offline discussion, I'll leave these examples as not fully composable and create a follow-up PR to add composable examples to the demos repo.

I still need to update this PR based on the changes in ros2/rclcpp#701.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron force-pushed the composable_action_examples branch from 70b91ec to 9999fc0 Compare April 24, 2019 01:42
@jacobperron jacobperron added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Apr 24, 2019
@jacobperron jacobperron changed the title Add composable rclcpp action examples Add rclcpp action examples with member functions Apr 24, 2019
@jacobperron
Copy link
Copy Markdown
Member Author

Ready for another round of review.

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

@jacobperron jacobperron merged commit 0c93fb0 into master Apr 26, 2019
@jacobperron jacobperron deleted the composable_action_examples branch April 26, 2019 16:21
@jacobperron jacobperron removed the in review Waiting for review (Kanban column) label Apr 26, 2019
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.

5 participants