[Bug 874] New: Values written to port aren't visible in the TaskBrowser.

http://bugs.orocos.org/show_bug.cgi?id=874

Summary: Values written to port aren't visible in the
TaskBrowser.
Product: Toolchain
Version: master
Platform: i386 Compatible
OS/Version: GNU/Linux
Status: NEW
Severity: major
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: paul [dot] chavent [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Created attachment 704
--> http://bugs.orocos.org/attachment.cgi?id=704
Use case.

I'am not sure of this bug (is it a bug, is it rtt, is it ocl) ?

But here is a use case where i periodicaly write to an output port and can't
see the value in the deployer.

I have the 2.4.0 version (which seems to be the same that the current master
branch).

[Bug 874] Values written to port aren't visible in the TaskBrows

http://bugs.orocos.org/show_bug.cgi?id=874

Chavent Paul <paul [dot] chavent [..] ...> changed:

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

[Bug 874] Values written to port aren't visible in the TaskBrows

http://bugs.orocos.org/show_bug.cgi?id=874

--- Comment #1 from Johannes Meyer <meyer [..] ...> 2011-08-17 22:12:20 CEST ---
Created attachment 728
--> http://bugs.orocos.org/attachment.cgi?id=728
taskbrowser: evaluate DataSource for an OutputPort before printing

Hi everybody,

I also have this problem since 2.4. I am using the precompiled binaries from
the orocos_toolchain_ros stack. I tried to follow the code from the point where
the TaskBrowser wants to print the last written value of port. Here is my
conclusion:

The TaskBrowser calls the OutputPort's getDataSource() method, which creates a
temporary DataObjectDataSource and then the streaming operator for
DataSourceBase::shared_ptr is called to print the current value. The call is
forwarded to the write method of the appropriate TypeInfo object. The write
method implemented in the TemplateTypeInfo class does not evaluate the
DataSource, but just print its current value. But the temporary
DataObjectDataSource object created in the first step only holds an
uninitialized copy and never got evaluated and therefore the true last written
value can never be printed correctly!

There are at least 2 possible solutions:
a) modify the Taskbrowser and call the evaluate() method on the temporary
DataSource before printing (only for OutputPorts or also for other type of
objects?)
b) evaluate the DataSource in any other step involved. E.g. evaluating a
DataSource before printing in the TemplateTypeInfo::write() method seems to be
a good idea to me?

I have created and attached a patch according to solution a) that fixes the
problem for me.

Best, Johannes