Skip to content

Make Component Manager public#1065

Merged
Karsten1987 merged 9 commits intomasterfrom
public_component_manager
Apr 16, 2020
Merged

Make Component Manager public#1065
Karsten1987 merged 9 commits intomasterfrom
public_component_manager

Conversation

@Karsten1987
Copy link
Copy Markdown
Contributor

@Karsten1987 Karsten1987 commented Apr 14, 2020

closes #1010

The first commit d81d494 basically just turns the component manager into public API.

The second commit 156ff16 is enhancing the CMake macros for registering nodes with a new option RESOURCE_INDEX to specify under which index the file should be written.

With respect to the upcoming work in ros-control (ros-controls/roadmap#7) that enables to not duplicate the CMake macros to adopt to ros-controls, but simply call the existing rclcpp_components macros with a proper resource index, e.g.:

rclcpp_components_register_node(timers_library
  PLUGIN "demo_nodes_cpp::OneOffTimerNode"
  EXECUTABLE one_off_timer
  RESOURCE_INDEX "some_proper_index")

The controller manager can then look into this exact index to only fetch controllers and no other components.

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987 Karsten1987 marked this pull request as ready for review April 15, 2020 01:36
@Karsten1987 Karsten1987 requested a review from mjcarroll April 15, 2020 01:36
Copy link
Copy Markdown
Contributor Author

@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.

As I follow up, I would like to modify the ros2component API similarly to take an optional resource index parameter. That way, a ros-control cli could reuse the same API for things like (component types).

message(STATUS "Setting component resource index to non-default value ${resource_index}")
endif()

set(component ${ARGS_PLUGIN})
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 didn't want to pollute the changes any further, but I think the two args (PLUGIN and EXECUTABLE) could be checked for empty strings.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel free to add it, or we can address it in a follow-up Issue/PR.

Comment on lines +18 to +19
#message(WARNING "registered index: ${resource_index}")
#message(WARNING "content for index: ${_RCLCPP_COMPONENTS_${resource_index}__NODES}")
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'll remove these lines before merging. I let them in for now in case the interested reviewers wants to debug ;-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reminder to remove before merging.

ComponentManager(
std::weak_ptr<rclcpp::executor::Executor> executor);
std::weak_ptr<rclcpp::executor::Executor> executor,
std::string node_name = "ComponentManager");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it not make sense to have also a constructor that forwards the namespace and node options arguments?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree that would probably make sense in this case to make it general purpose.

@mjcarroll
Copy link
Copy Markdown
Member

It won't let me comment since it's not a changed line, but does it make sense for the component_manager to remain STATIC here: https://github.com/ros2/rclcpp/pull/1065/files#diff-a31ef69821be6f5f4a19e0bf26f36fa1R24

In the case that it is changed to SHARED, I believe that you would also have to add the visibility macros.

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Copy Markdown
Contributor Author

First round of CI (build up to demo_nodes_cpp, testing rclcpp_components & demo_nodes_cpp):

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

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
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.

LGTM pending removing commented lines.

message(STATUS "Setting component resource index to non-default value ${resource_index}")
endif()

set(component ${ARGS_PLUGIN})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel free to add it, or we can address it in a follow-up Issue/PR.

Comment on lines +18 to +19
#message(WARNING "registered index: ${resource_index}")
#message(WARNING "content for index: ${_RCLCPP_COMPONENTS_${resource_index}__NODES}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reminder to remove before merging.

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Copy Markdown
Contributor Author

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

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Copy Markdown
Contributor Author

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

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Copy Markdown
Contributor Author

CI rebuilding up to tf2_ros as it's using the second macro which hasn't been CI'ed before:

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

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.

Looks good. This assumes that the list of targets is always the last set of arguments. It could be switched to a multiValueArg at some point in the future, but I agree with not breaking the CMake "api" right now.

@Karsten1987 Karsten1987 merged commit 50d500e into master Apr 16, 2020
@delete-merged-branch delete-merged-branch bot deleted the public_component_manager branch April 16, 2020 02:08
@nuclearsandwich
Copy link
Copy Markdown
Member

I've traced four new failed tests in last night's builds to this PR. ros2/build_farmer#272

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.

[rclcpp_components] Make component manager public

4 participants