@@ -8,7 +8,7 @@ export @rosimport, rostypegen, rostypereset, gentypes, cleartypes
88# Type definitions
99# Composite types for internal use. Keeps track of the imported types and helps
1010# keep code generation orderly.
11- abstract ROSModule
11+ @compat abstract type ROSModule end
1212type ROSPackage
1313 name:: String
1414 msg:: ROSModule
@@ -33,7 +33,7 @@ type ROSSrvModule <: ROSModule
3333 ROSSrvModule (pkg) = new (pkg, String[], Set {String} ())
3434end
3535
36- # These two global objects maintain the hierarchy from multiple calls to
36+ # These global objects maintain the hierarchy from multiple calls to
3737# `@rosimport` and keep the link to the Python objects whenever communication
3838# goes between RobotOS and rospy.
3939const _rospy_imports = Dict {String,ROSPackage} ()
@@ -61,9 +61,9 @@ const _ros_builtin_types = Dict{String, Symbol}(
6161 )
6262
6363# Abstract supertypes of all generated types
64- abstract MsgT
65- abstract SrvT
66- abstract ServiceDefinition
64+ @compat abstract type AbstractMsg end
65+ @compat abstract type AbstractSrv end
66+ @compat abstract type AbstractService end
6767
6868# Rearranges the expression into a RobotOS._rosimport call. Input comes in as a
6969# single package qualified expression, or as a tuple expression where the first
@@ -317,15 +317,15 @@ end
317317
318318# The imports specific to each module, including dependant packages
319319function _importexprs (mod:: ROSMsgModule )
320- imports = Expr[Expr (:import , :RobotOS , :MsgT )]
320+ imports = Expr[Expr (:import , :RobotOS , :AbstractMsg )]
321321 othermods = filter (d -> d != _name (mod), mod. deps)
322322 append! (imports, [Expr (:using ,Symbol (m),:msg ) for m in othermods])
323323 imports
324324end
325325function _importexprs (mod:: ROSSrvModule )
326326 imports = Expr[
327- Expr (:import , :RobotOS , :SrvT ),
328- Expr (:import , :RobotOS , :ServiceDefinition ),
327+ Expr (:import , :RobotOS , :AbstractSrv ),
328+ Expr (:import , :RobotOS , :AbstractService ),
329329 Expr (:import , :RobotOS , :_srv_reqtype ),
330330 Expr (:import , :RobotOS , :_srv_resptype ),
331331 ]
@@ -362,7 +362,7 @@ function buildtype(mod::ROSMsgModule, typename::String)
362362 memtypes = pyobj[:_slot_types ]
363363 members = collect (zip (memnames, memtypes))
364364
365- typecode (fulltypestr, :MsgT , members)
365+ typecode (fulltypestr, :AbstractMsg , members)
366366end
367367
368368# All the generated code for a generated service type
@@ -376,21 +376,21 @@ function buildtype(mod::ROSSrvModule, typename::String)
376376 memtypes = reqobj[:_slot_types ]
377377 reqmems = collect (zip (memnames, memtypes))
378378 pyreq = :(RobotOS. _rospy_objects[$ req_typestr])
379- reqexprs = typecode (req_typestr, :SrvT , reqmems)
379+ reqexprs = typecode (req_typestr, :AbstractSrv , reqmems)
380380
381381 resp_typestr = _rostypestr (mod, string (typename," Response" ))
382382 respobj = _rospy_objects[resp_typestr]
383383 memnames = respobj[:__slots__ ]
384384 memtypes = respobj[:_slot_types ]
385385 respmems = collect (zip (memnames, memtypes))
386386 pyresp = :(RobotOS. _rospy_objects[$ resp_typestr])
387- respexprs = typecode (resp_typestr, :SrvT , respmems)
387+ respexprs = typecode (resp_typestr, :AbstractSrv , respmems)
388388
389389 defsym = Symbol (typename)
390390 reqsym = Symbol (string (typename," Request" ))
391391 respsym = Symbol (string (typename," Response" ))
392392 srvexprs = Expr[
393- :(immutable $ defsym <: ServiceDefinition end ),
393+ :(immutable $ defsym <: AbstractService end ),
394394 :(_typerepr (:: Type{$defsym} ) = $ (_rostypestr (mod,typename))),
395395 :(_srv_reqtype (:: Type{$defsym} ) = $ reqsym),
396396 :(_srv_resptype (:: Type{$defsym} ) = $ respsym),
@@ -411,8 +411,8 @@ function typecode(rosname::String, super::Symbol, members::Vector)
411411
412412 # generated code should not conflict with julia built-ins
413413 # some messages need renaming
414- suffix = if super == :MsgT ; " Msg"
415- elseif super == :SrvT ; " Srv"
414+ suffix = if super == :AbstractMsg ; " Msg"
415+ elseif super == :AbstractSrv ; " Srv"
416416 else ; " ROS" end
417417 jlsym = Symbol (_jl_safe_name (tname,suffix))
418418
0 commit comments