[orocosusers] Reading Data from Orocos Component in an External thread

Hi,

I want to read Data from an Orocos component but in an External Thread.
The Environment will have N number of components then I want to get all the
data on all the output port and read them out of Orocos in a c++
application.

What I did is to create an Orocos component which is dynamically in the
configuration hook will create and an event port for each output port of
all the components which is running under the same deployer and make a
connection with them, then create an Attribute for each port and update the
attribute value with each port event.

Now I am trying to read this attributes in my c++ thread outside of Orocos.
BUT...
can not make it dynamic to read like what I did in the component, since I
have to create an attribute with the same data type to be able to get the
value.
Also I am not sure if it will be thread safe or not, but I saw a comment
saying read/write for attributes is not thread safe.

What is the most efficient here, should I read direct from the input ports
in my external thread? or there is another solution?

Thanks,
Aladdin

[orocosusers] Know if a port data is new without reading the por

Hi all,

The title says it all: is there a way to know whether a port's data was changed without reading the data?

The data type of the port is std::vector<double> and can be rather heavy (e.g. multiple of 10k entries...). In my update() function I read the port to know whether it has changed, this makes the approach heavy...

Thanks,

Antoine.

[orocosusers] Know if a port data is new without reading the por

Hi Antoine,

I am not sure if there is a way to know if the data on the port is new or
not without reading.
But,,
I had the same issue before and my solution was by changing my input port
to be event port. In that case I can read the data on this port only when
it's triggered.

Aladdin,

On Sep 8, 2016 5:44 AM, "Antoine Rennuit" <
antoine [dot] rennuit [..] ...> wrote:

> Hi all,
>
>
> The title says it all: is there a way to know whether a port's data was
> changed without reading the data?
>
>
> The data type of the port is std::vector<double> and can be rather heavy
> (e.g. multiple of 10k entries...). In my update() function I read the port
> to know whether it has changed, this makes the approach heavy...
>
>
> Thanks,
>
>
> Antoine.
>

[orocosusers] Know if a port data is new without reading the por

Hello Aladdin,

I can see the benefit of your solution in some cases indeed. For the other cases I have just realized that there is a 2nd argument to the port reading function which states whether data which is old should be copied or not (default value is true), thus brings some flexibility (and solved my problem).

Thanks,

Antoine Rennuit
Les Companions
Project awarded the BPI i-Lab prize
Project awarded the High Potential status at NFID
T +33.6.72.05.98.86
M are [..] ...
A euratechnologies, 165 ave de Bretagne, 59800 Lille
www.lescompanions.com
euratechnologies Lille (France) | APUI? incubateur Douai (France)

-------- Original message --------
From: "AlaaEldeen, AbdAlrahman"
Date:08/09/2016 01:50 (GMT+01:00)
To: OROCOSUSERS [..] ...
Subject: Re: [orocosusers] Know if a port data is new without reading the port

Hi Antoine,

I am not sure if there is a way to know if the data on the port is new or not without reading.
But,,
I had the same issue before and my solution was by changing my input port to be event port. In that case I can read the data on this port only when it's triggered.

Aladdin,

On Sep 8, 2016 5:44 AM, "Antoine Rennuit" <antoine [dot] rennuit [..] ...antoine [dot] rennuit [..] ...>> wrote:

Hi all,

The title says it all: is there a way to know whether a port's data was changed without reading the data?

The data type of the port is std::vector<double> and can be rather heavy (e.g. multiple of 10k entries...). In my update() function I read the port to know whether it has changed, this makes the approach heavy...

Thanks,

Antoine.