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

Count publishers and subscribers #183

Merged
merged 6 commits into from
May 11, 2018
Merged

Conversation

Nickolaim
Copy link
Contributor

@Nickolaim Nickolaim commented Apr 7, 2018

This is a partial implementation of ros2/ros2cli#60. I marked it as a WIP since I expect some comments. Plan to merge changes later and do another PR.

Connects to ros2/ros2cli#60

@wjwwood
Copy link
Member

wjwwood commented Apr 9, 2018

Is this still a WIP? Let us know when this and related pr's are ready for review.

@wjwwood wjwwood closed this Apr 9, 2018
@wjwwood wjwwood reopened this Apr 9, 2018
@wjwwood
Copy link
Member

wjwwood commented Apr 9, 2018

Sorry for closing, misclick on my part.

@wjwwood wjwwood added the in progress Actively being worked on (Kanban column) label Apr 9, 2018
@Nickolaim Nickolaim changed the title WIP: count publishers and subscribers Count publishers and subscribers Apr 9, 2018
@dirk-thomas dirk-thomas added enhancement New feature or request in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Apr 30, 2018
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

Looks great! Just a couple nitpick comments

self.node.count_subscribers('42')
with self.assertRaisesRegex(ValueError, 'is invalid'):
self.node.count_publishers('42')

def test_node_logger(self):
node_logger = self.node.get_logger()
self.assertEqual(node_logger.name, 'my_ns.my_node')
Copy link
Contributor

Choose a reason for hiding this comment

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

Mind updating this line to use TEST_NODE and TEST_NAMESPACE too?

Copy link
Contributor

Choose a reason for hiding this comment

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

validate_topic_name(fq_topic_name)
return func(self.handle, fq_topic_name)

def count_publishers(self, topic_name):
Copy link
Contributor

Choose a reason for hiding this comment

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

Mind adding a doc string to this and count_subscribers? I realize most functions here don't have one, but adding them to new functions is an improvement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sloretz
Copy link
Contributor

sloretz commented May 9, 2018

CI

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

@sloretz
Copy link
Contributor

sloretz commented May 10, 2018

@Nickolaim Would you mind rebasing your branch with master? CI looks ok except for test failures caused by not having #182.

@Nickolaim
Copy link
Contributor Author

Sure, will do later today. I am relatively new to github; for the request I plan to add remote upstream that points to ros2/rclpy and merge the changes from it. Does it sound good?

@Karsten1987
Copy link
Contributor

I assume here your remote is called upstream, points to ros2/rclpy and your current branch is pubsub_count3. Then the way to rebase is as follows.

# making sure you update all remotes
git fetch --all 
# rebase your changes on top of current master
git rebase upstream/master

@sloretz
Copy link
Contributor

sloretz commented May 10, 2018

@Nickolaim adding on to @Karsten1987's comment, assuming your fork is called origin make sure to

git checkout pubsub_count3
git pull origin pubsub_count3

then after rebasing

git push --force-with-lease origin pubsub_count3

@Nickolaim
Copy link
Contributor Author

I rebased this PR with the master.

@sloretz
Copy link
Contributor

sloretz commented May 11, 2018

CI

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

@Nickolaim
Copy link
Contributor Author

Looks like all the builds have passed.

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

Thanks @Nickolaim !

@sloretz sloretz merged commit 32678d0 into ros2:master May 11, 2018
@sloretz sloretz removed the in review Waiting for review (Kanban column) label May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants