@@ -63,7 +63,7 @@ abstract MsgT
63
63
abstract SrvT
64
64
abstract ServiceDefinition
65
65
66
- # Rearranges the expression into a RobotOS._usepkg call. Input comes in as a
66
+ # Rearranges the expression into a RobotOS._rosimport call. Input comes in as a
67
67
# single package qualified expression, or as a tuple expression where the first
68
68
# element is the same as the single expression case. Most of the code is just
69
69
# error checking that the input takes that form.
@@ -79,10 +79,10 @@ macro rosimport(input)
79
79
@assert isa (t, Symbol) " Type name ($(string (t)) ) not a symbol"
80
80
push! (types, string (t))
81
81
end
82
- return :(_usepkg ($ pkg, $ ismsg, $ types... ))
82
+ return :(_rosimport ($ pkg, $ ismsg, $ types... ))
83
83
else
84
84
pkg, ismsg, typ = _pkgtype_import (input)
85
- return :(_usepkg ($ pkg, $ ismsg, $ typ))
85
+ return :(_rosimport ($ pkg, $ ismsg, $ typ))
86
86
end
87
87
end
88
88
@@ -110,10 +110,10 @@ function _pkgtype_import(input::Expr)
110
110
return ps,msb,ts
111
111
end
112
112
# Import a set of types from a single package
113
- function _usepkg (package:: ASCIIString , ismsg:: Bool , names:: ASCIIString... )
113
+ function _rosimport (package:: ASCIIString , ismsg:: Bool , names:: ASCIIString... )
114
114
global _rospy_imports
115
115
if ! haskey (_rospy_imports, package)
116
- @debug (" Creating new package: " ,package," ." , ismsg ? " msg" : " srv" )
116
+ @debug (" Importing new package: " ,package," ." , ismsg ? " msg" : " srv" )
117
117
_rospy_imports[package] = ROSPackage (package)
118
118
end
119
119
rospypkg = _rospy_imports[package]
@@ -150,6 +150,10 @@ function addtype!(mod::ROSMsgModule, typ::ASCIIString)
150
150
global _rospy_objects
151
151
if ! (typ in mod. members)
152
152
@debug (" Message type import: " , _fullname (mod), " ." , typ)
153
+ if _nameconflicts (typ)
154
+ warn (" Message type '$typ ' conflicts with Julia builtin, " ,
155
+ " will be imported as '$(_jl_safe_name (typ," Msg" )) '" )
156
+ end
153
157
pymod, pyobj = _pyvars (_fullname (mod), typ)
154
158
155
159
deptypes = pyobj[:_slot_types ]
@@ -194,7 +198,8 @@ function _pyvars(modname::ASCIIString, typ::ASCIIString)
194
198
try pymod[typ]
195
199
catch ex
196
200
isa (ex, KeyError) || rethrow (ex)
197
- throw (KeyError (" '$typ ' in package '$modname '" ))
201
+ error (" Message type '$typ ' not found in ROS package '$modname ', " ,
202
+ " check the corresponding @rosimport call" )
198
203
end
199
204
pymod, pyobj
200
205
end
0 commit comments