[orocosusers] Two consumers of the data

Dear All,

If two components (C1 & C2) read the data coming from another component
(C3.outport) or a ros node (N1.topic), what do I get in the following
situation?

---------

C3.outport connected to C1.inport

C3.outport connected to C2.inport

---------

*in updateHook the condition:*

---------

C1.inport == RTT::NewData

C2.inport == RTT::NewData

---------

Do I get NewData in both components? Or do I get NewData only in the
first component that reads the data? Does it make any difference if data
is coming from N1.topic?

I would say both components get NewData. But I was not entirely certain.

Thanks

Cheers

Keivan

[orocosusers] Two consumers of the data

I'd also like to know more about this one !

Le mer. 21 sept. 2016 à 14:43, Keivan Zavari <keivan [dot] zavari [..] ...> a
écrit :

> Dear All,
>
> If two components (C1 & C2) read the data coming from another component
> (C3.outport) or a ros node (N1.topic), what do I get in the following
> situation?
> ---------
>
> C3.outport connected to C1.inport
>
> C3.outport connected to C2.inport
>
> ---------
>
> *in updateHook the condition:*
>
> ---------
>
> C1.inport == RTT::NewData
>
> C2.inport == RTT::NewData
>
> ---------
>
> Do I get NewData in both components? Or do I get NewData only in the first
> component that reads the data? Does it make any difference if data is
> coming from N1.topic?
>
> I would say both components get NewData. But I was not entirely certain.
>
> Thanks
>
>
> Cheers
>
> Keivan
>
>
> --
Antoine Hoarau
Robotics Eng. - ISIR

[orocosusers] Two consumers of the data

Hi,

there was a long discussion about exactly this question and the data flow
semantics of Orocos in general last year on the developers mailing list:
http://www.orocos.org/forum/rtt/rtt-dev/updated-dataflow-semantics-rtt

We made a design doc with some proposals to add various options to
configure the data flow semantics, including the revival of the shared
connection semantics in Orocos version 1. It also explains the current
state of how things work in RTT 2.x:
https://docs.google.com/document/d/1zDnPPz4SiCVvfEFxYFUZBcVbXKj33
o4KaotpCtXM4E0/edit?usp=sharing

Most of these changes and new features have been implemented and merged
into the toolchain-2.9 branch, but not yet to master. See also the relevant
pull requests on GitHub:
https://github.com/orocos-toolchain/rtt/pull/114
https://github.com/orocos-toolchain/rtt/pull/118

Some documentation and an update of the Orocos Component Builder's Manual
with a condensed version of the initial design doc is still pending,

To answer your question directly, without considering the latest updates in
2.9:

By default all connections (each pair of output and input port) have their
own buffers in RTT v2.x and an OutputPort distributes samples to all
connections, so both input ports C1 and C2 will see them as NewData
independently. For streams things look a bit different as you cannot
connect two ports to the same stream and every stream is served by exactly
one connection. In case of ROS this has has the same effect as
per-connection buffers, but in fact you will end up with two ROS subscriber
instances with separate callbacks and roscpp will take care of mapping the
single subscription to both callbacks.

Cheers
Johannes

On Wed, Sep 21, 2016 at 3:29 PM, Antoine Hoarau <hoarau [dot] robotics [..] ...>
wrote:

> I'd also like to know more about this one !
>
> Le mer. 21 sept. 2016 à 14:43, Keivan Zavari <keivan [dot] zavari [..] ...> a
> écrit :
>
>> Dear All,
>>
>> If two components (C1 & C2) read the data coming from another component
>> (C3.outport) or a ros node (N1.topic), what do I get in the following
>> situation?
>> ---------
>>
>> C3.outport connected to C1.inport
>>
>> C3.outport connected to C2.inport
>>
>> ---------
>>
>> *in updateHook the condition:*
>>
>> ---------
>>
>> C1.inport == RTT::NewData
>>
>> C2.inport == RTT::NewData
>>
>> ---------
>>
>> Do I get NewData in both components? Or do I get NewData only in the
>> first component that reads the data? Does it make any difference if data is
>> coming from N1.topic?
>>
>> I would say both components get NewData. But I was not entirely certain.
>>
>> Thanks
>>
>>
>> Cheers
>>
>> Keivan
>>
>>
>> --
> Antoine Hoarau
> Robotics Eng. - ISIR
>