Skip to content

Commit 7100ba5

Browse files
committed
Small docstring cleanups
1 parent 58a178e commit 7100ba5

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/pubsub.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ end
3636
Subscriber{T}(topic, callback, cb_args=(); kwargs...)
3737
Subscriber(topic, T, callback, cb_args=(); kwargs...)
3838
39-
Create a subscription to a topic with a callback to use when a message is received, which can be any
40-
callable type. Keyword arguments are directly passed to rospy.
39+
Create a subscription to a topic with message type `T` with a callback to use when a message is
40+
received, which can be any callable type. Extra arguments provided to the callback when invoked
41+
can be provided in the `cb_args` tuple. Keyword arguments are directly passed to rospy.
4142
"""
4243
type Subscriber{MsgType<:AbstractMsg}
4344
callback

src/rospy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ get_ros_root() = __rospy__[:get_ros_root]()
2525
"""
2626
spin()
2727
28-
Block execution and only process callbacks/service calls until the node is shut down.
28+
Block execution and process callbacks/service calls until the node is shut down.
2929
"""
3030
function spin()
3131
#Have to make sure both Julia tasks and python threads can wake up so

src/time.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ to_nsec{T<:TVal}(t::T) = 1_000_000_000*t.secs + t.nsecs
9595
convert{T<:TVal}(::Type{Float64}, t::T) = to_sec(t)
9696

9797
#Comparisons
98-
=={T<:TVal}(t1::T, t2::T) = (t1.secs == t2.secs) && (t1.nsecs == t2.nsecs)
98+
=={T<:TVal}(t1::T, t2::T) = (t1.secs == t2.secs) && (t1.nsecs == t2.nsecs)
9999
isless{T<:TVal}(t1::T, t2::T) = to_nsec(t1) < to_nsec(t2)
100100

101101
"""
102102
Rate(hz::Real), Rate(d::Duration)
103103
104104
Used to allow a loop to run at a fixed rate. Construct with a frequency or `Duration` and use with
105105
`rossleep` or `sleep`. The rate object will record execution time of other work in the loop and
106-
modify the sleep time to compensate and keep the loop rate as consistent as possible.
106+
modify the sleep time to compensate, keeping the loop rate as consistent as possible.
107107
"""
108108
type Rate
109109
duration::Duration
@@ -136,7 +136,8 @@ now() = get_rostime()
136136
"""
137137
rossleep(t)
138138
139-
Call the ROS sleep function with a number of seconds, a `Duration` or a `Rate` object.
139+
Sleep and process callbacks for a number of seconds implied by the type and value of `t`, which may
140+
be a real-value, a `Duration` object, or a `Rate` object.
140141
"""
141142
function rossleep(td::Duration)
142143
#Busy sleep loop needed to allow both julia and python async activity
@@ -166,8 +167,7 @@ end
166167
"""
167168
sleep(t::Duration), sleep(t::Rate)
168169
169-
Call the ROS sleep function with a `Duration` or `Rate` object. Use `rossleep` to specify sleep time
170-
directly.
170+
Call `rossleep` with a `Duration` or `Rate` object. Use `rossleep` to specify sleep time directly.
171171
"""
172172
sleep(t::Duration) = rossleep(t)
173173
sleep(t::Rate) = rossleep(t)

0 commit comments

Comments
 (0)