[Rock-dev] No memory layout for Vector3d when passing base/Position or base/Vector3d

Leif Christensen leif.christensen at dfki.de
Tue Oct 1 15:15:01 CEST 2013


Hi,

I have a callback function foo that awaits two arguments:

> #include <base/Pose.hpp>
> #include <base/Eigen.hpp>
> ...
> void foo(base::Position, base::Vector3d);
> ...

When I try to call the function from a ruby script, the script fails:

> pos = Types::Base::Position.new(0,0,0)
> vec = Types::Base::Vector3d.new(1,1,0)
> foo(pos,vec)

> -- Ruby level backtrace information ----------------------------------------
> test_vf3d.rb:23:in `<main>'
> test_vf3d.rb:23:in `method_missing'

Pretty printing pos and vec, it seems type is some Ruby type Vector3:

> Vector3(0.0, 0.0, 0.0)
> Vector3(5.0, 1.0, 0.0)

Using

> pos = Orocos.registry.get("base/Position").new

yields

> /home/leifole/dev/rock/smallrock/install/lib/ruby/1.9.1/typelib/type.rb:479:in `value_new': internal error: there is no memory layout for type /base/Vector3d: is an opaque type (ArgumentError)

For now, I just defined another foo(double, double, double, double,
double, double) and fetch the arguments from Position and Vector3d
manually, but that seems awkward. I want to pass Position and Vector3d
directly.

So: any ideas how to pass base/Position and base/Vector3d from a ruby
script to the callback directly?

LG,
Leif
-- 
 Leif Christensen

 DFKI Bremen
 Robotics Innovation Center
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Phone: +49 (0)421 17845-4149
 Fax:   +49 (0)421 17845-4150
 E-Mail: leif.christensen at dfki.de

 Weitere Informationen: http://www.dfki.de/robotik
 -----------------------------------------------------------------------
 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
 Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
 Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
 (Vorsitzender) Dr. Walter Olthoff
 Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
 Amtsgericht Kaiserslautern, HRB 2313
 Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
 USt-Id.Nr.:    DE 148646973
 Steuernummer:  19/673/0060/3
 -----------------------------------------------------------------------



More information about the Rock-dev mailing list