From f64801ac4d2d4e9e0d6f64cc9f305ddddcddcef6 Mon Sep 17 00:00:00 2001 From: Benjamin Maidel Date: Thu, 21 Sep 2023 14:57:11 +0200 Subject: [PATCH] Use rclcpp logger --- include/ros1_bridge/action_factory.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/ros1_bridge/action_factory.hpp b/include/ros1_bridge/action_factory.hpp index 086137a9..62edb8e8 100644 --- a/include/ros1_bridge/action_factory.hpp +++ b/include/ros1_bridge/action_factory.hpp @@ -158,15 +158,15 @@ class ActionFactory_1_2 : public ActionFactoryInterface { if( counter >= 10) { - std::cout<<"std::shared_future not valid for more than 1.0 seconds. " - "Rejecting action goal."<logger_, "std::shared_future not valid for more than 1.0 seconds. " + "Rejecting action goal."); gh1_.setRejected(); return; } - std::cout<<"std::shared_future not valid. " - "This indicates a bug in the actionlib implementation. " - "goal_reponse_callback should only get called when the future is valid. " - "Waiting and retrying..."<logger_, "std::shared_future not valid. " + "This indicates a bug in the actionlib implementation. " + "goal_reponse_callback should only get called when the future is valid. " + "Waiting and retrying..."); rclcpp::sleep_for(std::chrono::milliseconds(100)); counter++; } @@ -187,8 +187,8 @@ class ActionFactory_1_2 : public ActionFactoryInterface } } } catch (const std::future_error& e) { - std::cout << "Caught a future_error with code \"" << e.code() - << "\"\nMessage: \"" << e.what() << "\"\n"; + RCLCPP_ERROR_STREAM(this->logger_, "Caught a future_error with code '" << e.code() + << "' Message: '" << e.what()<<"'"); throw; } };