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

avoid new deprecations #267

Merged
merged 2 commits into from
Apr 23, 2020
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
4 changes: 2 additions & 2 deletions rclcpp/actions/minimal_action_client/not_composable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char ** argv)
// Ask server to achieve some goal and wait until it's accepted
auto goal_handle_future = action_client->async_send_goal(goal_msg);
if (rclcpp::spin_until_future_complete(node, goal_handle_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "send goal call failed :(");
return 1;
Expand All @@ -58,7 +58,7 @@ int main(int argc, char ** argv)

RCLCPP_INFO(node->get_logger(), "Waiting for result");
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "get result call failed :(");
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char ** argv)
// Send goal and wait for result (registering feedback callback is optional)
auto goal_handle_future = action_client->async_send_goal(goal_msg);
if (rclcpp::spin_until_future_complete(node, goal_handle_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "send goal call failed :(");
return 1;
Expand All @@ -61,27 +61,27 @@ int main(int argc, char ** argv)
result_future,
std::chrono::seconds(3));

if (rclcpp::executor::FutureReturnCode::TIMEOUT == wait_result) {
if (rclcpp::FutureReturnCode::TIMEOUT == wait_result) {
RCLCPP_INFO(node->get_logger(), "canceling goal");
// Cancel the goal since it is taking too long
auto cancel_result_future = action_client->async_cancel_goal(goal_handle);
if (rclcpp::spin_until_future_complete(node, cancel_result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "failed to cancel goal");
rclcpp::shutdown();
return 1;
}
RCLCPP_INFO(node->get_logger(), "goal is being canceled");
} else if (rclcpp::executor::FutureReturnCode::SUCCESS != wait_result) {
} else if (rclcpp::FutureReturnCode::SUCCESS != wait_result) {
RCLCPP_ERROR(node->get_logger(), "failed to get result");
rclcpp::shutdown();
return 1;
}

RCLCPP_INFO(node->get_logger(), "Waiting for result");
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "get result call failed :(");
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char ** argv)
auto goal_handle_future = action_client->async_send_goal(goal_msg, send_goal_options);

if (rclcpp::spin_until_future_complete(g_node, goal_handle_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(g_node->get_logger(), "send goal call failed :(");
return 1;
Expand All @@ -72,7 +72,7 @@ int main(int argc, char ** argv)

RCLCPP_INFO(g_node->get_logger(), "Waiting for result");
if (rclcpp::spin_until_future_complete(g_node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(g_node->get_logger(), "get result call failed :(");
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ class DualThreadedNode : public rclcpp::Node
* assign callbacks to them. They're also what the executor looks for when trying to run multiple threads
*/
callback_group_subscriber1_ = this->create_callback_group(
rclcpp::callback_group::CallbackGroupType::MutuallyExclusive);
rclcpp::CallbackGroupType::MutuallyExclusive);
callback_group_subscriber2_ = this->create_callback_group(
rclcpp::callback_group::CallbackGroupType::MutuallyExclusive);
rclcpp::CallbackGroupType::MutuallyExclusive);

// Each of these callback groups is basically a thread
// Everything assigned to one of them gets bundled into the same thread
Expand Down Expand Up @@ -153,8 +153,8 @@ class DualThreadedNode : public rclcpp::Node
RCLCPP_INFO(this->get_logger(), thread_string, msg->data.c_str());
}

rclcpp::callback_group::CallbackGroup::SharedPtr callback_group_subscriber1_;
rclcpp::callback_group::CallbackGroup::SharedPtr callback_group_subscriber2_;
rclcpp::CallbackGroup::SharedPtr callback_group_subscriber1_;
rclcpp::CallbackGroup::SharedPtr callback_group_subscriber2_;
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription1_;
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription2_;
};
Expand Down
2 changes: 1 addition & 1 deletion rclcpp/services/minimal_client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main(int argc, char * argv[])
request->b = 1;
auto result_future = client->async_send_request(request);
if (rclcpp::spin_until_future_complete(node, result_future) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
rclcpp::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_logger(), "service call failed :(");
return 1;
Expand Down