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

update to use separated action types #227

Merged
merged 4 commits into from
Mar 12, 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
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
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