-
Notifications
You must be signed in to change notification settings - Fork 412
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
Make Component Manager public #1065
Conversation
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
There was a problem hiding this 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
).
set(resource_index ${ARGS_RESOURCE_INDEX}) | ||
message(STATUS "Setting component resource index to non-default value ${resource_index}") | ||
endif() | ||
|
||
set(component ${ARGS_PLUGIN}) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
#message(WARNING "registered index: ${resource_index}") | ||
#message(WARNING "content for index: ${_RCLCPP_COMPONENTS_${resource_index}__NODES}") |
There was a problem hiding this comment.
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 ;-)
There was a problem hiding this comment.
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.
@@ -57,31 +62,34 @@ class ComponentManager : public rclcpp::Node | |||
using ComponentResource = std::pair<std::string, std::string>; | |||
|
|||
ComponentManager( | |||
std::weak_ptr<rclcpp::executor::Executor> executor); | |||
std::weak_ptr<rclcpp::executor::Executor> executor, | |||
std::string node_name = "ComponentManager"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
It won't let me comment since it's not a changed line, but does it make sense for the In the case that it is changed to |
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
There was a problem hiding this 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.
set(resource_index ${ARGS_RESOURCE_INDEX}) | ||
message(STATUS "Setting component resource index to non-default value ${resource_index}") | ||
endif() | ||
|
||
set(component ${ARGS_PLUGIN}) |
There was a problem hiding this comment.
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.
#message(WARNING "registered index: ${resource_index}") | ||
#message(WARNING "content for index: ${_RCLCPP_COMPONENTS_${resource_index}__NODES}") |
There was a problem hiding this comment.
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>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
There was a problem hiding this 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.
I've traced four new failed tests in last night's builds to this PR. ros2/build_farmer#272 |
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.:
The controller manager can then look into this exact index to only fetch controllers and no other components.