[Rock-dev] Asynchronous method to write on InputPorts

Javier Hidalgo Carrió javier.hidalgo_carrio at dfki.de
Wed May 21 13:29:01 CEST 2014


Hi,

I am trying to write information in an Input port using the 
Orocos::Async interface in ruby.
My question is how to access to an Input port in an asynchronous manner, 
in a similar way when using the "blocking/non-async" method.

I am trying the following

locomotion_control = Orocos::Async.proxy 'locomotion_control'
locomotion_control.on_reachable do
                 motion_cmd = Types::Base::Commands::Motion2D.new
                 motion_cmd.translation = translation
                 motion_cmd.rotation =  rotation
                 port = locomotion_control.port('motion_command')
                 port.write(motion_cmd)
end

But the write method is expecting another type. Does anyone know how to 
do it?
the write method expect something like:

  def write(sample,&block)
             if block
     [...]
end


Thanks,

Javier.



More information about the Rock-dev mailing list