For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=488>
Summary: AnalogIn/OutInterface is an atrocity.
Product: RTT
Version: 1.4.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Operating System Abstraction - Portability
AssignedTo: orocos-dev at lists [dot] mech [dot] kuleuven [dot] be
ReportedBy: peter.soetens at fmtc [dot] be
CC: orocos-dev at lists [dot] mech [dot] kuleuven [dot] be
Estimated Hours: 0.0
In contrast to the DigitalIn/OutInterface classes, the AnalogIn/OutInterface
takes a template parameter. Furthermore, the AnalogOutput helper class takes
the same parameter. It was meant to allow the choice between unsigned/signed
int or even float or double as the interface to an IO card with analog in or
out channels.
In reality the drivers return an int, or an unsigned int and uses max 16 bits,
but 12 bits ADC/DAC are more common. The AnalogOutput object allows conversion
between doubles and this integer value. I believe RTT 1.0 should have used
'int' as the data type for communicating with the analog interfaces. This would
have allowed devices with 31 bit unsigned int ADC/DAC and 32bit signed ADC/DAC,
far more than necessary.
Usercode would have changed from:
AnalogOutInterface<unsigned int>* maout = AnalogOutInterface<unsigned
int>::nameserver.getObject("Ana_Out");
AnalogOutput<unsigned int> output(maout, ANA_CHANNEL); output.value( v ); // in volts.
to:
AnalogOutInterface* maout =
AnalogOutInterface::nameserver.getObject("Ana_Out");
AnalogOutput output(maout, ANA_CHANNEL); output.value( v ); // in volts.
Which is consistent with the DigitalIn/OutInterface.
I don't have any idea how to solve this with respect to backwards
compatibility, since these classes also appear in user code.

[Bug 488] AnalogIn/OutInterface is an atrocity.
For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=488>
Peter Soetens <peter.soetens at fmtc [dot] be> changed:
What |Removed |Added -------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|orocos- |peter.soetens@fmtc.be |dev@lists.mech.kuleuven.be |--- Comment #1 from Peter Soetens <peter.soetens at fmtc [dot] be> 2008-03-17 10:51:49 ---Created an attachment (id=252)
removes the template parameter from RTT classes.
This patch removes the template parameter and assumes that 'int' is used to
read/write to channels.
Only the resolution is an unsigned int, all the other functions use 'int'.
This patch does not fix the OCL Comedi classes.