@@ -3,13 +3,30 @@ export init_node, is_shutdown, spin,
3
3
get_param, has_param, set_param, delete_param,
4
4
logdebug, loginfo, logwarn, logerr, logfatal
5
5
6
- # General rospy functions
6
+ """
7
+ init_node(name; args...)
8
+
9
+ Initialize this node, registering it with the ROS master. All arguments are passed on directly to
10
+ the rospy init_node function.
11
+ """
7
12
init_node (name:: AbstractString ; args... ) =
8
13
__rospy__[:init_node ](ascii (name); args... )
14
+
15
+ """
16
+ is_shutdown()
17
+
18
+ Return the shutdown status of the node.
19
+ """
9
20
is_shutdown () = __rospy__[:is_shutdown ]()
21
+
10
22
get_published_topics () = __rospy__[:get_published_topics ]()
11
23
get_ros_root () = __rospy__[:get_ros_root ]()
12
24
25
+ """
26
+ spin()
27
+
28
+ Block execution and only process callbacks/service calls until the node is shut down.
29
+ """
13
30
function spin ()
14
31
# Have to make sure both Julia tasks and python threads can wake up so
15
32
# can't just call rospy's spin
@@ -19,6 +36,12 @@ function spin()
19
36
end
20
37
21
38
# Parameter server API
39
+ """
40
+ get_param(param_name, default=nothing)
41
+
42
+ Request the value of a parameter from the parameter server, with optional default value. If no
43
+ default is given, throws a `KeyError` if the parameter cannot be found.
44
+ """
22
45
function get_param (param_name:: AbstractString , def= nothing )
23
46
try
24
47
if def == nothing
@@ -30,17 +53,36 @@ function get_param(param_name::AbstractString, def=nothing)
30
53
throw (KeyError (pycall (pybuiltin (" str" ), PyAny, ex. val)[2 : end - 1 ]))
31
54
end
32
55
end
56
+
57
+ """
58
+ set_param(param_name, val)
59
+
60
+ Set the value of a parameter on the parameter server.
61
+ """
33
62
set_param (param_name:: AbstractString , val) =
34
63
__rospy__[:set_param ](ascii (param_name), val)
64
+
65
+ """
66
+ has_param(param_name)
67
+
68
+ Return a boolean specifying if a parameter exists on the parameter server.
69
+ """
35
70
has_param (param_name:: AbstractString ) =
36
71
__rospy__[:has_param ](ascii (param_name))
72
+
73
+ """
74
+ delete_param(param_name)
75
+
76
+ Delete a parameter from the parameter server. Throws a `KeyError` if no such parameter exists.
77
+ """
37
78
function delete_param (param_name:: AbstractString )
38
79
try
39
80
__rospy__[:delete_param ](ascii (param_name))
40
81
catch ex
41
82
throw (KeyError (pycall (pybuiltin (" str" ), PyAny, ex. val)[2 : end - 1 ]))
42
83
end
43
84
end
85
+
44
86
# Doesn't work for some reason
45
87
# rospy_search_param(param_name::AbstractString) =
46
88
# __rospy__[:rospy_search_param](ascii(param_name))
@@ -53,6 +95,14 @@ logwarn(msg, args...) = __rospy__[:logwarn](msg, args...)
53
95
logerr (msg, args... ) = __rospy__[:logerr ](msg, args... )
54
96
logfatal (msg, args... ) = __rospy__[:logfatal ](msg, args... )
55
97
98
+ """
99
+ logdebug, loginfo, logwarn, logerr, logfatal
100
+
101
+ Call the rospy logging system at the corresponding message level, passing a message and other
102
+ arguments directly.
103
+ """
104
+ logdebug, loginfo, logwarn, logerr, logfatal
105
+
56
106
# Node information
57
107
get_name () = __rospy__[:get_name ]()
58
108
get_namespace () = __rospy__[:get_namespace ]()
0 commit comments