Writing direct a value to a InputPort on the c++ instance (without connecting)

I searching to a easy way to write a value to a RTT::InputPort.
My use-case is that i want to have a initial value on a input port once
(like a default value).
This value is specified on the orogen-leven, and then passed to c++
generator.

The question is now, how can i easily write a value (once) to the under
laying port instance.
Do i really need to create a output_port, connect these ports, write to
the ouput_port, or is there a more easy way to fill the buffer with one
sample?

Greetings,
Matthias

Ruben Smits's picture

Writing direct a value to a InputPort on the c++ instance (witho

On Mon, Nov 11, 2013 at 10:10 AM, Matthias Goldhoorn
<matthias [dot] goldhoorn [..] ...> wrote:
> I searching to a easy way to write a value to a RTT::InputPort.
> My use-case is that i want to have a initial value on a input port once
> (like a default value).
> This value is specified on the orogen-leven, and then passed to c++
> generator.
>
> The question is now, how can i easily write a value (once) to the under
> laying port instance.
> Do i really need to create a output_port, connect these ports, write to
> the ouput_port, or is there a more easy way to fill the buffer with one
> sample?

Could you use setDataSample function, or does this not cover your use-case?

Ruben

> Greetings,
> Matthias
>
> --
> Dipl.-Inf. Matthias Goldhoorn
> Space and Underwater Robotic
>
> Universität Bremen
> FB 3 - Mathematik und Informatik
> AG Robotik
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Tel.: +49 421 178 45-4193
> Zentrale: +49 421 178 45-6550
> Fax: +49 421 178 45-4150
> E-Mail: matthias [dot] goldhoorn [..] ...
>
> Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Writing direct a value to a InputPort on the c++ instance (witho

On 11/11/2013 10:10 AM, Matthias Goldhoorn wrote:
> I searching to a easy way to write a value to a RTT::InputPort.
> My use-case is that i want to have a initial value on a input port once
> (like a default value).
> This value is specified on the orogen-leven, and then passed to c++
> generator.
>
> The question is now, how can i easily write a value (once) to the under
> laying port instance.
> Do i really need to create a output_port, connect these ports, write to
> the ouput_port, or is there a more easy way to fill the buffer with one
> sample?
If you can depend on the rock toolchain, I would just make the Ruby
layer create an input writer and write the sample once.