Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@
return BT::NodeStatus::SUCCESS;
}

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
virtual void on_timeout()
{
return;
}

/**
* @brief The main override required by a BT action
* @return BT::NodeStatus Status of tick execution
Expand Down Expand Up @@ -231,6 +240,7 @@
"Timed out while waiting for action server to acknowledge goal request for %s",
action_name_.c_str());
future_goal_handle_.reset();
on_timeout();
return BT::NodeStatus::FAILURE;
}
}
Expand Down Expand Up @@ -261,6 +271,7 @@
"Timed out while waiting for action server to acknowledge goal request for %s",
action_name_.c_str());
future_goal_handle_.reset();
on_timeout();

Check warning on line 274 in nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp#L274

Added line #L274 was not covered by tests
return BT::NodeStatus::FAILURE;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class AssistedTeleopAction : public BtActionNode<nav2_msgs::action::AssistedTele
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to read parameters and initialize class variables
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class BackUpAction : public BtActionNode<nav2_msgs::action::BackUp>
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to read parameters and initialize class variables
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class ComputeAndTrackRouteAction : public BtActionNode<nav2_msgs::action::Comput
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to perform some user-defined operation after a timeout
* waiting for a result that hasn't been received yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class ComputePathThroughPosesAction
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class ComputePathToPoseAction : public BtActionNode<nav2_msgs::action::ComputePa
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class ComputeRouteAction : public BtActionNode<nav2_msgs::action::ComputeRoute>
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class DriveOnHeadingAction : public BtActionNode<nav2_msgs::action::DriveOnHeadi
* @brief Function to perform some user-defined operation upon cancellation of the action
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;
};

} // namespace nav2_behavior_tree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class FollowPathAction : public BtActionNode<nav2_msgs::action::FollowPath>
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to perform some user-defined operation after a timeout
* waiting for a result that hasn't been received yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class NavigateThroughPosesAction : public BtActionNode<nav2_msgs::action::Naviga
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Creates list of BT ports
* @return BT::PortsList Containing basic ports along with node-specific ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class NavigateToPoseAction : public BtActionNode<nav2_msgs::action::NavigateToPo
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Creates list of BT ports
* @return BT::PortsList Containing basic ports along with node-specific ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class SmoothPathAction : public nav2_behavior_tree::BtActionNode<nav2_msgs::acti
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Creates list of BT ports
* @return BT::PortsList Containing basic ports along with node-specific ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class SpinAction : public BtActionNode<nav2_msgs::action::Spin>
*/
void on_tick() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to read parameters and initialize class variables
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class WaitAction : public BtActionNode<nav2_msgs::action::Wait>
*/
void on_tick() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* @brief Function to read parameters and initialize class variables
*/
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/assisted_teleop_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
return BT::NodeStatus::SUCCESS;
}

void AssistedTeleopAction::on_timeout()

Check warning on line 72 in nav2_behavior_tree/plugins/action/assisted_teleop_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/assisted_teleop_action.cpp#L72

Added line #L72 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 75 in nav2_behavior_tree/plugins/action/assisted_teleop_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/assisted_teleop_action.cpp#L74-L75

Added lines #L74 - L75 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/back_up_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
return BT::NodeStatus::SUCCESS;
}

void BackUpAction::on_timeout()

Check warning on line 81 in nav2_behavior_tree/plugins/action/back_up_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/back_up_action.cpp#L81

Added line #L81 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 84 in nav2_behavior_tree/plugins/action/back_up_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/back_up_action.cpp#L83-L84

Added lines #L83 - L84 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
return BT::NodeStatus::SUCCESS;
}

void ComputeAndTrackRouteAction::on_timeout()

Check warning on line 78 in nav2_behavior_tree/plugins/action/compute_and_track_route_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_and_track_route_action.cpp#L78

Added line #L78 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 81 in nav2_behavior_tree/plugins/action/compute_and_track_route_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_and_track_route_action.cpp#L80-L81

Added lines #L80 - L81 were not covered by tests
}

void ComputeAndTrackRouteAction::on_wait_for_result(
std::shared_ptr<const Action::Feedback>/*feedback*/)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
return BT::NodeStatus::SUCCESS;
}

void ComputePathThroughPosesAction::on_timeout()

Check warning on line 69 in nav2_behavior_tree/plugins/action/compute_path_through_poses_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_path_through_poses_action.cpp#L69

Added line #L69 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 72 in nav2_behavior_tree/plugins/action/compute_path_through_poses_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_path_through_poses_action.cpp#L71-L72

Added lines #L71 - L72 were not covered by tests
}

void ComputePathThroughPosesAction::halt()
{
nav_msgs::msg::Path empty_path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
return BT::NodeStatus::SUCCESS;
}

void ComputePathToPoseAction::on_timeout()

Check warning on line 85 in nav2_behavior_tree/plugins/action/compute_path_to_pose_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_path_to_pose_action.cpp#L85

Added line #L85 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 88 in nav2_behavior_tree/plugins/action/compute_path_to_pose_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_path_to_pose_action.cpp#L87-L88

Added lines #L87 - L88 were not covered by tests
}

void ComputePathToPoseAction::halt()
{
nav_msgs::msg::Path empty_path;
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/compute_route_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
return BT::NodeStatus::SUCCESS;
}

void ComputeRouteAction::on_timeout()

Check warning on line 90 in nav2_behavior_tree/plugins/action/compute_route_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_route_action.cpp#L90

Added line #L90 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 93 in nav2_behavior_tree/plugins/action/compute_route_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/compute_route_action.cpp#L92-L93

Added lines #L92 - L93 were not covered by tests
}

void ComputeRouteAction::halt()
{
resetPorts();
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/drive_on_heading_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
return BT::NodeStatus::SUCCESS;
}

void DriveOnHeadingAction::on_timeout()

Check warning on line 79 in nav2_behavior_tree/plugins/action/drive_on_heading_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/drive_on_heading_action.cpp#L79

Added line #L79 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 82 in nav2_behavior_tree/plugins/action/drive_on_heading_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/drive_on_heading_action.cpp#L81-L82

Added lines #L81 - L82 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/follow_path_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
return BT::NodeStatus::SUCCESS;
}

void FollowPathAction::on_timeout()

Check warning on line 61 in nav2_behavior_tree/plugins/action/follow_path_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/follow_path_action.cpp#L61

Added line #L61 was not covered by tests
{
setOutput("error_code_id", ActionResult::CONTROLLER_TIMED_OUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 64 in nav2_behavior_tree/plugins/action/follow_path_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/follow_path_action.cpp#L63-L64

Added lines #L63 - L64 were not covered by tests
}

void FollowPathAction::on_wait_for_result(
std::shared_ptr<const Action::Feedback>/*feedback*/)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
return BT::NodeStatus::SUCCESS;
}

void NavigateThroughPosesAction::on_timeout()

Check warning on line 64 in nav2_behavior_tree/plugins/action/navigate_through_poses_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/navigate_through_poses_action.cpp#L64

Added line #L64 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 67 in nav2_behavior_tree/plugins/action/navigate_through_poses_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/navigate_through_poses_action.cpp#L66-L67

Added lines #L66 - L67 were not covered by tests
}

} // namespace nav2_behavior_tree

Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/navigate_to_pose_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
return BT::NodeStatus::SUCCESS;
}

void NavigateToPoseAction::on_timeout()

Check warning on line 63 in nav2_behavior_tree/plugins/action/navigate_to_pose_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/navigate_to_pose_action.cpp#L63

Added line #L63 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 66 in nav2_behavior_tree/plugins/action/navigate_to_pose_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/navigate_to_pose_action.cpp#L65-L66

Added lines #L65 - L66 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/smooth_path_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
return BT::NodeStatus::SUCCESS;
}

void SmoothPathAction::on_timeout()

Check warning on line 68 in nav2_behavior_tree/plugins/action/smooth_path_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/smooth_path_action.cpp#L68

Added line #L68 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 71 in nav2_behavior_tree/plugins/action/smooth_path_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/smooth_path_action.cpp#L70-L71

Added lines #L70 - L71 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/spin_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
return BT::NodeStatus::SUCCESS;
}

void SpinAction::on_timeout()

Check warning on line 71 in nav2_behavior_tree/plugins/action/spin_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/spin_action.cpp#L71

Added line #L71 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 74 in nav2_behavior_tree/plugins/action/spin_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/spin_action.cpp#L73-L74

Added lines #L73 - L74 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
6 changes: 6 additions & 0 deletions nav2_behavior_tree/plugins/action/wait_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
return BT::NodeStatus::SUCCESS;
}

void WaitAction::on_timeout()

Check warning on line 76 in nav2_behavior_tree/plugins/action/wait_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/wait_action.cpp#L76

Added line #L76 was not covered by tests
{
setOutput("error_code_id", ActionResult::TIMEOUT);
setOutput("error_msg", "Behavior Tree action client timed out waiting.");

Check warning on line 79 in nav2_behavior_tree/plugins/action/wait_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/wait_action.cpp#L78-L79

Added lines #L78 - L79 were not covered by tests
}

} // namespace nav2_behavior_tree

#include "behaviortree_cpp/bt_factory.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class DockRobotAction
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class UndockRobotAction
*/
BT::NodeStatus on_cancelled() override;

/**
* @brief Function to perform work in a BT Node when the action server times out
* Such as setting the error code ID status to timed out for action clients.
*/
void on_timeout() override;

/**
* \brief Override required by the a BT action. Cancel the action and set the path output
*/
Expand Down
Loading
Loading