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

[WIP] Add functions to return formatted Node Name-Namespace strings #669

Closed
wants to merge 16 commits into from

Conversation

jhdcs
Copy link
Contributor

@jhdcs jhdcs commented Mar 26, 2019

Implements functions to add formatted node name and namespace strings. Still needs unit tests. Design tips and suggestions for useful tests is greatly appreciated!

Signed-off-by: Jacob Hassold jhassold@dcscorp.com

Connects to #643

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@tfoote tfoote added the in review Waiting for review (Kanban column) label Mar 26, 2019
Copy link
Member

@wjwwood wjwwood 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 opening the pull request. As I said in this description:

#643 (comment)

I think changing get_node_names() to return the fully formatted node name + namespace (a.k.a. the fully qualified node name), along with a way to get them separate (like get_node_names_and_namespaces()), is all we want to do.

rclcpp/include/rclcpp/node.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/node.hpp Outdated Show resolved Hide resolved
…pace method

Signed-off-by: Oswin So <oswinso@gmail.com>
Jacob Hassold added 3 commits April 1, 2019 10:34
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 1, 2019

@wjwwood I believe we've addressed the issues that you raised. Any further things that jump out at you?

Also, CLion is warning me of a bunch of Clang violations as I'm going through the code. Should these be cleaned up? Should we make an issue for them? Or should I ignore them?

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

Make sure you run the tests that our buildfarm would run to help us catch issues early, as CI turn around is pretty long, see: https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/#run-tests

rclcpp/src/rclcpp/node_interfaces/node_graph.cpp Outdated Show resolved Hide resolved
rclcpp/src/rclcpp/node_interfaces/node_graph.cpp Outdated Show resolved Hide resolved
rclcpp/test/test_node.cpp Outdated Show resolved Hide resolved
@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 2, 2019

Make sure you run the tests that our buildfarm would run to help us catch issues early, as CI turn around is pretty long, see: https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/#run-tests

I've been using "colcon test --packages-select rclcpp" from the root of my development workspace. Is this not correct? I do get several errors about style formatting left around the entire rclcpp package, which was part of the reason I was wondering if you wanted me to go and give the code a good scrubbing.

EDIT I think I found what you were hinting at. I'm now adjusting my IDE to conform to ROS 2 specifications for code style.

Jacob Hassold and others added 6 commits April 2, 2019 07:54
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@wjwwood
Copy link
Member

wjwwood commented Apr 2, 2019

I do get several errors about style formatting left around the entire rclcpp package, which was part of the reason I was wondering if you wanted me to go and give the code a good scrubbing.

That's odd, on master it should produce no errors or failures, so any failures should be due to your diff or maybe some misconfiguration on your system (wrong or missing test dependencies?).

We'll see what CI says:

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

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 2, 2019

I should clarify - the IDE I'm using (CLion) is giving Clang style warnings. They're more like guidelines that something looks odd, rather than an actual error.

Apologies for the confusion, I misspoke.

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 5, 2019

Probably a silly question (I'm new to this), but is there anything I should be doing? The CI is saying that the change was on "Force Reinstallation of Numpy", am I reading it incorrectly?

@dirk-thomas
Copy link
Member

The CI is saying that the change was on "Force Reinstallation of Numpy", am I reading it incorrectly?

That is the latest commit in the ros2/ci repo which provides the logic for the CI jobs.

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 5, 2019

So that change pertains to the CI system, rather than my code. Got it.

So the instability is being caused by something I wrote? I guess I'd better start diving again...

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@wjwwood
Copy link
Member

wjwwood commented Apr 5, 2019

@jhdcs let me know when you want me to rerun CI, the lastest round has test failures that look related to these changes (based on a cursory look only).

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 8, 2019

Yeah. I'm thinking that something might have been expecting the old format. Possibly. I'll let you know once I figure it out on my end.

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 9, 2019

Okay, I think I know what's going on.

NodeGraph::get_node_names() is used throughout the API, and the tests seem to expect an unqualified name (i.e: name, but no namespace). I can either update all the tests to accept the new version of get_node_names, or revert get_node_names to its original functionality, and create a new function called NodeGraph::get_qualified_node_names() that implements our desired functionality.

I'm personally partial to the second option, both because it's easier, and because I'm not sure how much of the existing codebase is going to break if we suddenly swap the expected output of an already-in-use function.

@wjwwood, what do you think?

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 11, 2019

@wjwwood Would you be able to re-run CI? I think I might have gotten some things fixed, though I did find something interesting: Apparently if you use std::transform in the original get_node_names() function, you get a timeout error in some of the tests (specifically, gtest_multithreaded_rmw_fastrtps/opensplice, and at least on my system). As such, I've reverted it to the for-based implementation until I can figure out what on earth is going on...

@wjwwood
Copy link
Member

wjwwood commented Apr 11, 2019

@jhdcs please revert you most recent commit, the idea is to change the behavior of get_node_names(), because it was classified as a bug that it did not include the namespace from the beginning, and update any tests we have that need to be. The node name needs to always be associated with the namespace, otherwise you may have duplicate node names and no way to disambiguate them.

Please (re)read my suggested solution in the original issue: #643 (comment)

It is to update the behavior of the existing function (and fix anything that breaks due to that) and optionally add a function that returns a list of namespace and names as pairs.

…_names"

This reverts commit ed4b166.

Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
@wjwwood
Copy link
Member

wjwwood commented Apr 13, 2019

@jhdcs looks like something got messed up when you force pushed, and now you have changes from master on this branch...

@wjwwood wjwwood added in progress Actively being worked on (Kanban column) and removed in review Waiting for review (Kanban column) labels Apr 13, 2019
@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 15, 2019

GAH!

It's just one of those weeks, isn't it?

@jhdcs jhdcs closed this Apr 15, 2019
@jhdcs jhdcs deleted the issue_643 branch April 15, 2019 11:34
@tfoote tfoote removed the in progress Actively being worked on (Kanban column) label Apr 15, 2019
@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 15, 2019

Hopefully that fixes it. Sorry for all the trouble, and I really appreciate your guys' patience...

I had to re-create the branch, it seems. I'll get the code actually working, then open a new pull request.

@wjwwood
Copy link
Member

wjwwood commented Apr 16, 2019

Actually now the pull request is closed and I cannot reopen it... This usually happens if you delete the upstream branch or fork, but I'm not sure what's happening right now...

@jhdcs
Copy link
Contributor Author

jhdcs commented Apr 16, 2019

That's basically what happened. Part of the fork was deleted accidentally due to my uncanny ability to mega-derp. No data was lost, but GitHub is really confused.

I was going to open a new pull request that references both this one and the main issue later on, once I feel like I've worked a few more of the kinks out. Unless you want me to open it now, of course.

@wjwwood
Copy link
Member

wjwwood commented Apr 16, 2019

I was going to open a new pull request that references both this one and the main issue later on, once I feel like I've worked a few more of the kinks out. Unless you want me to open it now, of course.

Oh that's up to you. Feel free to open a new pr when ever you're ready. I just wanted to make sure you knew I could not reopen this one.

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.

None yet

5 participants