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 22
33using Compat
44import Compat: String, Symbol
5+ using PyCall
56
67export @rosimport , rostypegen, rostypereset
78
@@ -633,6 +634,11 @@ function _get_rospy_class(typ::DataType)
633634 rospycls
634635end
635636
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+
636642_jl_safe_name (name:: AbstractString , suffix) = _nameconflicts (name) ?
637643 string (name,suffix) :
638644 name
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ pypose = convert(PyObject, posestamp)
4848@test pypose[:pose ][:position ][:x ] == 1.
4949@test pypose[:pose ][:position ][:y ] == 2.
5050@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.
5155pose2 = convert (geometry_msgs. msg. PoseStamped, pypose)
5256@test pose2. pose. position. x == 1.
5357@test pose2. pose. position. y == 2.
You can’t perform that action at this time.
0 commit comments