File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
using Compat
4
4
import Compat: String, Symbol
5
+ using PyCall
5
6
6
7
export @rosimport , rostypegen, rostypereset
7
8
@@ -633,6 +634,11 @@ function _get_rospy_class(typ::DataType)
633
634
rospycls
634
635
end
635
636
637
+ # Overwrite PyCall's default constructor to call the `convert` functions generated here
638
+ PyCall. PyObject (m:: AbstractMsg ) = convert (PyCall. PyObject, m)
639
+ PyCall. PyObject (s:: AbstractSrv ) = convert (PyCall. PyObject, s)
640
+ PyCall. PyObject (s:: AbstractService ) = convert (PyCall. PyObject, s)
641
+
636
642
_jl_safe_name (name:: AbstractString , suffix) = _nameconflicts (name) ?
637
643
string (name,suffix) :
638
644
name
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ pypose = convert(PyObject, posestamp)
48
48
@test pypose[:pose ][:position ][:x ] == 1.
49
49
@test pypose[:pose ][:position ][:y ] == 2.
50
50
@test pypose[:pose ][:position ][:z ] == 3.
51
+ pypose2 = PyObject (posestamp)
52
+ @test pypose2[:pose ][:position ][:x ] == 1.
53
+ @test pypose2[:pose ][:position ][:y ] == 2.
54
+ @test pypose2[:pose ][:position ][:z ] == 3.
51
55
pose2 = convert (geometry_msgs. msg. PoseStamped, pypose)
52
56
@test pose2. pose. position. x == 1.
53
57
@test pose2. pose. position. y == 2.
You can’t perform that action at this time.
0 commit comments