AURobotServers  4
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
UCamPanTiltDevice Class Reference

#include <ucampantiltdevice.h>

Inheritance diagram for UCamPanTiltDevice:
Inheritance graph

Public Member Functions

int getPanMaxRange ()
 
int getPanMinRange ()
 
int getPanPos ()
 
int getTiltMaxRange ()
 
int getTiltMinRange ()
 
int getTiltPos ()
 
bool isPantiltSupported ()
 
bool isPantiltValid ()
 
bool pantiltSetPosition (bool relative, int pan, int tilt)
 
bool pantiltToHomePosition ()
 
bool pantiltUpdatePosition ()
 
bool setPantiltStatus ()
 
 UCamPanTiltDevice (UCamDevBase *device)
 
- Public Member Functions inherited from UCamBase
virtual void createVars ()
 
const char * getCamName ()
 
UCamDevBasegetDev ()
 
int getDevNum ()
 
virtual void gotNewImage (UImage *)
 
virtual void imageSizeChanged (double)
 
virtual void imgUpdated ()
 
virtual bool needNewPushData ()
 
void setTypeName (const char *newName)
 
void setVarPool (UVarPool *vpd)
 
 UCamBase (UCamDevBase *device)
 
virtual ~UCamBase ()
 

Protected Member Functions

bool protPantiltGetPosition ()
 
bool protPantiltGetRange ()
 
bool protPantiltReset (bool resetPan, bool resetTilt)
 

Private Attributes

bool pantiltSupported
 
bool pantiltValid
 
int ptPanMax
 
int ptPanMin
 
int ptPanPos
 
int ptTiltMax
 
int ptTiltMin
 
int ptTiltPos
 

Additional Inherited Members

- Protected Attributes inherited from UCamBase
UCamDevBasedev
 
UVarPoolvars
 

Detailed Description

Code to support pan-tilt

Especially on PWC logitech sphere device

    @author Christian Andersen <jca@oersted.dtu.dk>

Constructor & Destructor Documentation

UCamPanTiltDevice::UCamPanTiltDevice ( UCamDevBase device)

Constructor

References pantiltSupported, and pantiltValid.

Member Function Documentation

int UCamPanTiltDevice::getPanMaxRange ( )
inline

Get pantilt panorate (left-right) max range. in degrees * 100. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References ptPanMax.

Referenced by UComCamSml::setFromCam().

int UCamPanTiltDevice::getPanMinRange ( )
inline

Get pantilt panorate (left-right) min range. in degrees * 100 - positive is left. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References ptPanMin.

Referenced by UComCamSml::setFromCam().

int UCamPanTiltDevice::getPanPos ( )
inline

Get pantilt panorate (left-right) position in degrees * 100 - positive is left. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References ptPanPos.

Referenced by UCamPool::findDevices(), UComCamSml::setCamDevice(), and UComCamSml::setFromCam().

int UCamPanTiltDevice::getTiltMaxRange ( )
inline

Get pantilt tilt (up-down) max range. in degrees * 100 - positive is up. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References ptTiltMax.

Referenced by UComCamSml::setFromCam().

int UCamPanTiltDevice::getTiltMinRange ( )
inline

Get pantilt tilt (up-down) min range. in degrees * 100 - positive is up. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References ptTiltMin.

Referenced by UComCamSml::setFromCam().

int UCamPanTiltDevice::getTiltPos ( )
inline

Get pantilt tilt (up-down) position in degrees * 100 - positive is up. NB! only valid if isPantiltValid and isPantiltSupport flags are true.

References pantiltSetPosition(), pantiltToHomePosition(), pantiltUpdatePosition(), protPantiltGetPosition(), protPantiltGetRange(), protPantiltReset(), ptTiltPos, and setPantiltStatus().

Referenced by UCamPool::findDevices(), UComCamSml::setCamDevice(), and UComCamSml::setFromCam().

bool UCamPanTiltDevice::isPantiltSupported ( )
inline

Get pan supported flag for this camera. NB! the flag is set when camera is opened

References pantiltSupported.

Referenced by UComCamSml::setCamDevice(), and UComCamSml::setFromCam().

bool UCamPanTiltDevice::isPantiltValid ( )
inline

Get pan tilt information valid. The flag is only valid if pan-tilt is supported NB! the flag is set when camera is opened

References pantiltValid.

bool UCamPanTiltDevice::pantiltSetPosition ( bool  relative,
int  pan,
int  tilt 
)

Set pan and tilt position (must be within range). Returns true if call succeded

References UCamBase::dev, UCamDevBase::getCamFd(), UCamDevBase::isCameraOpen(), ULock::lock(), maxi(), mini(), pantiltSupported, pantiltValid, ptPanMax, ptPanMin, and ULock::unlock().

Referenced by UCamPool::findDevices(), getTiltPos(), and UComCamSml::setCamDevice().

bool UCamPanTiltDevice::pantiltToHomePosition ( )

Global function to reset pan-tilt function to home position

References UCamBase::dev, ULock::lock(), pantiltSupported, protPantiltReset(), and ULock::unlock().

Referenced by UCamPool::findDevices(), getTiltPos(), and UComCamSml::setCamDevice().

bool UCamPanTiltDevice::pantiltUpdatePosition ( )

Global function to update the camera position from the camera. Returns true if position is updated. In not, then pan-tilt is most likely not supported.

References UCamBase::dev, ULock::lock(), pantiltSupported, protPantiltGetPosition(), and ULock::unlock().

Referenced by getTiltPos(), and UComCamSml::setFromCam().

bool UCamPanTiltDevice::protPantiltGetPosition ( )
protected
bool UCamPanTiltDevice::protPantiltGetRange ( )
protected

Get minimum and maximum pan-tilt ranges Returns true if successful, Returns false if failed or not supported

References UCamBase::dev, UCamDevBase::getCamFd(), UCamDevBase::isCameraOpen(), ptPanMax, ptPanMin, ptTiltMax, and ptTiltMin.

Referenced by getTiltPos(), and setPantiltStatus().

bool UCamPanTiltDevice::protPantiltReset ( bool  resetPan,
bool  resetTilt 
)
protected

Reset pan-tilt to level front position. Returns true if function was accepted. Returns false if no such function (PanTilt not supported)

References UCamBase::dev, UCamDevBase::getCamFd(), and UCamDevBase::isCameraOpen().

Referenced by getTiltPos(), and pantiltToHomePosition().

bool UCamPanTiltDevice::setPantiltStatus ( )

Test if pan-tilt is supported. and set range and position if so. Returns true if supported.

References pantiltSupported, pantiltValid, protPantiltGetPosition(), and protPantiltGetRange().

Referenced by getTiltPos().

Member Data Documentation

bool UCamPanTiltDevice::pantiltSupported
private
bool UCamPanTiltDevice::pantiltValid
private
int UCamPanTiltDevice::ptPanMax
private
int UCamPanTiltDevice::ptPanMin
private
int UCamPanTiltDevice::ptPanPos
private
int UCamPanTiltDevice::ptTiltMax
private
int UCamPanTiltDevice::ptTiltMin
private
int UCamPanTiltDevice::ptTiltPos
private

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