@@ -245,13 +245,7 @@ function _import_rospy_pkg(package::String)
245
245
throw (ArgumentError (" Improper import call for package: $package " ))
246
246
end
247
247
pypkg = symbol (string (" py_" ,pkg," _" ,ptype))
248
- newimport = try
249
- eval (pypkg)
250
- false
251
- catch
252
- true
253
- end
254
- if newimport
248
+ if ! isdefined (RobotOS, pypkg)
255
249
@debug (" Importing python package: " , package)
256
250
pkgsym, mssym = symbol (pkg), symbol (ptype)
257
251
try
421
415
# Create the core generated expressions for a native Julia message type that has
422
416
# data fields and interchanges with a python counterpart:
423
417
# (1) the 'type ... end' block
424
- # (2) No param outer constructer
418
+ # (2) Default outer constructer with no arguments
425
419
# (3) convert(PyObject, ...)
426
420
# (4) convert(..., o::PyObject)
427
421
function typecode (rosname:: String , super:: Symbol , members:: Vector )
@@ -606,7 +600,7 @@ function _check_array_type(typ::String)
606
600
btype, arraylen
607
601
end
608
602
609
- # Get the ROS name string corresponding to a generated type
603
+ # Get the rospy PyObject corresponding to a generated type
610
604
function _get_rospy_class (typ:: DataType )
611
605
global _rospy_objects
612
606
rospycls =
624
618
625
619
# Check if the type name conflicts with a Julia builtin. Currently this is only
626
620
# some of the messages from the std_msgs.msg package
627
- function _nameconflicts (typename:: String )
628
- try
629
- eval (Base, symbol (typename))
630
- true
631
- catch
632
- false
633
- end
634
- end
621
+ _nameconflicts (typename:: String ) = isdefined (Base, symbol (typename))
635
622
636
623
# Get a default value for any builtin ROS type
637
624
_typedefault {T<:Real} (:: Type{T} ) = zero (T)
0 commit comments