This class implements initialization and comunication methods to control a generic Pan and Tilt Unit, working in radians.
Definition at line 41 of file CPtuBase.h.
#include <mrpt/hwdrivers/CPtuBase.h>
Public Member Functions | |
virtual | ~CPtuBase () |
Destructor. | |
virtual bool | rangeMeasure ()=0 |
Search limit forward. | |
virtual bool | moveToAbsPos (char axis, double nRad)=0 |
Specification of positions in absolute terms. | |
virtual bool | absPosQ (char axis, double &nRad)=0 |
Query position in absolute terms. | |
virtual bool | moveToOffPos (char axis, double nRad)=0 |
Specify desired axis position as an offset from the current position. | |
virtual bool | offPosQ (char axis, double &nRad)=0 |
Query position in relative terms. | |
virtual bool | maxPosQ (char axis, double &nRad)=0 |
Query max movement limit of a axis in absolute terms. | |
virtual bool | minPosQ (char axis, double &nRad)=0 |
Query min movement limit of a axis in absolute terms. | |
virtual bool | enableLimitsQ (bool &enable)=0 |
Query if exist movement limits. | |
virtual bool | enableLimits (bool set)=0 |
Enable/Disable movement limits. | |
virtual bool | inmediateExecution (bool set)=0 |
With I mode (default) instructs pan-tilt unit to immediately execute positional commands. | |
virtual bool | aWait (void)=0 |
Wait the finish of the last position command to continue accept commands. | |
virtual bool | haltAll ()=0 |
Inmediately stop all. | |
virtual bool | halt (char axis)=0 |
Inmediately stop. | |
virtual bool | speed (char axis, double RadSec)=0 |
Specification of turn speed. | |
virtual bool | speedQ (char axis, double &RadSec)=0 |
Query turn speed. | |
virtual bool | aceleration (char axis, double RadSec2)=0 |
Specification (de/a)celeration in turn. | |
virtual bool | acelerationQ (char axis, double &RadSec2)=0 |
Query (de/a)celeration in turn. | |
virtual bool | baseSpeed (char axis, double RadSec)=0 |
Specification of velocity to which start and finish the (de/a)celeration. | |
virtual bool | baseSpeedQ (char axis, double &RadSec)=0 |
Query velocity to which start and finish the (de/a)celeration. | |
virtual bool | upperSpeed (char axis, double RadSec)=0 |
Specification of velocity upper limit. | |
virtual bool | upperSpeedQ (char axis, double &RadSec)=0 |
Query velocity upper limit. | |
virtual bool | lowerSpeed (char axis, double RadSec)=0 |
Specification of velocity lower limit. | |
virtual bool | lowerSpeedQ (char axis, double &RadSec)=0 |
Query velocity lower limit. | |
virtual bool | reset (void)=0 |
Reset PTU to initial state. | |
virtual bool | save (void)=0 |
Save or restart default values. | |
virtual bool | restoreDefaults (void)=0 |
Restore default values. | |
virtual bool | restoreFactoryDefaults (void)=0 |
Restore factory default values. | |
virtual bool | version (char *nVersion)=0 |
Version and CopyRights. | |
virtual void | nversion (double &nVersion)=0 |
Number of version. | |
virtual bool | powerModeQ (bool transit, char &mode)=0 |
Query power mode. | |
virtual bool | powerMode (bool transit, char mode)=0 |
Specification of power mode. | |
virtual double | status (double &rad)=0 |
Check if ptu is moving. | |
virtual bool | setLimits (char axis, double &l, double &u)=0 |
Set limits of movement. | |
virtual bool | changeMotionDir ()=0 |
virtual int | checkErrors ()=0 |
Check errors, returns 0 if there are not errors or error code otherwise. | |
virtual void | clearErrors ()=0 |
Clear errors. | |
virtual bool | init (const std::string port)=0 |
PTU and serial port initialization. | |
virtual void | close ()=0 |
Close conection with serial port. | |
virtual double | radError (char axis, double nRadMoved)=0 |
To obtains the mistake for use discrete values when the movement is expressed in radians. | |
virtual long | radToPos (char axis, double nRad)=0 |
To obtain the discrete value for a number of radians. | |
virtual double | posToRad (char axis, long nPos)=0 |
To obtain the number of radians for a discrete value. | |
virtual bool | scan (char axis, int wait, float initial, float final, double RadPre)=0 |
Performs a scan in the axis indicated and whit the precision desired. | |
virtual bool | verboseQ (bool &modo)=0 |
Query verbose mode. | |
virtual bool | verbose (bool set)=0 |
Set verbose. | |
virtual bool | echoModeQ (bool &mode)=0 |
Query echo mode. | |
virtual bool | echoMode (bool mode)=0 |
Enable/Disable echo response with command. | |
virtual bool | resolution (void)=0 |
Query the pan and tilt resolution per position moved and initialize local atributes. | |
Public Attributes | |
double | tiltResolution |
double | panResolution |
Protected Attributes | |
CSerialPort | serPort |
Private Member Functions | |
virtual bool | transmit (const char *command)=0 |
To transmition commands to the PTU. | |
virtual bool | receive (const char *command, char *response)=0 |
To receive the responseof the PTU. | |
virtual bool | radQuerry (char axis, char command, double &nRad)=0 |
Used to obtains a number of radians. | |
virtual bool | radAsign (char axis, char command, double nRad)=0 |
Method used for asign a number of radians with a command. |
virtual mrpt::hwdrivers::CPtuBase::~CPtuBase | ( | ) | [inline, virtual] |
Destructor.
Definition at line 60 of file CPtuBase.h.
virtual bool mrpt::hwdrivers::CPtuBase::absPosQ | ( | char | axis, |
double & | nRad | ||
) | [pure virtual] |
Query position in absolute terms.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::aceleration | ( | char | axis, |
double | RadSec2 | ||
) | [pure virtual] |
Specification (de/a)celeration in turn.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::acelerationQ | ( | char | axis, |
double & | RadSec2 | ||
) | [pure virtual] |
Query (de/a)celeration in turn.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::aWait | ( | void | ) | [pure virtual] |
Wait the finish of the last position command to continue accept commands.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::baseSpeed | ( | char | axis, |
double | RadSec | ||
) | [pure virtual] |
Specification of velocity to which start and finish the (de/a)celeration.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::baseSpeedQ | ( | char | axis, |
double & | RadSec | ||
) | [pure virtual] |
Query velocity to which start and finish the (de/a)celeration.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::changeMotionDir | ( | ) | [pure virtual] |
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual int mrpt::hwdrivers::CPtuBase::checkErrors | ( | ) | [pure virtual] |
Check errors, returns 0 if there are not errors or error code otherwise.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual void mrpt::hwdrivers::CPtuBase::clearErrors | ( | ) | [pure virtual] |
Clear errors.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual void mrpt::hwdrivers::CPtuBase::close | ( | ) | [pure virtual] |
Close conection with serial port.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::echoMode | ( | bool | mode ) | [pure virtual] |
Enable/Disable echo response with command.
Example of use (EE supposed): PP * 22 ED * <pp entered again, but not echoed>* 22
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::echoModeQ | ( | bool & | mode ) | [pure virtual] |
Query echo mode.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::enableLimits | ( | bool | set ) | [pure virtual] |
Enable/Disable movement limits.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::enableLimitsQ | ( | bool & | enable ) | [pure virtual] |
Query if exist movement limits.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::halt | ( | char | axis ) | [pure virtual] |
Inmediately stop.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::haltAll | ( | ) | [pure virtual] |
Inmediately stop all.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::init | ( | const std::string | port ) | [pure virtual] |
PTU and serial port initialization.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::inmediateExecution | ( | bool | set ) | [pure virtual] |
With I mode (default) instructs pan-tilt unit to immediately execute positional commands.
In S mode instructs pan-tilt unit to execute positional commands only when an Await Position Command Completion command is executed or when put into Immediate Execution Mode.
Example of use of S mode: DR * S * PP1500 * TP-900 * PP * Current Pan position is 0 TP * Current Tilt position is 0 A * PP * Current Pan position is 1500 TP * Current Tilt position is -900
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::lowerSpeed | ( | char | axis, |
double | RadSec | ||
) | [pure virtual] |
Specification of velocity lower limit.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::lowerSpeedQ | ( | char | axis, |
double & | RadSec | ||
) | [pure virtual] |
Query velocity lower limit.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::maxPosQ | ( | char | axis, |
double & | nRad | ||
) | [pure virtual] |
Query max movement limit of a axis in absolute terms.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::minPosQ | ( | char | axis, |
double & | nRad | ||
) | [pure virtual] |
Query min movement limit of a axis in absolute terms.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::moveToAbsPos | ( | char | axis, |
double | nRad | ||
) | [pure virtual] |
Specification of positions in absolute terms.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::moveToOffPos | ( | char | axis, |
double | nRad | ||
) | [pure virtual] |
Specify desired axis position as an offset from the current position.
This method recives the number of radians to move.
Example of use: TT-500 * A * TO * Current Tilt position is -500 TO500 * A * TT * Current Pan position is 1000
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual void mrpt::hwdrivers::CPtuBase::nversion | ( | double & | nVersion ) | [pure virtual] |
Number of version.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::offPosQ | ( | char | axis, |
double & | nRad | ||
) | [pure virtual] |
Query position in relative terms.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual double mrpt::hwdrivers::CPtuBase::posToRad | ( | char | axis, |
long | nPos | ||
) | [pure virtual] |
To obtain the number of radians for a discrete value.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::powerMode | ( | bool | transit, |
char | mode | ||
) | [pure virtual] |
Specification of power mode.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::powerModeQ | ( | bool | transit, |
char & | mode | ||
) | [pure virtual] |
Query power mode.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::radAsign | ( | char | axis, |
char | command, | ||
double | nRad | ||
) | [private, pure virtual] |
Method used for asign a number of radians with a command.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual double mrpt::hwdrivers::CPtuBase::radError | ( | char | axis, |
double | nRadMoved | ||
) | [pure virtual] |
To obtains the mistake for use discrete values when the movement is expressed in radians.
Parameters are the absolute position in radians and the axis desired
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::radQuerry | ( | char | axis, |
char | command, | ||
double & | nRad | ||
) | [private, pure virtual] |
Used to obtains a number of radians.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual long mrpt::hwdrivers::CPtuBase::radToPos | ( | char | axis, |
double | nRad | ||
) | [pure virtual] |
To obtain the discrete value for a number of radians.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::rangeMeasure | ( | ) | [pure virtual] |
Search limit forward.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::receive | ( | const char * | command, |
char * | response | ||
) | [private, pure virtual] |
To receive the responseof the PTU.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::reset | ( | void | ) | [pure virtual] |
Reset PTU to initial state.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::resolution | ( | void | ) | [pure virtual] |
Query the pan and tilt resolution per position moved and initialize local atributes.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::restoreDefaults | ( | void | ) | [pure virtual] |
Restore default values.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::restoreFactoryDefaults | ( | void | ) | [pure virtual] |
Restore factory default values.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::save | ( | void | ) | [pure virtual] |
Save or restart default values.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::scan | ( | char | axis, |
int | wait, | ||
float | initial, | ||
float | final, | ||
double | RadPre | ||
) | [pure virtual] |
Performs a scan in the axis indicated and whit the precision desired.
<axis> | {Pan or Till} |
<tWait> | {Wait time betwen commands} |
<initial> | {initial position} |
<final> | {final position} |
<RadPre> | {radians precision for the scan} |
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::setLimits | ( | char | axis, |
double & | l, | ||
double & | u | ||
) | [pure virtual] |
Set limits of movement.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::speed | ( | char | axis, |
double | RadSec | ||
) | [pure virtual] |
Specification of turn speed.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::speedQ | ( | char | axis, |
double & | RadSec | ||
) | [pure virtual] |
Query turn speed.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual double mrpt::hwdrivers::CPtuBase::status | ( | double & | rad ) | [pure virtual] |
Check if ptu is moving.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::transmit | ( | const char * | command ) | [private, pure virtual] |
To transmition commands to the PTU.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::upperSpeed | ( | char | axis, |
double | RadSec | ||
) | [pure virtual] |
Specification of velocity upper limit.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::upperSpeedQ | ( | char | axis, |
double & | RadSec | ||
) | [pure virtual] |
Query velocity upper limit.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::verbose | ( | bool | set ) | [pure virtual] |
Set verbose.
Example of response with FV (verbose) active: FV * PP * Current pan position is 0 Example of response with FT (terse) active: FT * PP * 0
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::verboseQ | ( | bool & | modo ) | [pure virtual] |
Query verbose mode.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
virtual bool mrpt::hwdrivers::CPtuBase::version | ( | char * | nVersion ) | [pure virtual] |
Version and CopyRights.
Implemented in mrpt::hwdrivers::CPtuDPerception, and mrpt::hwdrivers::CTuMicos.
Definition at line 48 of file CPtuBase.h.
CSerialPort mrpt::hwdrivers::CPtuBase::serPort [protected] |
Definition at line 52 of file CPtuBase.h.
Definition at line 48 of file CPtuBase.h.
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011 |