Skip to content
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

Change rmw_count_publishers API, to rcl equivalent rcl_count_publishe… #425

Merged
merged 4 commits into from
Dec 20, 2017

Conversation

sriramster
Copy link
Contributor

Change rmw_count_publishers API to rcl equivalent rcl_count_publishers and remove the TODO comment from the source.

Signed-off-by: Sriram Raghunathan rsriram7@visteon.com

…rs and remove the TODO line.

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
@nuclearsandwich nuclearsandwich added the in review Waiting for review (Kanban column) label Dec 14, 2017
Copy link
Member

@dhood dhood left a comment

Choose a reason for hiding this comment

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

thanks for the patch, don't think it won't work as-is though. Could you also update count_subscribers for symmetry please

@@ -174,8 +174,7 @@ NodeGraph::count_publishers(const std::string & topic_name) const
false); // false = not a service

size_t count;
// TODO(wjwwood): use the rcl equivalent methods
auto ret = rmw_count_publishers(rmw_node_handle, fqdn.c_str(), &count);
auto ret = rcl_count_publishers(rmw_node_handle, fqdn.c_str(), &count);
Copy link
Member

Choose a reason for hiding this comment

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

rcl_count_publishers takes an rcl node handle instead of an rmw one

@dhood dhood added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Dec 15, 2017
…ure to topic_names.

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
@sriramster
Copy link
Contributor Author

Hi @dhood made changes after reading a few things inside rcl. Sorry for the initial patch which was incomplete. Could you review the changes?

@@ -166,16 +166,9 @@ NodeGraph::get_node_names() const
size_t
NodeGraph::count_publishers(const std::string & topic_name) const
{
auto rmw_node_handle = rcl_node_get_rmw_handle(node_base_->get_rcl_node_handle());
auto fqdn = rclcpp::expand_topic_or_service_name(
Copy link
Member

Choose a reason for hiding this comment

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

This step will combine the topic name and namespace into a "fully qualified" topic name (example) and should not be removed

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
@sriramster
Copy link
Contributor Author

@dhood made changes to use rcl_* specific API's have a look.

@@ -167,8 +167,17 @@ size_t
NodeGraph::count_publishers(const std::string & topic_name) const
{
auto rcl_node_handle = node_base_->get_rcl_node_handle();
auto name = rcl_node_get_name(rcl_node_handle);
auto namespace_ = rcl_node_get_namespace(rcl_node_handle);
Copy link
Contributor

Choose a reason for hiding this comment

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

please use trailing underscores only for member variables. same below.

Copy link
Contributor Author

@sriramster sriramster Dec 19, 2017

Choose a reason for hiding this comment

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

@Karsten1987 I have'nt read variables with '_' prefix, is that a valid declaration within "ros2" coding styles? May I use it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

We normally adhere to the C++ coding guidelines: https://google.github.io/styleguide/cppguide.html#Variable_Names

Now, I think you can actually use it here, because namespace is a reserved keyword in C++. I've seen we used it in other places as well, so that I believe in this special case, it's fine.
Please ignore my comment then.

@sriramster
Copy link
Contributor Author

@dhood could you review the latest commits?

@dhood dhood added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) requires-changes labels Dec 20, 2017
Copy link
Member

@dhood dhood left a comment

Choose a reason for hiding this comment

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

changes look good now

@dhood
Copy link
Member

dhood commented Dec 20, 2017

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

and linters are happy after my fixup: Build Status

@dhood dhood merged commit 2bf6888 into ros2:master Dec 20, 2017
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
…ging_log4cxx (ros2#425)

Signed-off-by: burekn <burekn@amazon.com>
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
ros2#436)

* Revert "Changes the default 3rd party logger from rcl_logging_noop to rcl_logging_log4cxx (ros2#425)"

This reverts commit ac8ee90.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

* Revert "add explicit dependency on rcl_logging_log4cxx (ros2#435)"

This reverts commit 816ce67.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

* Add dependency on rcl_logging_noop.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants