Skip to content

[rclcpp_lifecycle] issue a warning if publishing on a not active publisher #552

Closed

Description

@Myzhar

Feature request

Feature description

Since a publisher can be active or not is should be useful for debug purpose to issue a WARN when publishing on a not active publisher

Implementation considerations

Add a RCLCPP_WARN at Line 78:

Activity

  1. changed the title [-]rclcpp_lifecycle: issue a warning if publishing on a not active publisher[/-] [+][rclcpp_lifecycle] issue a warning if publishing on a not active publisher[/+] on Sep 6, 2018
  2. Karsten1987 commented on Sep 6, 2018

    @Karsten1987
    Contributor

    I believe the warning makes sense. Would you consider opening a PR for this?

  3. added
    enhancement
    on Sep 6, 2018
  4. added
    good first issue
    on Sep 20, 2018
  5. Myzhar commented on Sep 27, 2018

    @Myzhar
    Author

    I'm adding the warning message, but I cannot understand how to do it.
    Normally I use RCLCPP_WARN, but I'm not inside a node, so it cannot be called, right?

  6. Karsten1987 commented on Sep 27, 2018

    @Karsten1987
    Contributor

    You can use the rcutils/logging_macros.h to get non-node specific logging macros.
    There are some examples in the test: https://github.com/ros2/rcutils/blob/master/test/test_logging_macros.cpp

    It gives you macros such as RCUTILS_LOG_DEBUG_NAMED ... I am not sure whether you can use the RCLCPP macros without a node logger. @dhood can you help out here?

  7. mikaelarguedas commented on Sep 27, 2018

    @mikaelarguedas
    Member

    To use rclcpp logging macros you do need a rclcpp::Logger, the demos repository contains some examples of passing a node logger to a function as well as creating a logger with rclcpp::get_logger and using it for logging.

  8. added
    in review
    on Sep 28, 2018
  9. Karsten1987 commented on Oct 23, 2018

    @Karsten1987
    Contributor

    @Myzhar any updates on this?

  10. Myzhar commented on Oct 24, 2018

    @Myzhar
    Author

    @Karsten1987 I'm sorry, but I'm not working on ROS2 now, I had to move to ROS1.
    I try to find a bit of time to complete this enhancement

  11. fmrico commented on Oct 27, 2018

    @fmrico
    Contributor

    I did a PR with the solution, which matches the one proposed by @Myzhar

    in #574

    Hope it helps

  12. Karsten1987 commented on Oct 28, 2018

    @Karsten1987
    Contributor

    fixed in e30f315

  13. removed
    in review
    on Oct 28, 2018
  14. added a commit that references this issue on Jul 9, 2022
    ca64525
  15. added a commit that references this issue on Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions