Template Class SimpleActionServer

Class Documentation

template<typename ACTION_TYPE>
class SimpleActionServer

Simple wrapper around rclcpp action server for easier usage. Assumes only one action at a time.

Execute callback should return true if successful and write into the result object

Public Types

using ExecuteCallback = std::function<bool(const typename ACTION_TYPE::Goal&, typename ACTION_TYPE::Result&)>

Public Functions

inline SimpleActionServer(rclcpp::Node::SharedPtr node, const std::string &action_namespace, ExecuteCallback execute_cb)
inline void publishFeedback(typename ACTION_TYPE::Feedback::SharedPtr feedback)

Publishes feedback on the active action.

inline bool isActive() const
inline bool isCanceling() const
inline bool isExecuting() const

Protected Types

using GoalHandle = std::shared_ptr<rclcpp_action::ServerGoalHandle<ACTION_TYPE>>

Protected Functions

inline rclcpp_action::GoalResponse handleGoal(const rclcpp_action::GoalUUID&, std::shared_ptr<const typename ACTION_TYPE::Goal>)
inline rclcpp_action::CancelResponse handleCancel(const GoalHandle)
inline void handleAccepted(const GoalHandle goal_handle)
inline void execute(GoalHandle goal_handle)

Protected Attributes

rclcpp_action::Server<ACTION_TYPE>::SharedPtr server_
GoalHandle goal_handle_
ExecuteCallback execute_cb_
rclcpp::Node::SharedPtr node_
rclcpp::Logger LOGGER
std::string info_string_