From 88bde64405b9f78563176d6bc3cc698fb3ae1c64 Mon Sep 17 00:00:00 2001 From: Nicola Conti Date: Mon, 18 Sep 2023 11:31:06 +0200 Subject: [PATCH] Handle Goal is Lost STATE --- .github/workflows/ci.yml | 6 +++--- .gitignore | 4 ++++ include/behaviortree_ros/bt_action_node.h | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85bf417..e632d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: "CI" +name: "Continuous Integration" on: pull_request: @@ -14,10 +14,10 @@ jobs: os: [ubuntu-20.04] steps: - name: "Setup ROS" - uses: ros-tooling/setup-ros@v0.5 + uses: ros-tooling/setup-ros@v0.6 with: required-ros-distributions: noetic - name: "Build & Test" - uses: ros-tooling/action-ros-ci@v0.2 + uses: ros-tooling/action-ros-ci@v0.3 with: target-ros1-distro: noetic diff --git a/.gitignore b/.gitignore index 259148f..17431ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +## VS Code ## +############# +.vscode + # Prerequisites *.d diff --git a/include/behaviortree_ros/bt_action_node.h b/include/behaviortree_ros/bt_action_node.h index a8c21bb..0e765d8 100644 --- a/include/behaviortree_ros/bt_action_node.h +++ b/include/behaviortree_ros/bt_action_node.h @@ -81,7 +81,8 @@ class RosActionNode : public BT::ActionNodeBase enum FailureCause{ MISSING_SERVER = 0, ABORTED_BY_SERVER = 1, - REJECTED_BY_SERVER = 2 + REJECTED_BY_SERVER = 2, + GOAL_IS_LOST = 3 }; /// Called when a service call failed. Can be overriden by the user. @@ -155,6 +156,10 @@ class RosActionNode : public BT::ActionNodeBase { return onFailedRequest( REJECTED_BY_SERVER ); } + else if( action_state == actionlib::SimpleClientGoalState::LOST) + { + return onFailedRequest( GOAL_IS_LOST ); + } else { // FIXME: is there any other valid state we should consider?