|
Nav2 Navigation Stack - jazzy
jazzy
ROS 2 Navigation Stack
|
An action server wrapper to make applications simpler using Actions. More...
#include <nav2_util/include/nav2_util/simple_action_server.hpp>

Public Types | |
| typedef std::function< void()> | ExecuteCallback |
| typedef std::function< void()> | CompletionCallback |
Public Member Functions | |
| template<typename NodeT > | |
| SimpleActionServer (NodeT node, const std::string &action_name, ExecuteCallback execute_callback, CompletionCallback completion_callback=nullptr, std::chrono::milliseconds server_timeout=std::chrono::milliseconds(500), bool spin_thread=false, const rcl_action_server_options_t &options=rcl_action_server_get_default_options(), const bool realtime=false) | |
| An constructor for SimpleActionServer. More... | |
| SimpleActionServer (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base_interface, rclcpp::node_interfaces::NodeClockInterface::SharedPtr node_clock_interface, rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr node_logging_interface, rclcpp::node_interfaces::NodeWaitablesInterface::SharedPtr node_waitables_interface, const std::string &action_name, ExecuteCallback execute_callback, CompletionCallback completion_callback=nullptr, std::chrono::milliseconds server_timeout=std::chrono::milliseconds(500), bool spin_thread=false, const rcl_action_server_options_t &options=rcl_action_server_get_default_options(), const bool realtime=false) | |
| An constructor for SimpleActionServer. More... | |
| rclcpp_action::GoalResponse | handle_goal (const rclcpp_action::GoalUUID &, std::shared_ptr< const typename ActionT::Goal >) |
| handle the goal requested: accept or reject. This implementation always accepts. More... | |
| rclcpp_action::CancelResponse | handle_cancel (const std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT >> handle) |
| Accepts cancellation requests of action server. More... | |
| void | setSoftRealTimePriority () |
| Sets thread priority level. | |
| void | handle_accepted (const std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT >> handle) |
| Handles accepted goals and adds to preempted queue to switch to. More... | |
| void | work () |
| Computed background work and processes stop requests. | |
| void | activate () |
| Active action server. | |
| void | deactivate () |
| Deactive action server. | |
| bool | is_running () |
| Whether the action server is munching on a goal. More... | |
| bool | is_server_active () |
| Whether the action server is active or not. More... | |
| bool | is_preempt_requested () const |
| Whether the action server has been asked to be preempted with a new goal. More... | |
| const std::shared_ptr< const typename ActionT::Goal > | accept_pending_goal () |
| Accept pending goals. More... | |
| void | terminate_pending_goal () |
| Terminate pending goals. | |
| const std::shared_ptr< const typename ActionT::Goal > | get_current_goal () const |
| Get the current goal object. More... | |
| const rclcpp_action::GoalUUID | get_current_goal_id () const |
| const std::shared_ptr< const typename ActionT::Goal > | get_pending_goal () const |
| Get the pending goal object. More... | |
| bool | is_cancel_requested () const |
| Whether or not a cancel command has come in. More... | |
| void | terminate_all (typename std::shared_ptr< typename ActionT::Result > result=std::make_shared< typename ActionT::Result >()) |
| Terminate all pending and active actions. More... | |
| void | terminate_current (typename std::shared_ptr< typename ActionT::Result > result=std::make_shared< typename ActionT::Result >()) |
| Terminate the active action. More... | |
| void | succeeded_current (typename std::shared_ptr< typename ActionT::Result > result=std::make_shared< typename ActionT::Result >()) |
| Return success of the active action. More... | |
| void | publish_feedback (typename std::shared_ptr< typename ActionT::Feedback > feedback) |
| Publish feedback to the action server clients. More... | |
Protected Member Functions | |
| constexpr auto | empty_result () const |
| Generate an empty result object for an action type. | |
| constexpr bool | is_active (const std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT >> handle) const |
| Whether a given goal handle is currently active. More... | |
| void | terminate (std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT >> &handle, typename std::shared_ptr< typename ActionT::Result > result=std::make_shared< typename ActionT::Result >()) |
| Terminate a particular action with a result. More... | |
| void | info_msg (const std::string &msg) const |
| Info logging. | |
| void | debug_msg (const std::string &msg) const |
| Debug logging. | |
| void | error_msg (const std::string &msg) const |
| Error logging. | |
| void | warn_msg (const std::string &msg) const |
| Warn logging. | |
Protected Attributes | |
| rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | node_base_interface_ |
| rclcpp::node_interfaces::NodeClockInterface::SharedPtr | node_clock_interface_ |
| rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr | node_logging_interface_ |
| rclcpp::node_interfaces::NodeWaitablesInterface::SharedPtr | node_waitables_interface_ |
| std::string | action_name_ |
| ExecuteCallback | execute_callback_ |
| CompletionCallback | completion_callback_ |
| std::future< void > | execution_future_ |
| bool | stop_execution_ {false} |
| bool | use_realtime_prioritization_ {false} |
| std::recursive_mutex | update_mutex_ |
| bool | server_active_ {false} |
| bool | preempt_requested_ {false} |
| std::chrono::milliseconds | server_timeout_ |
| std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT > > | current_handle_ |
| std::shared_ptr< rclcpp_action::ServerGoalHandle< ActionT > > | pending_handle_ |
| rclcpp_action::Server< ActionT >::SharedPtr | action_server_ |
| bool | spin_thread_ |
| rclcpp::CallbackGroup::SharedPtr | callback_group_ {nullptr} |
| rclcpp::executors::SingleThreadedExecutor::SharedPtr | executor_ |
| std::unique_ptr< nav2_util::NodeThread > | executor_thread_ |
An action server wrapper to make applications simpler using Actions.
Definition at line 38 of file simple_action_server.hpp.
|
inlineexplicit |
An constructor for SimpleActionServer.
| node | Ptr to node to make actions |
| action_name | Name of the action to call |
| execute_callback | Execution callback function of Action |
| server_timeout | Timeout to to react to stop or preemption requests |
| spin_thread | Whether to spin with a dedicated thread internally |
| options | Options to pass to the underlying rcl_action_server_t |
| realtime | Whether the action server's worker thread should have elevated prioritization (soft realtime) |
Definition at line 65 of file simple_action_server.hpp.
|
inlineexplicit |
An constructor for SimpleActionServer.
| <node | interfaces> Abstract node interfaces to make actions |
| action_name | Name of the action to call |
| execute_callback | Execution callback function of Action |
| server_timeout | Timeout to to react to stop or preemption requests |
| spin_thread | Whether to spin with a dedicated thread internally |
| options | Options to pass to the underlying rcl_action_server_t |
| realtime | Whether the action server's worker thread should have elevated prioritization (soft realtime) |
Definition at line 94 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::handle_accepted(), nav2_util::SimpleActionServer< ActionT >::handle_cancel(), and nav2_util::SimpleActionServer< ActionT >::handle_goal().

|
inline |
Accept pending goals.
Definition at line 363 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::debug_msg(), nav2_util::SimpleActionServer< ActionT >::empty_result(), nav2_util::SimpleActionServer< ActionT >::error_msg(), and nav2_util::SimpleActionServer< ActionT >::is_active().
Referenced by nav2_util::SimpleActionServer< ActionT >::work().


|
inline |
Get the current goal object.
Definition at line 408 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::error_msg(), and nav2_util::SimpleActionServer< ActionT >::is_active().

|
inline |
Get the pending goal object.
Definition at line 436 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::error_msg().

|
inline |
Handles accepted goals and adds to preempted queue to switch to.
| Goal | A server goal handle to cancel |
Definition at line 200 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::debug_msg(), nav2_util::SimpleActionServer< ActionT >::error_msg(), nav2_util::SimpleActionServer< ActionT >::is_active(), nav2_util::SimpleActionServer< ActionT >::is_running(), nav2_util::SimpleActionServer< ActionT >::setSoftRealTimePriority(), nav2_util::SimpleActionServer< ActionT >::terminate(), and nav2_util::SimpleActionServer< ActionT >::work().
Referenced by nav2_util::SimpleActionServer< ActionT >::SimpleActionServer().


|
inline |
Accepts cancellation requests of action server.
| uuid | Goal ID |
| Goal | A server goal handle to cancel |
Definition at line 169 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::debug_msg(), and nav2_util::SimpleActionServer< ActionT >::warn_msg().
Referenced by nav2_util::SimpleActionServer< ActionT >::SimpleActionServer().


|
inline |
handle the goal requested: accept or reject. This implementation always accepts.
| uuid | Goal ID |
| Goal | A shared pointer to the specific goal |
Definition at line 146 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::debug_msg().
Referenced by nav2_util::SimpleActionServer< ActionT >::SimpleActionServer().


|
inlineconstexprprotected |
Whether a given goal handle is currently active.
| handle | Goal handle to check |
Definition at line 568 of file simple_action_server.hpp.
Referenced by nav2_util::SimpleActionServer< ActionT >::accept_pending_goal(), nav2_util::SimpleActionServer< ActionT >::get_current_goal(), nav2_util::SimpleActionServer< ActionT >::handle_accepted(), nav2_util::SimpleActionServer< ActionT >::publish_feedback(), nav2_util::SimpleActionServer< ActionT >::succeeded_current(), nav2_util::SimpleActionServer< ActionT >::terminate(), and nav2_util::SimpleActionServer< ActionT >::work().

|
inline |
Whether or not a cancel command has come in.
Definition at line 452 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::error_msg().

|
inline |
Whether the action server has been asked to be preempted with a new goal.
Definition at line 353 of file simple_action_server.hpp.
|
inline |
Whether the action server is munching on a goal.
Definition at line 332 of file simple_action_server.hpp.
Referenced by nav2_util::SimpleActionServer< ActionT >::deactivate(), and nav2_util::SimpleActionServer< ActionT >::handle_accepted().

|
inline |
Whether the action server is active or not.
Definition at line 343 of file simple_action_server.hpp.
|
inline |
Publish feedback to the action server clients.
| feedback | A feedback object to send to the clients |
Definition at line 517 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::error_msg(), and nav2_util::SimpleActionServer< ActionT >::is_active().

|
inline |
Return success of the active action.
| result | A result object to send to the terminated actions |
Definition at line 500 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::debug_msg(), and nav2_util::SimpleActionServer< ActionT >::is_active().

|
inlineprotected |
Terminate a particular action with a result.
| handle | goal handle to terminate |
| the | Results object to terminate the action with |
Definition at line 579 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::info_msg(), nav2_util::SimpleActionServer< ActionT >::is_active(), and nav2_util::SimpleActionServer< ActionT >::warn_msg().
Referenced by nav2_util::SimpleActionServer< ActionT >::handle_accepted(), nav2_util::SimpleActionServer< ActionT >::terminate_all(), nav2_util::SimpleActionServer< ActionT >::terminate_current(), nav2_util::SimpleActionServer< ActionT >::terminate_pending_goal(), and nav2_util::SimpleActionServer< ActionT >::work().


|
inline |
Terminate all pending and active actions.
| result | A result object to send to the terminated actions |
Definition at line 474 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::terminate().
Referenced by nav2_util::SimpleActionServer< ActionT >::deactivate(), and nav2_util::SimpleActionServer< ActionT >::work().


|
inline |
Terminate the active action.
| result | A result object to send to the terminated action |
Definition at line 488 of file simple_action_server.hpp.
References nav2_util::SimpleActionServer< ActionT >::terminate().
