Skip to content

Commit 9e38fdd

Browse files
committed
Drop support for Julia 0.4 and fix Compat.AsyncCondition deprecation warning on 0.6
1 parent c8da41d commit 9e38fdd

File tree

8 files changed

+16
-10
lines changed

8 files changed

+16
-10
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: julia
22
julia:
3-
- 0.4
43
- 0.5
54
- 0.6
65
- nightly

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
julia 0.4
1+
julia 0.5
22
PyCall 1.11.0
33
Compat 0.17.0

src/gentypes.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ macro rosimport(input)
101101
end
102102
end
103103

104+
_get_quote_value(input::QuoteNode) = input.value
105+
_get_quote_value(input::Expr) = (@assert input.head == :quote; input.args[1])
104106
#Return the pkg and types strings for a single expression of form:
105107
# pkg.[msg|srv].type or pkg.[msg|srv]:type
106108
function _pkgtype_import(input::Expr)
@@ -109,7 +111,7 @@ function _pkgtype_import(input::Expr)
109111
@assert input.args[1].head == :(.) "Improper @rosimport input"
110112
p = input.args[1].args[1]
111113
@assert isa(p, Symbol) "Package name ($(string(p))) not a symbol"
112-
m_or_s = input.args[1].args[2].args[1]
114+
m_or_s = _get_quote_value(input.args[1].args[2])
113115
@assert m_or_s in (:msg,:srv) "Improper @rosimport input"
114116
ps = string(p)
115117
msb = m_or_s == :msg
@@ -121,6 +123,10 @@ function _pkgtype_import(input::Expr)
121123
tsym = input.args[2].args[1]
122124
@assert isa(tsym, Symbol) "Type name ($(string(tsym))) not a symbol"
123125
ts = string(tsym)
126+
elseif isa(input.args[2], QuoteNode)
127+
tsym = input.args[2].value
128+
@assert isa(tsym, Symbol) "Type name ($(string(tsym))) not a symbol"
129+
ts = string(tsym)
124130
end
125131
return ps,msb,ts
126132
end
@@ -340,7 +346,7 @@ end
340346
function _importexprs(mod::ROSMsgModule)
341347
imports = Expr[Expr(:import, :RobotOS, :AbstractMsg)]
342348
othermods = filter(d -> d != _name(mod), mod.deps)
343-
append!(imports, [Expr(:using,Symbol(m),:msg) for m in othermods])
349+
append!(imports, [Expr(:using,:Main,Symbol(m),:msg) for m in othermods])
344350
imports
345351
end
346352
function _importexprs(mod::ROSSrvModule)
@@ -350,7 +356,7 @@ function _importexprs(mod::ROSSrvModule)
350356
Expr(:import, :RobotOS, :_srv_reqtype),
351357
Expr(:import, :RobotOS, :_srv_resptype),
352358
]
353-
append!(imports, [Expr(:using,Symbol(m),:msg) for m in mod.deps])
359+
append!(imports, [Expr(:using,:Main,Symbol(m),:msg) for m in mod.deps])
354360
imports
355361
end
356362

src/pubsub.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Subscriber{MsgType<:AbstractMsg}
5353
@debug("Creating <$(string(MT))> subscriber on topic: '$topic'")
5454
rospycls = _get_rospy_class(MT)
5555

56-
cond = Compat.AsyncCondition()
56+
cond = Base.AsyncCondition()
5757
mqueue = _py_ros_callbacks["MessageQueue"](CB_NOTIFY_PTR, cond.handle)
5858
subobj = __rospy__[:Subscriber](ascii(topic), rospycls, mqueue["storemsg"]; kwargs...)
5959

src/services.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type Service{SrvType <: AbstractService}
5858
@debug("Providing <$ST> service at '$name'")
5959
rospycls = _get_rospy_class(ST)
6060

61-
cond = Compat.AsyncCondition()
61+
cond = Base.AsyncCondition()
6262
pysrv = _py_ros_callbacks["ServiceCallback"](CB_NOTIFY_PTR, cond.handle)
6363

6464
srvobj = try

test/pubsub.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#works alongside echonode.py
33
#typegeneration.jl must be run first
44

5-
using geometry_msgs.msg
5+
using .geometry_msgs.msg
66

77
const Nmsgs = 10
88
const rate = 20. #Hz

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Base.Test
2+
using PyCall
23
using RobotOS
34
using Compat
45
RobotOS.debug(true)

test/services.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pubsub.jl must be run first
22

3-
using std_srvs.srv
4-
using nav_msgs.srv
3+
using .std_srvs.srv
4+
using .nav_msgs.srv
55

66
#Set up services
77
const srvcall = ServiceProxy("callme", SetBool)

0 commit comments

Comments
 (0)