Skip to content

Set BT action nodes' error_code_id in case request timeout in BtActionNode #4946

@DylanDeCoeyer-Quimesis

Description

@DylanDeCoeyer-Quimesis

Feature request

Feature description

Currently, an action request timeout occurring in the BtActionNode parent class triggers the failure of the node without setting any code ID in the error_code_id output port. I think that an error code should be propagated.

Implementation considerations

I see at least two options:

  • make BtActionNode aware of the error_code_id output port, and set a generic error code ID directly from BtActionNode,
  • catch the failure at the child node level, and set the error_code_id directly from the child node. Typically, with CustomNode inheriting from BtActionNode:
BT::NodeStatus CustomNode::tick()
{
    BT::NodeStatus status = BtActionNode::tick();

    if (status == BT::NodeStatus::FAILURE)
    {
        setOutput("error_code_id", ERROR_CODE_REQUEST_TIMEOUT);
    }

    return status;
}

This latter implementation assumes that any failure triggered by BtActionNode's tick() function is due to a request timeout.

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