[Rock-dev] Double being passed as class to ruby...

Alexander Duda Alexander.Duda at dfki.de
Tue Dec 6 18:58:23 CET 2011


On Tue, 2011-12-06 at 18:22 +0100, Sylvain Joyeux wrote:
> On 12/06/2011 06:14 PM, Patrick Merz Paranhos wrote:
> > Orogen file:
> >
> > output_port('linear_vel', 'double')
> >
> > Ruby script:
> >
> > estimator.linear_vel.connect_to :type => :buffer,:size => 10000
> > do|data,name| pp data
> >
> > value = data
> >
> > value = value + 1
> > pp value
> > data
> > end
> >
> > Output:
> >
> > Orogen file:
> >
> > output_port('linear_vel', 'double')
> >
> > Ruby script:
> >
> > estimator.linear_vel.connect_to :type => :buffer,:size => 10000
> > do|data,name| pp data
> >
> > value = data
> >
> > value = value + 1
> > pp value
> > data
> > end
> 
> Could you add "pp data.class" just after "pp data" and send the result ?

The returned class is: #<Typelib::NumericType: /double> to get the ruby
value someone could call to_ruby for now. The funny part is that typelib
is handling properties of that type right.

Alex


-- 
Dipl.-Ing. Alexander Duda 
Unterwasserrobotik

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

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda 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