Skip to content

Commit

Permalink
update to use separated action types (#227)
Browse files Browse the repository at this point in the history
* match renamed action types

* use correct term

* update action API

* update another caller
  • Loading branch information
dirk-thomas authored Mar 12, 2019
1 parent cfc9bc6 commit f4d4b14
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions rclcpp/minimal_action_client/not_composable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ int main(int argc, char ** argv)
return 1;
}

rclcpp_action::ClientGoalHandle<Fibonacci>::Result result = result_future.get();
rclcpp_action::ClientGoalHandle<Fibonacci>::WrappedResult wrapped_result = result_future.get();

switch(result.code) {
switch(wrapped_result.code) {
case rclcpp_action::ResultCode::SUCCEEDED:
break;
case rclcpp_action::ResultCode::ABORTED:
Expand All @@ -81,7 +81,7 @@ int main(int argc, char ** argv)
}

RCLCPP_INFO(node->get_logger(), "result received");
for (auto number : result.response->sequence)
for (auto number : wrapped_result.result->sequence)
{
RCLCPP_INFO(node->get_logger(), "%" PRId64, number);
}
Expand Down
4 changes: 2 additions & 2 deletions rclcpp/minimal_action_client/not_composable_with_cancel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ int main(int argc, char ** argv)
return 1;
}

rclcpp_action::ClientGoalHandle<Fibonacci>::Result result = result_future.get();
switch(result.code) {
rclcpp_action::ClientGoalHandle<Fibonacci>::WrappedResult wrapped_result = result_future.get();
switch(wrapped_result.code) {
case rclcpp_action::ResultCode::SUCCEEDED:
break;
case rclcpp_action::ResultCode::ABORTED:
Expand Down
6 changes: 3 additions & 3 deletions rclcpp/minimal_action_client/not_composable_with_feedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ int main(int argc, char ** argv)
return 1;
}

rclcpp_action::ClientGoalHandle<Fibonacci>::Result result = result_future.get();
rclcpp_action::ClientGoalHandle<Fibonacci>::WrappedResult wrapped_result = result_future.get();

switch(result.code) {
switch(wrapped_result.code) {
case rclcpp_action::ResultCode::SUCCEEDED:
break;
case rclcpp_action::ResultCode::ABORTED:
Expand All @@ -93,7 +93,7 @@ int main(int argc, char ** argv)
}

RCLCPP_INFO(g_node->get_logger(), "result received");
for (auto number : result.response->sequence)
for (auto number : wrapped_result.result->sequence)
{
RCLCPP_INFO(g_node->get_logger(), "%" PRId64, number);
}
Expand Down
10 changes: 5 additions & 5 deletions rclcpp/minimal_action_server/not_composable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ void execute(
auto& sequence = feedback->sequence;
sequence.push_back(0);
sequence.push_back(1);
auto result_response = std::make_shared<Fibonacci::Result>();
auto result = std::make_shared<Fibonacci::Result>();

for (int i = 1; (i < goal->order) && rclcpp::ok(); ++i)
{
// Check if there is a cancel request
if (goal_handle->is_canceling())
{
result_response->sequence = sequence;
goal_handle->set_canceled(result_response);
result->sequence = sequence;
goal_handle->set_canceled(result);
RCLCPP_INFO(rclcpp::get_logger("server"), "Goal Canceled");
return;
}
Expand All @@ -76,8 +76,8 @@ void execute(

// Check if goal is done
if (rclcpp::ok()) {
result_response->sequence = sequence;
goal_handle->set_succeeded(result_response);
result->sequence = sequence;
goal_handle->set_succeeded(result);
RCLCPP_INFO(rclcpp::get_logger("server"), "Goal Suceeded");
}
}
Expand Down

0 comments on commit f4d4b14

Please sign in to comment.