Skip to content

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

Merged
Karsten1987 merged 2 commits intoros2:masterfrom
fmrico:warning_inactive_publisher
Oct 28, 2018
Merged

issue a warning if publishing on a not active publisher#574
Karsten1987 merged 2 commits intoros2:masterfrom
fmrico:warning_inactive_publisher

Conversation

@fmrico
Copy link
Copy Markdown
Contributor

@fmrico fmrico 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

@tfoote tfoote added the in review Waiting for review (Kanban column) label Oct 27, 2018
@Karsten1987
Copy link
Copy Markdown
Contributor

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

@fmrico
Copy link
Copy Markdown
Contributor Author

fmrico 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
Copy link
Copy Markdown
Contributor

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 Waiting for review (Kanban column) label Oct 28, 2018
@fmrico
Copy link
Copy Markdown
Contributor Author

fmrico commented Oct 28, 2018

Thanks @Karsten1987 !!!

@Myzhar
Copy link
Copy Markdown

Myzhar 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

* 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants