[Bug 785] New: Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Summary: Trigger mechanism does not work
Product: Toolchain
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: ruben [dot] smits [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

I have a component which is supposed to trigger itself, and should be executed
by a non-periodic activity:

bool startHook(){
return this->trigger();
}
 
void updateHook(){
log(Info)<<"Print something"<<endlog();
this->trigger();
}

The component seems to be running from the TaskBrowsers pov:

In Task Robot[R]
</code.
 
but nothing seems to be printed, is happening? The mechanism worked perfectly
in RTT 1.10 but seems to be broken in RTT 2.0.x
 
Ruben

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #3 from Peter Soetens <peter [..] ...> 2010-10-22 10:43:27 ---
This bug was fixed with commit 939a7086ab2e1bfb9c4c47ca226edd421d7c66eb and fix
was part of the 2.1.0 release.

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

--- Comment #2 from Peter Soetens <peter [..] ...> 2010-10-11 15:02:10 ---
(In reply to comment #1)
> (In reply to comment #0)
> > I have a component which is supposed to trigger itself, and should be executed
> > by a non-periodic activity:
> >
> >

> > bool startHook(){
> > return this->trigger();
> > }
> >
> > void updateHook(){
> > log(Info)<<"Print something"<<endlog();
> > this->trigger();
> > }
> > 

> >
> > The component seems to be running from the TaskBrowsers pov:
> >
> > In Task Robot[R]
> > </code.
> >
> > but nothing seems to be printed, is happening? The mechanism worked perfectly
> > in RTT 1.10 but seems to be broken in RTT 2.0.x
> 
> What happens if you call trigger() from within the TB ?
> 
> How was start() called ? By the Deployer ?
> 
> The initial trigger() in startHook() is too soon in order to have updateHook()
> called. So the EE will execute, but not call updateHook.
> 
> If this is your case, we need to adapt the deployer such that it calls the start
> Operation instead of the start() C++ function. We could still force a trigger()
> in the start() function to support the C++ case.
 
Correction: this is only true if start() is an OwnThread operation. If it is
tagged as
ClientThread (which it is by default), the TC will not be triggered. This
effectively rules out calling trigger()
from startHook(), which is a serious regression.
 
I'll have to adapt the TaskCore + EE to handle this case.
 
Peter

[Bug 785] Trigger mechanism does not work

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=785

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |peter [..] ...

--- Comment #1 from Peter Soetens <peter [..] ...> 2010-10-11 14:41:24 ---
(In reply to comment #0)
> I have a component which is supposed to trigger itself, and should be executed
> by a non-periodic activity:
>
>

> bool startHook(){
> return this->trigger();
> }
> 
> void updateHook(){
> log(Info)<<"Print something"<<endlog();
> this->trigger();
> }
> 

>
> The component seems to be running from the TaskBrowsers pov:
>
> In Task Robot[R]
> </code.
> 
> but nothing seems to be printed, is happening? The mechanism worked perfectly
> in RTT 1.10 but seems to be broken in RTT 2.0.x
 
What happens if you call trigger() from within the TB ?
 
How was start() called ? By the Deployer ?
 
The initial trigger() in startHook() is too soon in order to have updateHook()
called. So the EE will execute, but not call updateHook.
 
If this is your case, we need to adapt the deployer such that it calls the
start Operation instead of the start() C++ function. We could still force a
trigger() in the start() function to support the C++ case.
 
This is really an interesting exercise: since start() is an operation, it can
be configured to be executed in ClientThread or OwnThread. Calling plain
C++->start() ignores this choice. On the other hand, going through the
OperationInterface will respect that choice. So the real bug is in the
deployer, but other legacy code assuming TaskContext::start() will cause
updateHook() to be called will be in trouble too.
 
Peter