Skip to content

Throttle recording rate per topic #2211

@dw25628

Description

@dw25628

Description

This feature was previously proposed in #682, having the ability to throttle the rate of recording on a per topic basis. For example an image being published at a frame rate of 30hz but only wanting to log it at 1hz.

I would be interested in the communities feedback on this feature and my potential proposal for implementation. I would be happy to take an initial stab at implementing it.

Related Issues

Completion Criteria

  • Ability to enable throttle from cli
  • Check whether or not a msg should be logged within the callback based on the last write time
  • Update documentation

Implementation Notes / Suggestions

  • Implement a record option for enabling the topic throttle and specifying the rate
    Potential example call, no rate entry or a rate entry less than 0 would not throttle the message
    Rate would be hz
    ros2 bag record --topics_and_rates /tf /gps/fix 5 /image/rgb 0.5 /rosout -1

  • Store a vector or map of rates per topic within RecordOptions

  • Store the last write time for each topic

  • Add function within TopicFilter to compare the current receive time to the last write time for that topic. Return whether the message can be written

  • For each subscription callback check if the message should be written

Testing Notes / Suggestions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions