Rename action state transitions (#677)

* Rename action state transitions

Now using active verbs as described in the design doc:

http://design.ros2.org/articles/actions.html#goal-states

Connects to ros2/rcl#399.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This commit is contained in:
Jacob Perron 2019-04-16 04:46:40 -07:00 committed by GitHub
parent 70f48d68b9
commit 68d0ac1e61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 30 deletions

View file

@ -360,7 +360,7 @@ protected:
if (goal_handle) {
resp = handle_cancel_(goal_handle);
if (CancelResponse::ACCEPT == resp) {
goal_handle->_set_canceling();
goal_handle->_cancel_goal();
}
}
}

View file

@ -80,27 +80,27 @@ protected:
/// \internal
RCLCPP_ACTION_PUBLIC
void
_set_aborted();
_abort();
/// \internal
RCLCPP_ACTION_PUBLIC
void
_set_succeeded();
_succeed();
/// \internal
RCLCPP_ACTION_PUBLIC
void
_set_canceling();
_cancel_goal();
/// \internal
RCLCPP_ACTION_PUBLIC
void
_set_canceled();
_canceled();
/// \internal
RCLCPP_ACTION_PUBLIC
void
_set_executing();
_execute();
/// Transition the goal to canceled state if it never reached a terminal state.
/// \internal
@ -165,9 +165,9 @@ public:
* \param[in] result_msg the final result to send to clients.
*/
void
set_aborted(typename ActionT::Result::SharedPtr result_msg)
abort(typename ActionT::Result::SharedPtr result_msg)
{
_set_aborted();
_abort();
auto response = std::make_shared<typename ActionT::Impl::GetResultService::Response>();
response->status = action_msgs::msg::GoalStatus::STATUS_ABORTED;
response->result = *result_msg;
@ -185,9 +185,9 @@ public:
* \param[in] result_msg the final result to send to clients.
*/
void
set_succeeded(typename ActionT::Result::SharedPtr result_msg)
succeed(typename ActionT::Result::SharedPtr result_msg)
{
_set_succeeded();
_succeed();
auto response = std::make_shared<typename ActionT::Impl::GetResultService::Response>();
response->status = action_msgs::msg::GoalStatus::STATUS_SUCCEEDED;
response->result = *result_msg;
@ -205,9 +205,9 @@ public:
* \param[in] result_msg the final result to send to clients.
*/
void
set_canceled(typename ActionT::Result::SharedPtr result_msg)
canceled(typename ActionT::Result::SharedPtr result_msg)
{
_set_canceled();
_canceled();
auto response = std::make_shared<typename ActionT::Impl::GetResultService::Response>();
response->status = action_msgs::msg::GoalStatus::STATUS_CANCELED;
response->result = *result_msg;
@ -221,9 +221,9 @@ public:
* \throws rclcpp::exceptions::RCLError If the goal is in any state besides executing.
*/
void
set_executing()
execute()
{
_set_executing();
_execute();
on_executing_(uuid_);
}