Re: A little doubt of methodology

Leopold Palomo-Avellaneda <[email protected]> Mon, 21 May 2007 17:13:25 +0200
Newsgroups gmane.science.robotics.orocos.user
Message-ID <[email protected]>
A Dilluns 21 Maig 2007 14:26, Peter Soetens va escriure:
> On Monday 21 May 2007 11:32:37 Leopold Palomo-Avellaneda wrote:
> > Dear people,
> >
> > I have a little doubt. I'm developing a program that use the network. So,
> > the idea is to have a task that listen the socket. When I create the
> > task, this task is a periodic task, and an x miliseconds a run the task,
> > or a nonpeeriodic task, and when the socket receive some data, then this
> > emits something through the data port?
>
> Even if your data packets come in periodically, it won't work well using a
> periodic task, as the sender will not have the exact period as the
> receiving task (due to clock drift). Hence, your receiver is better non
> periodic and blocks on the socket for new data.

Normal ....

> In RTT 1.2.0, there is better support for these cases. The discussion was
> held here: <https://www.fmtc.be/orocos-bugzilla/show_bug.cgi?id=353>,
> you'll need to use the discussed trigger() function as well.

Ok, 

so reading the thread I understand that I have to create a nonPeriodicTask 
(yes, bad name, but ...) and then the in the update function put the recv 
command of the networks, no?


void update()
 {
    // ... here comes my algorithm...
    //....

   // ex.	ret = rt_dev_recv(sockfd, msg, sizeof(msg), 0);

    // if some condition is met:
    this->getActivity()->trigger();
 }


Regards,

Leo
-- 
Orocos mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos