Periodic and NonPeriodic for transferring data

Hello everyone,

I have 3 Components:

1.- Component1 - Collect Data - Periodic
2.- Component2 - Process Data - NonPeriodic
3.- Component3 - Send Data - Periodic

When Component1 collects all the data, it has to activate a Trigger, so that Component2 will activate.

Once all the data is processed, Data can be sent, but instead of send it all at once, it has to be sent in a periodic way using Component3.

After doing the first round, Component2 has to keep on waiting the Trigger (Component1 never stops collecting data), but Component3 has to continue sending the data (the previous cycle processed data).
Component3's updateHook is always looking if the Processed Data is new data (every updateHook checks the ports).

My question are:

1.- How can I configure the trigger, so that Component2 starts working after Component1 finished the data collection?

2.- Component3 can not begin its execution until the first periodic is reached (after Component2 finishes the first data processing), but once the first period it is done, it has to be a periodic task.
So it has to work like a periodic task with a delay.

Thanks in advance,

Iker

Periodic and NonPeriodic for transferring data

On Sunday 11 January 2009 18:42:51 iker [..] ... wrote:
> Hello everyone,
>
> I have 3 Components:
>
> 1.- Component1 - Collect Data - Periodic
> 2.- Component2 - Process Data - NonPeriodic
> 3.- Component3 - Send Data - Periodic
>
> When Component1 collects all the data, it has to activate a Trigger, so
> that Component2 will activate.

So 2 needs to be a peer of 1, such that 1 can trigger it.

>
> Once all the data is processed, Data can be sent, but instead of send it
> all at once, it has to be sent in a periodic way using Component3.

So you'll need a buffer port between 2 and 3.

>
> After doing the first round, Component2 has to keep on waiting the Trigger
> (Component1 never stops collecting data), but Component3 has to continue
> sending the data (the previous cycle processed data). Component3's
> updateHook is always looking if the Processed Data is new data (every
> updateHook checks the ports).
>
> My question are:
>
> 1.- How can I configure the trigger, so that Component2 starts working
> after Component1 finished the data collection?

In RTT 1.6, you need to make 2 a peer of 1 and call (gasp):
peer->engine()->getActivity()->trigger() ; // code in 1's updatehook
Each time you want 2 to wake up.

In RTT 1.8, we have event driven data ports, which allow 2 to wake up each
time 1 wrote data.

>
> 2.- Component3 can not begin its execution until the first periodic is
> reached (after Component2 finishes the first data processing), but once the
> first period it is done, it has to be a periodic task. So it has to work
> like a periodic task with a delay.

This is a matter of taste. We don't allow switching between periodic and non-
periodic yet (you could write such an activity if you felt like it though). If
I were you, I would just poll and return from updateHoke() if there's no new
data. Otherwise, create an event which 2 will emit when data is ready, 3
subscribes to it and calls this->start() in the event handler. This would have
again been easier with 1.8-like event data ports.

Peter

Periodic and NonPeriodic for transferring data

I solved my problems with Component3.

I am using orocos 1.4.1 (now it is not the best moment for me to change version of orocos).

In your reply, you mention: In RTT 1.6, you need to make 2 a peer of 1 and call (gasp):
peer->engine()->getActivity()->trigger() ; // code in 1's updatehook

My question is how do I make 2 a peer of 1?

Iker

connectPeers

see the RTT manual:
http://people.mech.kuleuven.be/~orocos/pub/stable/documentation/rtt/v1.4.x/doc-xml/orocos-components-manual.html

section 4: Setting up the Execution Flow

Theo.

connectPeers

Hi,

What is the reason that connectPeers fails if there is already a
uni-directional connection between the two Peers?

One consequence of this is that you can't use connectPeers to connect "form
a component to the Deployer".

Bert

Can a Task be dependent of

Can a Task be dependent of 2 triggers? If the answer is true I can use it.

RE: Can a Task be dependent of

> -----Original Message-----
> From: orocos-dev-bounces [..] ... [mailto:orocos-dev-
> bounces [..] ...] On Behalf Of iker [..] ...
> Sent: maandag 12 januari 2009 11:31
> To: orocos-dev [..] ...
> Subject: [Orocos-Dev] Can a Task be dependent of
>
> Can a Task be dependent of 2 triggers? If the answer is true I can use
it.
No there is only one trigger to wake up a task. It is the component that
has to decide what to do. You could do this with flags and stuff like
that. But Orocos offers a much better solution. I suggest you use an
Event with asynchronous completion for each trigger. This way the
asynchronous completion triggers the task and the component knows what
to do without checking all sorts of flags.

I hope this is use full for you.

Sander.

Periodic and NonPeriodic for transferring data

On Monday 12 January 2009 09:12:33 Peter Soetens wrote:
>
> In RTT 1.8, we have event driven data ports, which allow 2 to wake up each
> time 1 wrote data.

Just for clarity, RTT 1.8 is not released and is today only available on the
trunk/rtt svn directory.

Peter