[Rock-dev] Create new instances of typelib classes in ruby

Alexander Duda Alexander.Duda at dfki.de
Thu Feb 6 17:01:16 CET 2014


On 02/06/2014 04:43 PM, Christian Rauch wrote:
> Hi,
>
> for comparing values coming from a Syskit::OutputReader with other 
> static values given by a ruby object, I need to get the type returned 
> by the reader.
> If I call #.port.type I get e.g:
> #<Typelib::CompoundType: /base/samples/RigidBodyState_m>
>
> Where do I find these CompoundTypes if I want to create my own objects 
> in ruby (something like 
> Typelib::CompoundType::Base::Samples::RigidBodyState.new())? This also 
> applies if I want to give a sample to a writer without getting the 
> object from #new_sample.
>
> Kind regards,
> Christian
>


sample = Types::Base::Samples::RigidBodyState.new
should do the trick.

for more information please have a look at:
  http://rock-robotics.org/stable/documentation/runtime/ruby_and_types.html

Best regards
Alex


-- 
Dipl.-Ing. Alexander Duda
Unterwasserrobotik
Robotics Innovation Center

Hauptgeschäftsstelle Standort Bremen:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 1
  28359 Bremen, Germany

  Tel.:     +49 421 178 45-6620
  Zentrale: +49 421 178 45-0
  Fax:      +49 421 178 45-4150 (Faxe bitte namentlich kennzeichnen)
  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