-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Feature request
Feature description
It would be nice if a child class of BtActionNode could have more control over whether a goal is sent. In the current implementation, the first time a BtActionNode is ticked in the behavior tree, it calls user defined on_tick() function, giving the user a chance to populate the goal, etc. Immediately after, the unlerlying tick() function calls the send_new_goal() function and the goal is sent. However, if for some reason the goal should not be sent (invalid blackboard parameters, the robot not in an appropriate state for executing the goal, etc.) there ought to be a way for the user to indicate that from the user defined function.
In short, there is no way to prevent a goal from being sent once a BtActionNode is ticked.
Implementation considerations
A simple solution could be to have on_tick() return a boolean (it is currently void). If the user returns true, the tick() function can proceed to send the goal. If the user returns false, the tick() function would not send the new goal, but would immediately return BT::NodeStatus::FAILURE