Feature request
Feature description
Current implementation of THROTTLE logger macros require rclcpp::Clock object to be a local (due to the way the lambda is defined in the macro body). This precludes the use of the node clock or a clock data member.
Implementation considerations
The lambda could be changed slightly to cache a reference to the clock in a local variable which would allow the THROTTLE macro to be called like this:
RCLCPP_INFO_THROTTLE(get_logger(), *get_clock(), ...)
instead of:
rclcpp::Clock clock;
RCLCPP_INFO_THROTTLE(get_logger(), clock, ...)
The exact change would be in the rclcpp/rclcpp/resource/logging.hpp.em file (see attached diff)
logging.hpp.em.diff.txt
Feature request
Feature description
Current implementation of THROTTLE logger macros require rclcpp::Clock object to be a local (due to the way the lambda is defined in the macro body). This precludes the use of the node clock or a clock data member.
Implementation considerations
The lambda could be changed slightly to cache a reference to the clock in a local variable which would allow the THROTTLE macro to be called like this:
RCLCPP_INFO_THROTTLE(get_logger(), *get_clock(), ...)
instead of:
rclcpp::Clock clock;
RCLCPP_INFO_THROTTLE(get_logger(), clock, ...)
The exact change would be in the rclcpp/rclcpp/resource/logging.hpp.em file (see attached diff)
logging.hpp.em.diff.txt