Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename action state transitions #342

Merged
merged 2 commits into from
Apr 16, 2019
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
14 changes: 7 additions & 7 deletions test_communication/test/action_server_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def execute_callback(goal_handle):
return expected_goal.execute_goal(goal_handle)
# Not an expected goal (this should not happen)
print('Unexpected goal received by action server', file=sys.stderr)
goal_handle.set_aborted()
goal_handle.abort()
return action_type.Result()

action_name = 'test/action/' + action_type.__name__
Expand All @@ -61,12 +61,12 @@ def execute_goal(goal_handle):

for i in range(1, goal.order):
if not rclpy.ok():
goal_handle.set_aborted()
goal_handle.abort()
return Fibonacci.Result()

# Check if the goal was canceled
if goal_handle.is_cancel_requested:
goal_handle.set_canceled()
goal_handle.canceled()
result = Fibonacci.Result()
result.sequence = feedback.sequence
print('Goal was canceled')
Expand All @@ -85,7 +85,7 @@ def execute_goal(goal_handle):
# Send final result
result = Fibonacci.Result()
result.sequence = feedback.sequence
goal_handle.set_succeeded()
goal_handle.succeed()
print('Goal succeeded')
return result

Expand Down Expand Up @@ -118,12 +118,12 @@ def execute_goal(goal_handle):
num_feedback = 10
for i in range(0, num_feedback):
if not rclpy.ok():
goal_handle.set_aborted()
goal_handle.abort()
return NestedMessage.Result()

# Check if the goal was canceled
if goal_handle.is_cancel_requested:
goal_handle.set_canceled()
goal_handle.canceled()
print('Goal was canceled')
return result

Expand All @@ -135,7 +135,7 @@ def execute_goal(goal_handle):
time.sleep(0.1)

# Send final result
goal_handle.set_succeeded()
goal_handle.succeed()
print('Goal succeeded')
return result

Expand Down
8 changes: 4 additions & 4 deletions test_communication/test/test_action_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ generate_expected_fibonacci_goals(rclcpp::Logger logger)
// Check if the goal was canceled.
if (goal_handle->is_canceling()) {
result->sequence = feedback->sequence;
goal_handle->set_canceled(result);
goal_handle->canceled(result);
RCLCPP_INFO(logger, "goal was canceled");
return;
}
Expand All @@ -157,7 +157,7 @@ generate_expected_fibonacci_goals(rclcpp::Logger logger)
}

result->sequence = feedback->sequence;
goal_handle->set_succeeded(result);
goal_handle->succeed(result);
RCLCPP_INFO(logger, "goal succeeded");
};

Expand Down Expand Up @@ -213,7 +213,7 @@ generate_expected_nested_message_goals(rclcpp::Logger logger)
// Check if the goal was canceled.
if (goal_handle->is_canceling()) {
result->nested_field.int32_value = result_value;
goal_handle->set_canceled(result);
goal_handle->canceled(result);
RCLCPP_INFO(logger, "goal was canceled");
return;
}
Expand All @@ -227,7 +227,7 @@ generate_expected_nested_message_goals(rclcpp::Logger logger)
}

result->nested_field.int32_value = result_value;
goal_handle->set_succeeded(result);
goal_handle->succeed(result);
RCLCPP_INFO(logger, "goal succeeded");
};

Expand Down