AURobotServers
4
|
#include <ucomcam.h>
Public Member Functions | |
virtual void | clear () |
bool | pack (UCamMounted *cam, int client, char *message, int messageSize) |
bool | setCamDevice (UCamMounted *cam) |
bool | setFromCam (UCamMounted *cam, bool probe, int client) |
bool | unpack (UServerInMsg *msg) |
Public Member Functions inherited from UComCam | |
const char * | getSaturationModeStr (int mode) |
const char * | getWhiteModeStr (int mode) |
void | print (const char *prestring) |
bool | setCamDevice (UCamDevBase *dev) |
bool | setFromCam (UCamDevBase *dev, bool probe, bool clientInCtrl) |
UComCam () | |
bool | unpack (unsigned char *buff) |
virtual | ~UComCam () |
Extension to camera parameters class, packing and unpacking to and from the XML-like format SML.
|
virtual |
Clear all values to not valid.
Reimplemented from UComCam.
References UComCam::clear().
Referenced by UFunctionCam::handleCamGetCommand(), and UFunctionCam::handleCamSetCommand().
bool UComCamSml::pack | ( | UCamMounted * | cam, |
int | client, | ||
char * | message, | ||
int | messageSize | ||
) |
Pack the parameters requested from this camera to the provided buffer zero terminate the buffer. Returns false if not enough space, or camera device is invalid.
References AU_WB_AUTO, AU_WB_FL, AU_WB_INDOOR, AU_WB_MANUAL, AU_WB_OUTDOOR, bool2str(), UComCam::brightnessValue, camParFocalLength, camParHeadX, camParHeadY, camParRadialK1, camParRadialK2, UComCam::channelName, UComCam::channelNumber, UComCam::channelNumberValid, UComCam::colourValue, UComCam::contourValid, UComCam::contourValue, UComCam::contrastValue, UComCam::deviceValid, UComCam::deviceValue, UComCam::fpsValid, UComCam::fpsValue, UComCam::gainAutomatic, UComCam::gainValid, UComCam::gainValue, UComCam::gammaValue, UComCam::hdrMode, UComCam::hdrValid, UComCam::imageNumber, UComCam::imageNumberValid, UComCam::inCtrlValid, UCamMounted::isClientInCharge(), URotation::Kappa, UComCam::ledOn, UComCam::ledValid, UComCam::name, UComCam::nameValid, URotation::Omega, UComCam::openValid, UComCam::openValue, panMaxValue, panMinValue, panPosValue, panTiltSupportValue, URotation::Phi, posName, relPos, relRot, UComCam::saturationCtrlMode, UComCam::saturationCtrlValid, setFromCam(), UComCam::shutterAutomatic, UComCam::shutterValid, UComCam::shutterValue, UComCam::sizeHeight, UComCam::sizeValid, UComCam::sizeWidth, tiltMaxValue, tiltMinValue, tiltPosValue, UComCam::videoValid, UComCam::whiteBalGainBlue, UComCam::whiteBalGainRed, UComCam::whiteBalMode, UComCam::whiteBalValid, UPosition::x, UPosition::y, and UPosition::z.
Referenced by UFunctionCam::sendStatusReply().
bool UComCamSml::setCamDevice | ( | UCamMounted * | cam | ) |
Set camera device from stored values
References UCamRad::getCamPar(), UCamBase::getDev(), UCamPar::getFocalLength(), UCamPar::getHx(), UCamPar::getHy(), UCamPar::getK1(), UCamPar::getK2(), UCamPanTiltDevice::getPanPos(), UCamMounted::getPos(), UCamMounted::getRot(), UCamPanTiltDevice::getTiltPos(), UCamPanTiltDevice::isPantiltSupported(), URotation::Kappa, URotation::Omega, UCamPanTiltDevice::pantiltSetPosition(), UCamPanTiltDevice::pantiltToHomePosition(), URotation::Phi, UComCam::setCamDevice(), UCamRad::setCameraParameters(), UCamMounted::setMountName(), UCamPar::setPixelSize(), UCamMounted::setPosOnRobot(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by UFunctionCam::handleCamSetCommand().
bool UComCamSml::setFromCam | ( | UCamMounted * | cam, |
bool | probe, | ||
int | client | ||
) |
Set values from actual camera
References UCamRad::getCamPar(), UCamBase::getDev(), UCamPar::getFocalLength(), UCamPar::getHx(), UCamPar::getHy(), UCamPar::getK1(), UCamPar::getK2(), UCamPanTiltDevice::getPanMaxRange(), UCamPanTiltDevice::getPanMinRange(), UCamPanTiltDevice::getPanPos(), UCamMounted::getPos(), UCamMounted::getPosName(), UCamMounted::getRot(), UCamPanTiltDevice::getTiltMaxRange(), UCamPanTiltDevice::getTiltMinRange(), UCamPanTiltDevice::getTiltPos(), UCamPanTiltDevice::isPantiltSupported(), UCamPar::isValid(), UCamPanTiltDevice::pantiltUpdatePosition(), and UComCam::setFromCam().
Referenced by pack().
bool UComCamSml::unpack | ( | UServerInMsg * | msg | ) |
Unpach the parameter part of this message and set values and flacks accordingly. Returns true if ask for help only
References AU_WB_AUTO, AU_WB_FL, AU_WB_INDOOR, AU_WB_MANUAL, AU_WB_OUTDOOR, UComCam::brightnessValue, UComCam::channelNumber, UComCam::channelNumberValid, UComCam::colourValue, UComCam::contourValid, UComCam::contourValue, UComCam::contrastValue, UComCam::deviceValid, UComCam::deviceValue, UComCam::fpsValid, UComCam::fpsValue, UComCam::gainAutomatic, UComCam::gainValid, UComCam::gainValue, UComCam::gammaValue, USmlTagIn::getNextAttribute(), UServerInMsg::getTag(), UComCam::hdrMode, UComCam::hdrValid, UComCam::imageNumber, UComCam::imageNumberValid, UComCam::inCtrlValid, UComCam::ledOn, UComCam::ledValid, MAX_MESSAGE_LENGTH_TO_CAM, MAX_MOUNT_NAME_SIZE, MAX_SML_NAME_LENGTH, UComCam::nameValid, UComCam::openValid, UComCam::openValue, USmlTagIn::reset(), UComCam::saturationCtrlMode, UComCam::saturationCtrlValid, UComCam::shutterAutomatic, UComCam::shutterValid, UComCam::shutterValue, UComCam::sizeHeight, UComCam::sizeValid, UComCam::sizeWidth, str2bool(), UComCam::videoValid, UComCam::whiteBalGainBlue, UComCam::whiteBalGainRed, UComCam::whiteBalMode, and UComCam::whiteBalValid.
Referenced by UFunctionCam::handleCamGetCommand(), and UFunctionCam::handleCamSetCommand().
float UComCamSml::camParFocalLength |
Camera parameter focal length
Referenced by pack().
float UComCamSml::camParHeadX |
Headpoint x
Referenced by pack().
float UComCamSml::camParHeadY |
Headpoint y
Referenced by pack().
float UComCamSml::camParRadialK1 |
Radial error parameter K1
Referenced by pack().
float UComCamSml::camParRadialK2 |
Radial error parameter K2
Referenced by pack().
bool UComCamSml::camParValid |
Camera parameters valid
Referenced by UFunctionCam::handleCamGetCommand().
char UComCamSml::notUsedPars[MAX_MESSAGE_LENGTH_TO_CAM] |
Not used parameters, when unpacking a message. The list can be used in a reply to requested
Referenced by UFunctionCam::sendStatusReply().
int UComCamSml::panMaxValue |
pan-tilt max pan value
Referenced by pack().
int UComCamSml::panMinValue |
pan-tilt min pan value
Referenced by pack().
bool UComCamSml::panPosValid |
pan-tilt position command / status
int UComCamSml::panPosValue |
pan tilt relative value
Referenced by pack().
bool UComCamSml::panRelValid |
pan-tilt relative position command
int UComCamSml::panRelValue |
pan tilt relative value
bool UComCamSml::panTiltHome |
Reset pan-tilt function
bool UComCamSml::panTiltSupportValue |
pan-tilt support
Referenced by pack().
bool UComCamSml::panTiltValid |
pan-tilt status request or status
char UComCamSml::posName[MAX_MOUNT_NAME_SIZE] |
Name of the mounted device, e.g. "left" or "cameraLeft", as specified in the config file.
Referenced by UFunctionCam::handleCamGetCommand(), UFunctionCam::handleCamSetCommand(), and pack().
bool UComCamSml::posNameValid |
is device mount name valid
Referenced by UFunctionCam::handleCamGetCommand(), and UFunctionCam::handleCamSetCommand().
bool UComCamSml::relPosValid |
Position of camera on robot values are valid
Referenced by UFunctionCam::handleCamGetCommand().
bool UComCamSml::relPosXValid |
new position data
bool UComCamSml::relPosYValid |
new position data
bool UComCamSml::relPosZValid |
new position data
bool UComCamSml::relRotKValid |
new rotation (orientation) data
bool UComCamSml::relRotOValid |
new rotation (orientation) data
bool UComCamSml::relRotPValid |
new rotation (orientation) data
bool UComCamSml::relRotValid |
Rotation of camera on robot values are valid
Referenced by UFunctionCam::handleCamGetCommand().
int UComCamSml::tiltMaxValue |
pan-tilt max tilt value
Referenced by pack().
int UComCamSml::tiltMinValue |
pan-tilt min tilt value
Referenced by pack().
bool UComCamSml::tiltPosValid |
pan-tilt position command / status
int UComCamSml::tiltPosValue |
pan tilt relative value
Referenced by pack().
bool UComCamSml::tiltRelValid |
pan-tilt relative position command
int UComCamSml::tiltRelValue |
pan tilt relative value