Skip to content

Commit

Permalink
Use rclcpp logger
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaidel authored and fmessmer committed Sep 22, 2023
1 parent 08fc3bc commit f64801a
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 @@ -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."<<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 @@ -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;
}
};
Expand Down

0 comments on commit f64801a

Please sign in to comment.