-
Notifications
You must be signed in to change notification settings - Fork 312
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
add examples_ prefix to package names to avoid future collisions #137
Conversation
should the generated targets be prefixed as well ? |
That's a good question. Probably. It will make typing them a bit longer, but I suppose |
also, what do you think of renaming |
yeah I agree, we use publisher/subscriber and requester/replier in a lot of places maybe it would make sense to update the vocabulary everywhere. |
OK I'll change the package and executable names. Brace for impact. |
OK it looks somewhat decent now. The build products are all prefixed by |
{ | ||
subscription_ = this->create_subscription<std_msgs::msg::String>("chatter", | ||
subscription_ = this->create_subscription<std_msgs::msg::String>("topic", |
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.
nicktip: I think we encourage to wrap after the parenthesis
same below
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.
Changes look good to me.
Is it on purpose that you create struct
s that inherit from rclcpp::Node
rather than class
es ?
I did |
install(TARGETS ${PROJECT_NAME}_lambda | ||
${PROJECT_NAME}_member_function | ||
${PROJECT_NAME}_not_composable | ||
DESTINATION bin) |
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.
Please avoid aligned indentation.
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.
OK. For posterity, I'll add some text to the style guide which makes this more clear.
find_package(std_msgs REQUIRED) | ||
if (NOT WIN32) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra") | ||
endif() |
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 would suggest moving the C++ flags above the find_package
(as it is done in all other packages) since the CMake config files could already try to use them.
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.
Thanks. I don't think it's done in all other packages though; I started this CMakeLists.txt
file by copying from somewhere else. But I can't figure out now where I copied it from. Anyway I'll keep looking for other instances as well.
{ | ||
publisher_ = this->create_publisher<std_msgs::msg::String>("chatter"); | ||
publisher_ = this->create_publisher<std_msgs::msg::String>("topic"); |
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.
Why change the topic name? This will make the code incompatible with the ROS 1 equivalents.
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.
That is true, but the ROS 1 equivalent has moved to http://github.com/ros2/tutorials where it will (eventually) have lots of inline comments and narrative documentation like in the ROS 1 code. The idea for this repository is to have lots of short copy-paste friendly examples that are as unambiguous as possible. Hence the name change from talker
to minimal_publisher
, etc.
Since the packages (intentionally) don't contain any automatic linting did you run all linters on the example code? |
I'm trying to figure out how to run the linters manually. When I figure that out, I'll document it in the style guide or somewhere else. |
For each linter you will find the way to invoke it in its documentation (e.g. https://github.com/ament/ament_lint/blob/master/ament_pep8/doc/index.rst). |
OK everything is now using |
Are additional rclcpp examples planned for a future PR? The ones in this PR look fine to me. |
Yeah, I'm working on cleaning up some services examples which I'll put in a different PR. |
Maybe we should also have examples how we recommend users to write their nodes in the future, inheriting from node and creating a library. |
Yes that's a great idea. I'll make an issue for that on this repo. |
Please squash your commits before / during the merge. |
whoops. Is it too late now?
…On Tue, Nov 29, 2016 at 5:41 PM, Dirk Thomas ***@***.***> wrote:
Please squash your commits before / during the merge.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#137 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFBR2i76aoX23jrLwoAdZcYhkZT7AIS6ks5rDNQ2gaJpZM4K6CYd>
.
|
Technically no, but we shouldn't make a habit of force pushing to master. I'd say just leave it and try to remember in the future 😄. |
ok thanks. Will do.
…On Tue, Nov 29, 2016 at 5:44 PM, William Woodall ***@***.***> wrote:
Technically no, but we shouldn't make a habit of force pushing to master.
I'd say just leave it and try to remember in the future 😄.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#137 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFBR2lQ64oFEivcSnxwwmz78c-GiS3bOks5rDNT7gaJpZM4K6CYd>
.
|
Some of the package names we're coming up with in the
examples
repo are pretty generic. Prefixing them withexamples_
will reduce the likelihood of colliding with other package names.