Skip to content

Commit

Permalink
Use rclcpp logger
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaidel committed Sep 21, 2023
1 parent 62373a8 commit 1ce4564
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/ros1_bridge/action_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,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."<<std::endl;
RCLCPP_ERROR(this->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..."<<std::endl;
RCLCPP_WARN(this->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++;
}
Expand All @@ -185,8 +185,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;
}
};
Expand Down

0 comments on commit 1ce4564

Please sign in to comment.