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

issue a warning if publishing on a not active publisher #574

Merged
merged 2 commits into from Oct 28, 2018

Conversation

Projects
None yet
4 participants
@fmrico
Copy link
Contributor

commented Oct 27, 2018

Hi all,

Issue #552 seems to be blocked. @Myzhar did not a PR with his work. This is a PR with his changes.

This PR provides the machanism to issue a WARN when publishing on a not active publisher.

Best

@Karsten1987

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

@fmrico thanks for patch. I believe the same comment for PR #552 applies here:
#562 (comment)

@fmrico

This comment has been minimized.

Copy link
Contributor Author

commented Oct 27, 2018

Hi @Karsten1987 ,

I fixed it following the comments in #562 . Is was not so simple, because I had to change logging macros, to make it compile. Macro has changed to:

::std::is_same<typename std::remove_reference<decltype(logger)>::type, \
    typename ::rclcpp::Logger>::value, \
    "First argument to logging macros must be an rclcpp::Logger")

adding typename, because std::remove_reference<Ty>::type is dependant on a template parameter, as I found here.

I run the tests and everything worked ok.

Best

@Karsten1987

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

Great to hear you made it work. The patch looks good to me so far.
I've triggered the buildfarrm to see if this patch introduces any regression on other tests:

CI:
Build Status
Build Status
Build Status
Build Status

@Karsten1987 Karsten1987 merged commit e30f315 into ros2:master Oct 28, 2018

@Karsten1987 Karsten1987 removed the in review label Oct 28, 2018

@fmrico

This comment has been minimized.

Copy link
Contributor Author

commented Oct 28, 2018

Thanks @Karsten1987 !!!

@Myzhar

This comment has been minimized.

Copy link

commented Oct 28, 2018

Great @fmrico 💪

cho3 pushed a commit to cho3/rclcpp that referenced this pull request Jun 3, 2019

issue a warning if publishing on a not active publisher (ros2#574)
* issue a warning if publishing on a not active publisher

* Adding a logger private member in LifecyclePublisher for avoiding creating a new one echa call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.