Aria  2.7.5.2
ArDPPTU Class Reference

Driver for the DPPTU. More...

#include <ArDPPTU.h>

Inherits ArPTZ.

Public Types

enum  Axis { PAN = 'P', TILT = 'T' }
 
enum  DeviceType { PANTILT_DEFAULT, PANTILT_PTUD47, PANTILT_PTUD46 }
 

Public Member Functions

 ArDPPTU (ArRobot *robot, DeviceType deviceType=PANTILT_DEFAULT, int deviceIndex=-1)
 Constructor. More...
 
bool basePanSlew (double deg)
 Sets the start-up pan slew.
 
bool baseTiltSlew (double deg)
 Sets the start-up tilt slew.
 
bool blank (void)
 Sends a delimiter only. More...
 
virtual bool canGetRealPanTilt () const
 
virtual bool canZoom (void) const
 
virtual double getMaxNegPan (void) const
 
virtual double getMaxNegTilt (void) const
 
double getMaxPanAccel (void)
 
double getMaxPanSlew (void)
 
virtual double getMaxPosPan (void) const
 
virtual double getMaxPosTilt (void) const
 
double getMaxTiltAccel (void)
 
double getMaxTiltSlew (void)
 
double getMinPanAccel (void)
 
double getMinPanSlew (void)
 
double getMinTiltAccel (void)
 
double getMinTiltSlew (void)
 
bool indepMove (void)
 Sets motion to indenpendent control mode.
 
bool init (void)
 
bool limitEnforce (bool val)
 Enables or disables the position limit enforcement.
 
bool lowerPanSlew (double deg)
 Sets the lower pan slew.
 
bool lowerTiltSlew (double deg)
 Sets the lower pan slew.
 
bool panAccel (double deg)
 Sets acceleration for pan axis.
 
bool panSlew (double deg)
 Sets the rate that the unit pans at.
 
bool panSlewRel (double deg)
 Sets the rate that the unit pans at, relative to current slew.
 
bool resetCalib (void)
 Perform reset calibration (PTU will move to the limits of pan and tilt axes in turn and return to 0,0)
 
bool tiltAccel (double deg)
 Sets acceleration for tilt axis.
 
bool tiltSlew (double deg)
 Sets the rate the unit tilts at.
 
bool tiltSlewRel (double deg)
 Sets the rate the unit tilts at, relative to current slew.
 
bool upperPanSlew (double deg)
 Sets the upper pan slew.
 
bool upperTiltSlew (double deg)
 Sets the upper tilt slew.
 
bool velMove (void)
 Sets motion to pure velocity control mode.
 
virtual ~ArDPPTU ()
 Destructor.
 
bool disableReset (void)
 Configure DPPTU to disable future power-on resets. More...
 
bool resetTilt (void)
 Configure DPPTU to only reset tilt on future power-up.
 
bool resetPan (void)
 Configure DPPTU to only reset pan on future power up.
 
bool resetAll (void)
 Configure DPPTU to reset both pan and tilt on future power on.
 
bool enMon (void)
 Enables monitor mode at power up.
 
bool disMon (void)
 Disables monitor mode at power up.
 
bool saveSet (void)
 Save current settings as defaults.
 
bool restoreSet (void)
 Restore stored defaults.
 
bool factorySet (void)
 Restore factory defaults.
 
virtual bool panTilt (double pdeg, double tdeg)
 
virtual bool pan (double deg)
 
virtual bool panRel (double deg)
 
virtual bool tilt (double deg)
 
virtual bool tiltRel (double deg)
 
virtual bool panTiltRel (double pdeg, double tdeg)
 
bool awaitExec (void)
 Instructs unit to await completion of the last issued command.
 
bool haltAll (void)
 Halts all pan-tilt movement.
 
bool haltPan (void)
 Halts pan axis movement.
 
bool haltTilt (void)
 Halts tilt axis movement.
 
bool initMon (double deg1, double deg2, double deg3, double deg4)
 Sets monitor mode - pan pos1/pos2, tilt pos1/pos2.
 
bool immedExec (void)
 Sets unit to immediate-execution mode for positional commands. Commands will be executed by PTU as soon as they are received. More...
 
bool slaveExec (void)
 Sets unit to slaved-execution mode for positional commands. Commands will not be executed by PTU until awaitExec() is used.
 
virtual double getPan (void) const
 
virtual double getTilt (void) const
 
- Public Member Functions inherited from ArPTZ
 ArPTZ (ArRobot *robot)
 
virtual bool canGetFOV (void)
 Whether we can get the FOV (field of view) or not.
 
virtual bool canGetRealZoom (void) const
 Whether getZoom() returns the device's real zoom amount, or last commanded zoom position.
 
virtual bool canSetFocus (void) const
 If the driver can set the focus on the camera, or not.
 
virtual bool canSetGain (void) const
 If the driver can set gain on the camera, or not.
 
virtual void connectHandler (void)
 Internal, attached to robot, inits the camera when robot connects.
 
virtual int getAuxPort (void)
 Gets the port the device is set to communicate on.
 
virtual ArDeviceConnectiongetDeviceConnection (void)
 Gets the device connection used by this PTZ camera.
 
virtual double getFocus (double focus) const
 Get the focus the camera is set to. 0 if not supported.
 
virtual double getFOVAtMaxZoom (void)
 Gets the field of view at maximum zoom.
 
virtual double getFOVAtMinZoom (void)
 Gets the field of view at minimum zoom.
 
virtual double getGain (double gain) const
 Get the gain the camera is set to. 0 if not supported.
 
virtual int getMaxZoom (void) const
 Gets the maximum value for the zoom on this camera.
 
virtual int getMinZoom (void) const
 Gets the lowest value for the zoom on this camera.
 
virtual int getZoom (void) const
 
virtual bool packetHandler (ArBasePacket *packet)
 Handles a packet that was read from the device. More...
 
virtual void reset (void)
 Resets the camera. More...
 
virtual bool robotPacketHandler (ArRobotPacket *packet)
 Handles a packet that was read by the robot. More...
 
virtual bool sendPacket (ArBasePacket *packet)
 Sends a given packet to the camera (via robot or serial port, depending) More...
 
virtual void sensorInterpHandler (void)
 Internal, for attaching to the robots sensor interp to read serial port.
 
virtual bool setAuxPort (int auxPort)
 Sets the aux port on the robot to be used to communicate with this device. More...
 
virtual bool setDeviceConnection (ArDeviceConnection *connection, bool driveFromRobotLoop=true)
 
virtual bool setFocus (double focus) const
 
virtual bool setGain (double gain) const
 
virtual bool zoom (int zoomValue)
 Zooms to the given value.
 
virtual bool zoomRel (int zoomValue)
 Zooms relative to the current value, by the given value.
 
virtual ~ArPTZ ()
 Destructor.
 
enum  PowerMode { OFF = 'O', LOW = 'L', NORMAL = 'R', HIGH = 'H' }
 
bool setMovePower (Axis axis, PowerMode mode)
 
bool setHoldPower (Axis axis, PowerMode mode)
 
bool offStatPower (void)
 
bool regStatPower (void)
 
bool lowStatPower (void)
 
bool highMotPower (void)
 
bool regMotPower (void)
 
bool lowMotPower (void)
 
ArRobotmyRobot
 
ArDPPTUPacket myPacket
 
double myPanSent
 Last pan command sent.
 
double myTiltSent
 Last tilt command sent.
 
double myPanSlew
 
double myTiltSlew
 
double myBasePanSlew
 
double myBaseTiltSlew
 
double myPanAccel
 
double myTiltAccel
 
DeviceType myDeviceType
 
int myMaxPan
 
int myMinPan
 
int myMaxTilt
 
int myMinTilt
 
int myMaxPanSlew
 
int myMinPanSlew
 
int myMaxTiltSlew
 
int myMinTiltSlew
 
int myMaxPanAccel
 
int myMinPanAccel
 
int myMaxTiltAccel
 
int myMinTiltAccel
 
float myPanConvert
 
float myTiltConvert
 
float myPan
 
float myPanRecd
 Last pan value received from DPPTU from PP command.
 
float myTilt
 
float myTiltRecd
 Last tilt value received from DPPTU from TP command.
 
bool myCanGetRealPanTilt
 
bool myInit
 
ArFunctorC< ArDPPTUmyQueryCB
 
char * myDataBuf
 
ArFunctorC< ArDPPTUmyShutdownCB
 
int myDeviceIndex
 
ArTime myLastPositionMessageHandled
 
bool myWarnedOldPositionData
 
ArTime myLastQuerySent
 
std::vector< char > myPowerPorts
 
bool myGotPanRes
 
bool myGotTiltRes
 
double getLastPanRequest () const
 Get last pan/tilt requested. The device may still be moving towards these positions. (. More...
 
double getLastTiltRequest () const
 
double getPanSlew (void)
 Gets the current pan slew.
 
double getTiltSlew (void)
 Gets the current tilt slew.
 
double getBasePanSlew (void)
 Gets the base pan slew.
 
double getBaseTiltSlew (void)
 Gets the base tilt slew.
 
double getPanAccel (void)
 Gets the current pan acceleration rate.
 
double getTiltAccel (void)
 Gets the current tilt acceleration rate.
 
void query ()
 
void preparePacket (void)
 adds on extra delim in front to work on H8
 
virtual ArBasePacketreadPacket ()
 
void shutdown ()
 

Additional Inherited Members

- Protected Attributes inherited from ArPTZ
int myAuxPort
 
ArCommands::Commands myAuxRxCmd
 
ArCommands::Commands myAuxTxCmd
 
ArDeviceConnectionmyConn
 
ArFunctorC< ArPTZmyConnectCB
 
ArRobotmyRobot
 
ArRetFunctor1C< bool, ArPTZ,
ArRobotPacket * > 
myRobotPacketHandlerCB
 
ArFunctorC< ArPTZmySensorInterpCB
 

Detailed Description

Driver for the DPPTU.

Examples:
dpptuExample.cpp.

Member Enumeration Documentation

Enumerator
PANTILT_DEFAULT 

Automatically detect correct settings.

PANTILT_PTUD47 

Force settings for PTU-D47.

Since
2.7.0
PANTILT_PTUD46 

Force settings for PTU-D46.

Since
2.7.5

Enable/disable moving and holding power modes for pan and tilt

Constructor & Destructor Documentation

ArDPPTU::ArDPPTU ( ArRobot robot,
DeviceType  deviceType = PANTILT_DEFAULT,
int  deviceIndex = -1 
)

Constructor.

deviceType If a type other than PANTILT_DEFAULT is given, then manually selects different parameters for different DPPTU models. It is recommended to use PANTILT_DEFAULT (unless your PTU is not responding to resolution queries for some reason)

deviceIndex if you have more than one PTU on a Seekur robot, this specifies one device to power on at startup and power off on exit. If -1 (default value), then all possible PTU power ports are powered on.

Member Function Documentation

bool ArDPPTU::blank ( void  )

Sends a delimiter only.

A blank packet can be sent to exit monitor mode

bool ArDPPTU::disableReset ( void  )

Configure DPPTU to disable future power-on resets.

Change stored configuration options

double ArDPPTU::getLastPanRequest ( ) const
inline

Get last pan/tilt requested. The device may still be moving towards these positions. (.

See Also
getPan(), getTilt(), canGetRealPanTilt())
virtual double ArDPPTU::getPan ( void  ) const
inlinevirtual

Get current pan/tilt position, if receiving from device, otherwise return last position request sent to the device.

See Also
canGetRealPanTilt()

Implements ArPTZ.

bool ArDPPTU::highMotPower ( void  )
inline
bool ArDPPTU::immedExec ( void  )

Sets unit to immediate-execution mode for positional commands. Commands will be executed by PTU as soon as they are received.

Set execution modes

bool ArDPPTU::lowMotPower ( void  )
inline
bool ArDPPTU::lowStatPower ( void  )
inline
bool ArDPPTU::offStatPower ( void  )
inline
virtual bool ArDPPTU::panTilt ( double  pdeg,
double  tdeg 
)
inlinevirtual

Move the pan and tilt axes

Implements ArPTZ.

bool ArDPPTU::regMotPower ( void  )
inline
bool ArDPPTU::regStatPower ( void  )
inline
bool ArDPPTU::setHoldPower ( Axis  axis,
PowerMode  mode 
)

Configure power mode for an axis when stationary. init() sets the initial halted power to Off. Call this method to choose a different mode. The recommended modes are Off or Low.

bool ArDPPTU::setMovePower ( Axis  axis,
PowerMode  mode 
)

Configure power mode for an axis when in motion. init() sets initial moving power mode to Low, call this method to choose a different mode. The recomended modes are either Low or Normal.


The documentation for this class was generated from the following files: