Skip to content

Commit

Permalink
Use :returns:
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz committed Oct 17, 2017
1 parent b68335b commit e37969d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion rclpy/rclpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def wait_for_service(self, timeout_sec=None):
:param timeout_sec: Seconds to wait. Block forever if None or negative. Don't wait if 0
:type timeout_sec: float or None
:rtype: bool true if the service is available
:rtype: bool
:returns: true if the service is available
"""
timeout_nsec = rclpy.utilities.timeout_sec_to_nsec(timeout_sec)
result = self.service_is_ready()
Expand Down
3 changes: 2 additions & 1 deletion rclpy/rclpy/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def wait(self, timeout_sec=None):
:param timeout_sec: Seconds to wait. Block forever if None or negative. Don't wait if 0
:type timeout_sec: float or None
:rtype: bool True if all work completed
:rtype: bool
:returns: True if all work completed
"""
if timeout_sec is not None and timeout_sec < 0:
timeout_sec = None
Expand Down
2 changes: 1 addition & 1 deletion rclpy/rclpy/graph_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def add_timer(self, timer_period_ns, callback):
:type timer_period_ns: integer
:param callback: called when the graph updates
:type callback: callable
:rtype: rclpy.timer.WallTimer instance
:rtype: rclpy.timer.WallTimer
"""
with self._lock:
tmr = _WallTimer(callback, None, timer_period_ns)
Expand Down
5 changes: 5 additions & 0 deletions rclpy/rclpy/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def timeout_sec_to_nsec(timeout_sec):
Python tends to use floating point numbers in seconds for timeouts. This utility converts a
python-style timeout to an integer in nanoseconds that can be used by rcl_wait.
:param timeout_sec: Seconds to wait. Block forever if None or negative. Don't wait if 0
:type timeout_sec: float or None
:rtype: int
:returns: rcl_wait compatible timeout in nanoseconds
"""
if timeout_sec is None:
# Block forever
Expand Down

0 comments on commit e37969d

Please sign in to comment.