Skip to content

rclcpp "throttle" logging #797

@IanTheEngineer

Description

@IanTheEngineer

Feature request:

rclcpp logging client library support for throttle loggers.

I found a TODO in the source code, and figured it deserved to be called out in an issue for visibility:

# TODO(dhood): Implement the throttle macro using time sources available in rclcpp
excluded_features = ['named', 'throttle']
def is_supported_feature_combination(feature_combination):
    is_excluded = any([ef in feature_combination for ef in excluded_features])
    return not is_excluded
}@

This is also sort-of captured in a bullet point tucked away in a nearly-completed ticket in the ros2 repo: ros2/ros2#425

A description of the desired functionality can be found in the ROS1 wiki:

Throttle Logger

Throttle

    ROS_DEBUG_THROTTLE(period, ...)

    ROS_DEBUG_STREAM_THROTTLE(period, args)

    ROS_DEBUG_THROTTLE_NAMED(period, name, ...)

    ROS_DEBUG_STREAM_THROTTLE_NAMED(period, name, args) 

Throttled output will print a message at most once per "period".

Delayed throttle

    ROS_DEBUG_DELAYED_THROTTLE(period, ...)

    ROS_DEBUG_STREAM_DELAYED_THROTTLE(period, args)

    ROS_DEBUG_DELAYED_THROTTLE_NAMED(period, name, ...)

    ROS_DEBUG_STREAM_DELAYED_THROTTLE_NAMED(period, name, args) 

Delayed throttled output will print a message at most once per "period" and no message will be printed before one "period" has elapsed.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions