ros/ros_comm

Missing const qualifiers in member functions of the ServiceClient class.

hogabrie opened this issue · 1 comments

The following 3 member functions of ServiceClient are non-const: ServiceClient::getService(), ServiceClient::exists() and ServiceClient::waitForExistence(ros::Duration timeout).

They call free functions and do not alter the state of the class, they should thus be labeled const like isValid or isPersistent.
If those methods are non-const, it's hard to write const-correct downstream code (unless you make the ServiceClient member mutable 😞 ).

peci1 commented

Your request seems valid to me. Could you send a pull request with the fix? Feel free to ping me from the PR for a review (although I'm not a core ROS reviewer).