Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_clock() method #77

Open
wants to merge 3 commits into
base: humble
Choose a base branch
from
Open

Conversation

EGAlberts
Copy link

When using ROS2 logging it is desirable to throttle logged messages to keep output manageable ([https://docs.ros.org/en/humble/Tutorials/Demos/Logging-and-logger-configuration.html#logging-throttled]).

To do so, you need access to the node's clock. Since with new changes there is no more direct access to the node object within a subclass of bt_action_node and bt_service_node it is not possible to get the clock and therefore not possible to log with throttling.
This PR adds a get_clock() method to the parent classes which can be used to for throttled logging which I exemplify with an Feedback callback in the existing sleep action sample.

N.B. The samples are still broken in the latest commit. To use any sample (including my edit to exemplify the PR), you need to use BT.CPP with pull 804 BehaviorTree/BehaviorTree.CPP#804 because this actually exports the plugins to be used by the sample behavior trees. I would suggest that you please merge that PR before this one.

@facontidavide facontidavide self-assigned this Sep 6, 2024
@EGAlberts
Copy link
Author

Sorry for the delay, I have made the requested changes now

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.

2 participants