Template Function rclcpp_action::create_server(NodeT, const std::string&, typename Server<ActionT>::GoalCallback, typename Server<ActionT>::CancelCallback, typename Server<ActionT>::AcceptedCallback, const rcl_action_server_options_t&, rclcpp::CallbackGroup::SharedPtr)

Function Documentation

template<typename ActionT, typename NodeT>
Server<ActionT>::SharedPtr rclcpp_action::create_server(NodeT node, const std::string &name, typename Server<ActionT>::GoalCallback handle_goal, typename Server<ActionT>::CancelCallback handle_cancel, typename Server<ActionT>::AcceptedCallback handle_accepted, const rcl_action_server_options_t &options = rcl_action_server_get_default_options(), rclcpp::CallbackGroup::SharedPtr group = nullptr)

Create an action server.

All provided callback functions must be non-blocking.

See also

Server::Server() for more information.

Parameters:
  • node][in] The action server will be added to this node.

  • name[in] The action name.

  • handle_goal[in] A callback that decides if a goal should be accepted or rejected.

  • handle_cancel[in] A callback that decides if a goal should be attempted to be canceled. The return from this callback only indicates if the server will try to cancel a goal. It does not indicate if the goal was actually canceled.

  • handle_accepted[in] A callback that is called to give the user a handle to the goal.

  • options[in] Options to pass to the underlying rcl_action_server_t.

  • group[in] The action server will be added to this callback group. If nullptr, then the action server is added to the default callback group.