Skip to content

Report bt action request error#6289

Open
DylanDeCoeyer-Quimesis wants to merge 3 commits into
ros-navigation:mainfrom
DylanDeCoeyer-Quimesis:report_bt_action_request_error
Open

Report bt action request error#6289
DylanDeCoeyer-Quimesis wants to merge 3 commits into
ros-navigation:mainfrom
DylanDeCoeyer-Quimesis:report_bt_action_request_error

Conversation

@DylanDeCoeyer-Quimesis

Copy link
Copy Markdown
Contributor

BtActionNode returned FAILURE when an action goal was rejected or could
not be sent, without giving derived nodes a way to report the reason.

This PR:

  • Adds callbacks for goal rejection and send-goal failures.
  • Adds corresponding action result error codes.
  • Updates BT action nodes to set error_code_id for both failures.
  • Adds regression coverage for rejected goals.

Basic Info

Info Please fill out this column
Ticket(s) this addresses /
Primary OS tested on Ubuntu
Robotic platform tested on /
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

Description of documentation updates required from your changes

Description of how this change was tested


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

BtActionNode returned failure directly when a goal was rejected or
sending a goal was interrupted. Derived nodes could not record those
request failures.

This commit adds callbacks for rejected goals and interrupted goal
requests before returning failure. A unit test verifies the rejected
goal callback.

Signed-off-by: Dylan De Coeyer <dylan.decoeyer@quimesis.be>
BT action nodes returned failure when a goal was rejected or could not
be sent without populating the error-code output port.

This commit adds action result codes for both conditions and writes
them from every BtActionNode implementation, including docking and
following nodes. It also reports FollowObject timeouts and checks
the goal-rejection code in the action-node test.

Signed-off-by: Dylan De Coeyer <dylan.decoeyer@quimesis.be>
Signed-off-by: Dylan De Coeyer <dylan.decoeyer@quimesis.be>
Comment on lines +199 to +215
/**
* @brief Function to perform work in a BT Node when the action server rejects a goal
* Such as setting the error code ID status for action clients.
*/
virtual void on_goal_rejected()
{
return;
}

/**
* @brief Function to perform work when sending a goal to the action server fails
* Such as setting the error code ID status for action clients.
*/
virtual void on_send_goal_failure()
{
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe do

setOutput("error_code_id", ActionResult::GOAL_REJECTED);

Here so that the other BT nodes don't actually need to be updated unless they want to do more? Maybe type traits can be used to see if the goal fields in the response exist before doing so and/or pre-processor conditions? This may also expose any actions that also should be updated that were not

Comment on lines +307 to 311
on_goal_rejected();
return BT::NodeStatus::FAILURE;
} else if (e.what() == std::string("send_goal failed")) {
on_send_goal_failure();
// Action related failure that should not fail the tree, but the node

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have it return the BT NodeStatus from these new on_XYZ() callbacks in case they want to handle the situation differently? Many of our callbacks do. I don't 100% think that's needed here, but a motivational question for you if you can imagine a situation that it would be necessary.

Changing this API/ABI later would be painful, so I'd like to do it here and now if we can imagine such a situation

@SteveMacenski

Copy link
Copy Markdown
Member

Neat. This seems related to #6279 so linking that up.

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