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

Allow resetting BTRunLimit internal run count #248

Open
limbonaut opened this issue Nov 13, 2024 · 0 comments
Open

Allow resetting BTRunLimit internal run count #248

limbonaut opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@limbonaut
Copy link
Owner

limbonaut commented Nov 13, 2024

Problem statement

In some cases, it is desirable to reset BTRunLimit on certain events, like re-entering the BTState.

Proposed solution

A possible solution is to keep a run count on the Blackboard. This way, it can be changed from different places without requiring a reference to BTRunLimit. BTCooldown uses a similar approach.

Another solution could be adding a policy option to reset the run limit upon behavior tree entered. This would require adding _tree_started or _tree_entered callback to behavior tree tasks that would run for each task just like _setup does (performance concerns for larger trees). Defining "behavior tree entered/started" needs some consideration, as it is ambiguous.

Alternatives

Run count is currently remembered for the lifetime of the BT. The alternative is to write a custom task.

@limbonaut limbonaut added the enhancement New feature or request label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant