Skip to content

Enable a BtActionNode child class to stop a goal from being sent if it is invalid #3150

@mitchradams

Description

@mitchradams

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions