AURobotServers
4
|
#include <ucampantiltdevice.h>
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 () |
UCamDevBase * | getDev () |
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 | |
UCamDevBase * | dev |
UVarPool * | vars |
Code to support pan-tilt
Especially on PWC logitech sphere device
@author Christian Andersen <jca@oersted.dtu.dk>
UCamPanTiltDevice::UCamPanTiltDevice | ( | UCamDevBase * | device | ) |
Constructor
References pantiltSupported, and pantiltValid.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
Get current position of camera pan-tilt
References UCamBase::dev, UCamDevBase::getCamFd(), UCamDevBase::isCameraOpen(), pantiltValid, ptPanPos, and ptTiltPos.
Referenced by getTiltPos(), pantiltUpdatePosition(), and setPantiltStatus().
|
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().
|
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().
|
private |
|
private |
Referenced by isPantiltValid(), pantiltSetPosition(), protPantiltGetPosition(), setPantiltStatus(), and UCamPanTiltDevice().
|
private |
Referenced by getPanMaxRange(), pantiltSetPosition(), and protPantiltGetRange().
|
private |
Referenced by getPanMinRange(), pantiltSetPosition(), and protPantiltGetRange().
|
private |
Referenced by getPanPos(), and protPantiltGetPosition().
|
private |
Referenced by getTiltMaxRange(), and protPantiltGetRange().
|
private |
Referenced by getTiltMinRange(), and protPantiltGetRange().
|
private |
Referenced by getTiltPos(), and protPantiltGetPosition().