[Rock-dev] Periodic and port_driven Task
Christian Rauch
Christian.Rauch at dfki.de
Thu Oct 24 12:01:21 CEST 2013
Hi,
to enable the periodic triggering of the updateHook in port_driven
tasks, the updateHook is triggered manually in an additional thread that
is started in the startHook:
void Task::watchdog() {
mWatchdogRun = true;
while(mWatchdogRun) {
mEnableTrigger = true;
try {
boost::this_thread::sleep(boost::posix_time::seconds(mTimeout.toSeconds()));
}
catch(boost::thread_interrupted interrupt) {
mEnableTrigger = false;
}
if(mEnableTrigger) {
this->getActivity()->trigger();
}
}
LOG_INFO_S<<"Watchdog closed";
}
The boost:thread::interrupt() then needs to be called if there is no new
data on any of the port_driven ports.
I would like to know, if there are any concerns to do this manually that
way. What happens if the updateHook gets called again, before the first
one is finished? What happens with the data on the output ports?
Regards,
Christian
Am 22.10.2013 09:37, schrieb Sylvain Joyeux:
> On 10/21/2013 07:32 PM, Christian Rauch wrote:
>> Hi,
>>
>> how can I set a task to be periodic and port_driven at the same time?
>> E.g., having the updateHook executed periodically and additional in
>> between, when new samples arrive.
> Not possible, see the comment just before "C++ task implementation" in
> http://rock-robotics.org/stable/documentation/orogen/triggering/periodic.html
>
>
> --
> Sylvain Joyeux (Dr.Ing.)
> Senior Researcher
>
> Space & Security Robotics
> Underwater Robotics
>
> !!! Achtung, neue Telefonnummer!!!
>
> Standort Bremen:
> DFKI GmbH
> Robotics Innovation Center
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Phone: +49 (0)421 178-454136
> Fax: +49 (0)421 218-454150
> E-Mail:robotik at dfki.de
>
> Weitere Informationen:http://www.dfki.de/robotik
> -----------------------------------------------------------------------
> Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
> Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
> Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
> (Vorsitzender) Dr. Walter Olthoff
> Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
> Amtsgericht Kaiserslautern, HRB 2313
> Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
> USt-Id.Nr.: DE 148646973
> Steuernummer: 19/673/0060/3
> -----------------------------------------------------------------------
>
--
Christian Rauch
Space Robotics
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel: +49 (0)421 178 45-6619
Empfang: +49 (0)421 178 45-6611
Fax: +49 (0)421 178 45-4150
E-Mail: Christian.Rauch at dfki.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
More information about the Rock-dev
mailing list