-
Notifications
You must be signed in to change notification settings - Fork 37
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
Example component node usage #60
Conversation
1ac1259
to
442471c
Compare
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.
A few things go clarify before merging. Next time would be great to get such PR split into multiple ones.
We now have:
- Fixing potential deadlocks in generated code
- Renaming executable name in the CMakeLists.txt
- Creating Component Node example.
example/include/generate_parameter_library_example/minimal_publisher.hpp
Outdated
Show resolved
Hide resolved
example/src/minimal_publisher.cpp
Outdated
admittance_controller::Params params_; | ||
}; | ||
|
||
int main(int numArgs, const char** args) { |
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 understand that for the Compoennts one doesn't need main
. Nevertheless, would it make sense to have both examples, Component Node and "normal" Node?
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.
When you create a component node it also creates an executable. You can see from the cmake and the readme of the example that there is still an executable and this file is now redundant.
d41dd06
to
4c0519b
Compare
4c0519b
to
e9105e6
Compare
@destogl These are now three separate PRs. Hopefully, that makes this easier to review. |
) | ||
rclcpp_components_register_node(minimal_publisher | ||
PLUGIN "admittance_controller::MinimalPublisher" | ||
EXECUTABLE test_node |
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.
@destogl when you create a component node, it now creates a stand-alone executable to use that node with this macro. This is what makes the main.cpp redundant as it is now generated for us.
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.
This looks fine to me. I am just not sure how to test it. I have tried using ros2 run
but I am missing the parameters file to add as argument.
The readme in the example directory has instructions for running it. |
Fixes #56
This also fixes some deadlock conditions that were possible and updates the example readme.