AnalogDrive Class Reference

A AnalogDrive Object converts a physical unit (position, torque,. More...

#include <AnalogDrive.hpp>

List of all members.

Public Member Functions

 AnalogDrive (AnalogOutput *an_out, DigitalOutput *dig_out, double _scale=1.0, double _offset=0.0)
 Construct an Analog Drive object and aggregate an_out and dig_out.
bool enableDrive ()
 Enable the drive.
bool disableDrive ()
 Disable the drive.
DigitalOutput * getEnable ()
bool isEnabled () const
void addOffset (double addoffset)
 add an offset to the current offset
double getOffset ()
 get the current offset
void limit (double lower, double higher, const Event< void(std::string)> &ev)
 Limit the velocity of the drive.
bool driveSet (double v)
 Sets a new velocity.
double driveGet () const
 Returns the current drive velocity.
double maxDriveGet () const
 Returns the maximum drive velocity without limitations.
double minDriveGet () const
 Returns the minimum drive velocity without limitations.

Protected Attributes

AnalogOutput * analogDevice
DigitalOutput * enableDevice
double mySpeed
double scale
double offset
double lowvel
double highvel
Event< void(std::string)> event

Detailed Description

A AnalogDrive Object converts a physical unit (position, torque,.

..) to an analog output. It can also be enabled.

Uses an analog output which is connected to a hardware drive with position/velocity/acceleration/torque control and the enabling of the drive through a digital output.

Definition at line 56 of file AnalogDrive.hpp.

Constructor & Destructor Documentation

AnalogDrive ( AnalogOutput *  an_out,
DigitalOutput *  dig_out,
double  _scale = 1.0,
double  _offset = 0.0 
) [inline]

Construct an Analog Drive object and aggregate an_out and dig_out.

The voltage sent to the AnalogOutput is calculated as :

         * volt = (setpoint + offset)/scale

Example for a velocity drive :

         * scale = 10 mm/s/Volt
         * offset = 5
         * velocity = X
         * output   = Y
         *  Y Volt = ( - X (mm/s) + 5 (mm/s) )/ ( 10 ( mm/s/ Volt ) )
_scale The scale of unit per volt such that unit = volt * _scale
_offset The offset to be added to the unit such that new_unit = vel + offset

Definition at line 81 of file AnalogDrive.hpp.

References AnalogDrive::disableDrive(), and AnalogDrive::driveSet().

The documentation for this class was generated from the following file:
Generated on Thu Dec 23 15:05:28 2010 for OrocosComponentLibrary by  doxygen 1.6.3