I don’t understand the definition of a function below: What does the (-1) mean at the end of the parameter list?
template<typename RatioT = std::milli>
bool rclcpp::client::ClientBase::wait_for_service (std::chrono::duration< int64_t, RatioT > timeout = std::chrono::duration< int64_t, RatioT >(-1) )
Source:
- https://docs.ros2.org/beta3/api/rclcpp/classrclcpp_1_1client_1_1ClientBase.html#a2999c323a3ee4935cd74d12675e668a0
From this tutorial:
- https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.html
no name is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
The -1 found in the function signature (The end of the function) for wait_for_service means that the default value for the “timeout” parameter is set to infinite duration.
Hope it helps
Mhd_K1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1