AURobotServers
4
|
#include <ufunckinect.h>
Public Member Functions | |
virtual void | callGotNewDataWithObject () |
virtual void | createResources () |
virtual bool | decodeReplayLine (char *line) |
int | GetXYZCoordinates (void *pointCloud, int Max, int type, int redFac) |
virtual bool | handleCommand (UServerInMsg *msg, void *extra) |
bool | makeObj3Dcloud () |
bool | makePCD (const char *name, bool andRowCol) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt) |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
void | run () |
UFuncKinect () | |
void | updateCloud (bool color) |
virtual void | updateReplayStatus () |
~UFuncKinect () | |
Public Member Functions inherited from UFuncPlugBasePush | |
virtual bool | setResource (UResBase *resource, bool remove) |
UFuncPlugBasePush () | |
virtual | ~UFuncPlugBasePush () |
Public Member Functions inherited from UFunctionBase | |
bool | addResource (UResBase *resource, UFunctionBase *owner) |
void | closeLogfile () |
virtual const char * | commandList () |
const char * | getAliasName () |
const char * | getLoadedFileName () |
void * | getLoadedModuleRef () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isMine (const char *cmdName) |
bool | isStatic () |
is the module loaded as static A module is static if the ldFilename has a length of zero. More... | |
virtual const char * | name () |
bool | newCmd (UServerInMsg *newMsg, UDataBase *extra) |
bool | newCommand (UServerInMsg *newMsg, void *extra) |
bool | openLogfile (const char *name) |
void | print (const char *preString) |
virtual void | resourceUpdated () |
bool | sendEndTag (UServerInMsg *msg) |
bool | sendEndTag () |
bool | sendFullTag (const char *attributes) |
bool | sendHelpDone (UServerInMsg *msg) |
bool | sendHelpDone () |
bool | sendHelpStart (UServerInMsg *msg, const char *subject) |
bool | sendHelpStart (const char *subject) |
bool | sendHelpStart () |
bool | sendMsg (UServerInMsg *msg, const char *message, int size) |
bool | sendMsg (const char *message) |
bool | sendMsg (UServerInMsg *msg, const char *message) |
bool | sendMsg (int clientIdx, const char *message, int size) |
bool | sendMsgInt (int clientIdx, const char *message) |
bool | sendStartTag (const char *attributes) |
bool | sendText (UServerInMsg *msg, const char *text) |
bool | sendText (const char *text) |
virtual void | setAliasName (const char *name) |
virtual void | setCommand (const char *cmdList, const char *name, const char *note) |
void | setLoadedModuleRef (void *module, const char *moduleFileName) |
virtual void | setLoadTime (UTime) |
void | setName (const char *name) |
void | setVerbose (bool value) |
UFunctionBase () | |
virtual | ~UFunctionBase () |
Public Member Functions inherited from UCallBack | |
bool | addOnEvent (UOnEvent *dataObject) |
virtual bool | onEvent (const char *interface, const char *dataType, void *data) |
UCallBack () | |
virtual | ~UCallBack () |
Public Member Functions inherited from UResVarPool | |
int | addMethod (const char *formalName, const char *paramTypes, const char *comment) |
int | addMethodV (const char *formalName, const char *paramTypes, const char *comment) |
UVarPool * | addStruct (const char *name, const char *comment, bool copy=false) |
UVariable * | addVar (const char *name, const double initialValue, const char *type, const char *comment) |
UVariable * | addVar (const char *name, const char *initialValue, const char *type, const char *comment) |
UVariable * | addVarA (const char *name, const char *initialValue, const char *type, const char *comment) |
bool | callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt) |
Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More... | |
bool | callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callVS (const char *function, const char *stringParam) |
int | callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys) |
void | createBaseVar () |
virtual bool | createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false) |
bool | getGlobalString (const char *name, const char **value) |
bool | getGlobalValue (const char *name, double *value) |
bool | getGlobalValue (const char *name, const char **value) |
bool | getGlobalValue (const char *name, bool *value) |
bool | getGlobalValue (const char *name, UTime *value) |
bool | getLocalValue (const char *name, double *value) |
get a value in this variable tree More... | |
bool | getLocalValue (const char *name, bool *value) |
bool | getLocalValue (const char *name, UTime *value) |
double | getLocalValue (int idx) |
UPosition | getLocalValue3D (int idx) |
UPosRot | getLocalValue6D (int idx) |
bool | getLocalValueBool (int idx) |
int | getLocalValueInt (int idx) |
UTime | getLocalValueTime (int idx) |
const char * | getLogFileName () |
const char * | getVarDescription (int idx) |
UVarCalc * | getVarPool () |
bool | isLogFileOpen () |
bool | isLogFileOpen (const char *structName) |
bool | isVarPoolUpdated (int lastCnt, int *newCnt) |
void | logFileClose () |
bool | logFileOpen () |
void | logFileStart (const char *structName, bool open) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
bool | setGlobalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar (int idx, double value, const int element) |
bool | setLocalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar3D (int idx, UPosition *value) |
bool | setLocalVar6D (int idx, UPosRot *value) |
bool | setLocalVarAdd (int idx, double value, const int element) |
bool | setLocalVarPose (int idx, UPose *value) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
UCmdExe * | getCorePointer () |
char * | getLogFileName (char *fn, const int fnCnt) |
int | getResFuncIdx () |
const char * | getResID () |
int | getResVersion () |
bool | isA (const char *idStr) |
bool | isAlsoA (const char *id) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
char * | getLogFileName (char *fn, const int fnCnt) |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
bool | isReplay () |
bool | isReplayFileOpen () |
void | removeChild (UReplay *child) |
virtual void | replayAdvanceTime (UTime untilTime) |
void | replaySetBaseFileName (const char *name, const char *preName="") |
void | replaySetFileName (const char *name) |
virtual bool | replayStep () |
int | replayStep (int steps) |
virtual bool | replayToTime (UTime untilTime) |
void | setParent (UReplay *parent) |
bool | setReplay (bool value) |
UReplay () | |
virtual | ~UReplay () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Member Functions inherited from UVarMethodImplement | |
virtual | ~UVarMethodImplement () |
Public Member Functions inherited from UServerPush | |
int | addPushCommand (UServerInMsg *msg) |
bool | doPushCall (UServerPushElement *pe, const char *value) |
void | flushClientCmds (int clientIdx) |
UServerPushImplement * | getImplementor () |
int | getPushCmdCnt (int *cmdCnt, int *callCnt) |
UServerPushQueue * | getPushQueue () |
bool | gotCmdExe () |
void | gotNewData (void *pData) |
bool | isUpdated (int lastCnt, int *newCnt) |
bool | needNewData () |
void | print (const char *preString) |
void | print (const char *preString, char *buff, int buffCnt) |
void | servicePendingPushCmds () |
void | setCmdExe (UServerPushImplement *executor) |
void | setImplementor (UServerPushImplement *executor) |
bool | setResource (UResBase *resource, bool remove) |
bool | setUpdated (const char *value) |
Add watch object if needed. An image or other object is updated. set object as updated, with an extra qualifier, that may be used as a parameter in a push call. this push list is then added to the to the push list examined by the server thread. when server thread reach this push list it will call to get a possible associated data structure by a call to needNewData() whish is expected to call gotNewData(void * data_structure) - but now in the server thread. More... | |
UServerPush () | |
virtual | ~UServerPush () |
Private Member Functions | |
bool | handleKinect (UServerInMsg *msg) |
void | init () |
void | initXYTable (int focalLength) |
void | logFileTest () |
bool | logImageToFile (UImage *imgToLog) |
bool | processDepthImages (UImage *img, int validBits) |
bool | setPointCloudUpdated (const char *name) |
bool | start () |
start read thread More... | |
void | stop (bool andWait) |
Static Private Attributes | |
static const int | MWL = 100 |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Public Attributes inherited from UFunctionBase | |
bool | silent |
is reply to client and console to be limited More... | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Static Public Attributes inherited from UFunctionBase | |
static const int | MAX_ID_LENGTH = 30 |
static const int | MAX_RESOURCE_LIST_SIZE = 250 |
Protected Member Functions inherited from UFuncPlugBasePush | |
bool | handlePush (UServerInMsg *msg) |
Protected Member Functions inherited from UFunctionBase | |
int | getCmdIndex () |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
bool | isClientAlive (int clientIdx, double holdOffTime) |
bool | sendDebug (UServerInMsg *msg, const char *debugText) |
bool | sendDebug (const char *debugText) |
bool | sendError (UServerInMsg *msg, const char *errorText) |
bool | sendError (const char *errorText) |
bool | sendHelp (UServerInMsg *msg, const char *infoText) |
bool | sendHelp (const char *infoText) |
bool | sendInfo (UServerInMsg *msg, const char *infoText) |
bool | sendInfo (const char *infoText) |
bool | sendWarning (UServerInMsg *msg, const char *warningText) |
bool | sendWarning (const char *warningText) |
UResBase * | setThisResource (const char *ID, UResBase *resource, bool remove, bool *changed, UResBase *currentResPtr, bool *isLocal) |
Protected Member Functions inherited from UResVarPool | |
void | setDescription (const char *note, bool copy=false) |
Protected Member Functions inherited from UResBase | |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
Protected Attributes inherited from UFunctionBase | |
char | aliasName [MAX_ID_LENGTH] |
UCmdExe * | cmdHandler |
char * | cmdToks [20] |
int | cmdToksCnt |
char | commandsHandled [MAX_RESOURCE_LIST_SIZE] |
UServerInMsg * | msg |
char | pluginName [MAX_RESOURCE_LIST_SIZE] |
bool | verboseMessages |
Protected Attributes inherited from UResBase | |
int | resFuncIdx |
char | resID [MAX_RESOURCE_ID_LENGTH] |
char | resIsAlso [MAX_RESOURCE_ISALSO_LENGTH] |
int | resVersion |
Protected Attributes inherited from UReplay | |
bool | replay |
FILE * | replayFile |
char | replayFileName [REPLAY_FILE_NAME_LENGTH] |
replay filename More... | |
char | replayLine [MAX_LOG_LINE_LENGTH] |
int | replayLogLine |
UReplay * | replayParent |
UTime | replayTimeNext |
Static Protected Attributes inherited from UReplay | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
static const int | REPLAY_FILE_NAME_LENGTH = 264 |
max length of replay filename More... | |
This is functions to handle Kinect camera issues
|
inline |
Constructor
References callGotNewDataWithObject(), createResources(), decodeReplayLine(), GetXYZCoordinates(), handleCommand(), handleKinect(), img, init(), initXYTable(), UResBase::line, logFileTest(), logImageToFile(), makeObj3Dcloud(), makePCD(), methodCall(), methodCallV(), UFunctionBase::msg, UFunctionBase::name(), processDepthImages(), run(), UFunctionBase::setCommand(), setPointCloudUpdated(), start(), stop(), updateCloud(), updateReplayStatus(), and ~UFuncKinect().
UFuncKinect::~UFuncKinect | ( | ) |
Destructor
References ULogFile::closeLog(), UImageLog::closeLogging(), cloud3d, UVariable::getBool(), imgCbuf, logAcc, logf, logImage, stop(), and varInitialized.
Referenced by UFuncKinect().
|
virtual |
Called from push implementor to get the push object. should call to 'gotNewData(object)' with the available event object. if no object is available (anymore), then call with a NULL pointer.
Reimplemented from UServerPush.
References UVariable::add(), bool2str(), UImage::camDevice, cloud3d, convert_packed11_to_16bit(), convert_packed_to_16bit(), convert_packed_to_8bit(), data, frameCntDepth, frameCntRgb, frameLogCnt, frameRateDepthTime, frameRateRgbTime, freenect_apply_depth_to_mm(), freenect_apply_registration(), freenect_close_device(), FREENECT_DEPTH_10BIT_PACKED, FREENECT_DEPTH_11BIT_PACKED, freenect_find_depth_mode(), freenect_find_video_mode(), freenect_init(), freenect_init_registration(), freenect_open_device(), FREENECT_RESOLUTION_HIGH, FREENECT_RESOLUTION_MEDIUM, freenect_set_depth_callback(), freenect_set_depth_mode(), freenect_set_led(), freenect_set_tilt_degs(), freenect_set_video_callback(), freenect_set_video_mode(), freenect_shutdown(), freenect_start_depth(), freenect_start_video(), freenect_stop_depth(), freenect_stop_video(), FREENECT_VIDEO_BAYER, FREENECT_VIDEO_IR_8BIT, FREENECT_VIDEO_RGB, FREENECT_VIDEO_YUV_RAW, UVariable::getBool(), UImage::getData(), getDevUse(), UImagePool::getImage(), UVariable::getInt(), UFunctionBase::getStaticResource(), UVariable::getTime(), UTime::getTimePassed(), UImage::getUCharRef(), UServerPush::gotNewData(), UImage::height(), UImage::imageNumber, UImage::imgTime, LED_RED, ULock::lock(), logDepthImage, logf, logVideoImage, makeObj3Dcloud(), UTime::Now(), UTime::now(), oldLed, processDepthImages(), roundi(), UVariable::setBool(), UVariable::setInt(), UImage::setName(), UImage::setSize(), UImage::setSizeOnly(), UTime::SetTime(), UServerPush::setUpdated(), UVariable::setValued(), UImg3Dpoints::time, ULogFile::toLog(), ULock::tryLock(), ULock::unlock(), UImage::updated(), UImage::used, varCamDeviceNum, varDepthFmt, varFramerate, varImagesC3D, varInitialized, varIsOpen, varKinectNumber, varLed, varResolution, varTiltDeg, varTiltUse, varTime, varUpdateCnt, varUseColor, varUseDepth, and varVideoFmt.
Referenced by UFuncKinect().
|
virtual |
Called by server after this module is integrated into the server core structure, i.e. all core services are in place, but no commands are serviced for this module yet. Create any resources that this modules needs.
Reimplemented from UFunctionBase.
References UResVarPool::addMethod(), UResVarPool::addVar(), UResVarPool::addVarA(), aliasname, UFunctionBase::getAliasName(), logAcc, logf, logImage, UReplay::replaySetBaseFileName(), ULogFile::setLogName(), start(), varAcc, varAccInterval, varAccLogN, varAccRate, varCamDeviceNum, varDepthFmt, varFramerate, varFramerateDesired, varImageLogN, varImagesC3D, varInitialized, varIsOpen, varKinectNumber, varLed, varMaxUsedDepth, varOrient, varReductionFactor, varReplayLine, varResolution, varSilent, varTiltDeg, varTiltUse, varTime, varUpdateCnt, varUseColor, varUseCorrectedDepth, varUseDepth, varUseDepthColor, and varVideoFmt.
Referenced by UFuncKinect().
|
virtual |
Decode this replay line, that is assumed to be valid - has got a time stamp.
line | is a pointer to the line. |
Reimplemented from UReplay.
References UVariable::add(), UImage::camDevice, UImagePool::getImage(), UVariable::getInt(), UFunctionBase::getStaticResource(), UImage::imageNumber, img, UImage::imgTime, UResBase::line, UImage::loadPNG(), ULock::lock(), processDepthImages(), replayPath, UImage::setName(), UVariable::setTime(), UTime::setTimeTod(), UServerPush::setUpdated(), ULock::unlock(), UImage::updated(), varImagesC3D, varReplayLine, and varTime.
Referenced by UFuncKinect().
int UFuncKinect::GetXYZCoordinates | ( | void * | pointCloud, |
int | Max, | ||
int | type, | ||
int | redFac | ||
) |
get the imageset as a point cloud
[out] | pointCloud | the point cloud to change |
Max | is the maximum distance (in mm or depth value) to add | |
type | is 0 for XYZ and 1 for XYZRGB format | |
redFac | is an optional reduction factor - to reduce number of points. 1= all points, 2=every other, 3=every third ... |
References UVariable::getBool(), UCamPool::getCam(), UCamRad::getCamPar(), UVariable::getDouble(), UCamPar::getFocalLength(), UImage::getHeight(), UImagePool::getImage(), UVariable::getInt(), UImage::getLine(), UFunctionBase::getStaticResource(), UImage::getWidth(), initXYTable(), ULock::lock(), oldFocalLength, UPixel::p1, UPixel::p2, UPixel::p3, t_posX, t_posY, UImage::toRGB(), ULock::unlock(), varCamDeviceNum, varImagesC3D, varMaxUsedDepth, varSilent, and UPixel::y.
Referenced by methodCall(), UFuncKinect(), and updateCloud().
|
virtual |
Handle incomming commands flagged for this module
msg | pointer to the message and the client issuing the command |
Reimplemented from UFunctionBase.
References UFunctionBase::getCmdIndex(), handleKinect(), UFuncPlugBasePush::handlePush(), and UFunctionBase::sendDebug().
Referenced by UFuncKinect().
|
private |
Handle stereo-push commands
References UFunctionBase::aliasName, bool2str(), USmlTagIn::getAttBool(), USmlTagIn::getAttCnt(), USmlTagIn::getAttInteger(), USmlTagIn::getAttValue(), UVariable::getBool(), UVariable::getInt(), ULogFile::getLogFileName(), UReplay::getReplayFileName(), UTime::getTimePassed(), ULogFile::isOpen(), UReplay::isReplay(), lastLoopTime, logAcc, logf, logImage, makePCD(), ULogFile::openLog(), UReplay::replayStep(), UFunctionBase::sendHelpDone(), UFunctionBase::sendHelpStart(), UFunctionBase::sendInfo(), UFunctionBase::sendText(), UFunctionBase::sendWarning(), UVariable::setBool(), UReplay::setReplay(), UVariable::setValued(), UFunctionBase::silent, str2bool2(), UServerInMsg::tag, updateCloud(), varAccLogN, varImageLogN, varImagesC3D, varIsOpen, varSilent, varUseDepth, varUseDepthColor, and Wait().
Referenced by handleCommand(), and UFuncKinect().
|
private |
Initialize other variables
References frameCntDepth, frameCntRgb, imgCbuf, logDepthImage, logVideoImage, obj3dcloud, oldCamDevC, oldCamDevD, oldFocalLength, oldLed, t_depth, t_gamma, threadRunning, and threadStop.
Referenced by UFuncKinect().
|
private |
Init table for fast calculation of 3D position from depth image
focalLength | is the estimated focal length for the color camera in pixel. This assumes, that the depth image is rectified to match the color image. |
References oldFocalLength, t_posX, and t_posY.
Referenced by GetXYZCoordinates(), makeObj3Dcloud(), and UFuncKinect().
|
private |
Test for open or close logfiles using global variable
References UVariable::getInt(), ULogFile::getLogFileName(), ULogFile::isOpen(), logAcc, logf, logImage, ULogFile::openLog(), UImageLog::openLog(), UVariable::setValued(), ULogFile::toLog(), varAccLogN, and varImageLogN.
Referenced by run(), and UFuncKinect().
|
private |
Save image to imagelog and save the image itself in the imagePath. if camera device do not exist, then a default device is created..
imgToLog | is the image to be logged. |
References UImage::camDevice, UCamPool::getCam(), UVariable::getInt(), UFunctionBase::getStaticResource(), ULock::lock(), UImageLog::logImage(), logImage, UCamPool::makeDevice(), ULock::unlock(), and varImageLogN.
Referenced by run(), and UFuncKinect().
bool UFuncKinect::makeObj3Dcloud | ( | ) |
Make 3D object from depth and color images - for colors to match, the format most be "rectified"
References UImg3Dpoints::add(), UResVarPool::callGlobalV(), UImage::camDevice, UImg3Dpoints::clear(), cloud3d, UCamPool::getCam(), UCamRad::getCamPar(), UCamPar::getFocalLength(), UImage::getHeight(), UImagePool::getImage(), UVariable::getInt(), UPixel::getInt(), UImage::getLine(), UCamMounted::getPosRot(), UFunctionBase::getStaticResource(), UImage::getWidth(), UImage::height(), UImage::imageNumber, imgCbuf, UImage::imgTime, initXYTable(), UImg3Dpoints::inSensorCoordinates, UResBase::isA(), UImage::isRGB(), ULock::lock(), UFunctionBase::name(), oldFocalLength, UPcpItem::PointXyz, UPcpItem::PointXyzRgb, UImg3Dpoints::pose, UImg3Dpoints::serial, UVariable::setValues(), UImg3Dpoints::sourceImgColor, t_depth, t_posX, t_posY, UImg3Dpoints::time, UImage::toRGB(), ULock::tryLock(), ULock::unlock(), varCamDeviceNum, varDepthFmt, varImagesC3D, varReductionFactor, and UImage::width().
Referenced by callGotNewDataWithObject(), makePCD(), and UFuncKinect().
bool UFuncKinect::makePCD | ( | const char * | name, |
bool | andRowCol | ||
) |
Make 3D object, either in PCD format for PCD viewer or in the old 3D format used by obj3d plugin.
name | is an optional filename for the generated file (NB same nale for both file formats). |
andRowCol | adds row and column from source image to the file |
References cloud3d, ULock::lock(), makeObj3Dcloud(), UImg3Dpoints::makePCLFile(), and ULock::unlock().
Referenced by handleKinect(), and UFuncKinect().
|
virtual |
Function to implement a var-pool method call.
name | is the name of the called function |
paramOrder | is a string with one char for each parameter in the call - d is double, s is string, c is class object. |
strings | is an array of string pointers for the string type parameters (may be NULL if not used) |
doubles | is an array with double typed parameters (may be NULL if not used) |
value | is the (direct) result of the class, either a double value, or 0.0 for false 1.0 for true 2.0 for implicit stop if a controll call. |
returnStruct | is an array of class object pointers that can be used as parameters or return objects (may be NULL) |
returnStructCnt | is the number of objects in the returnStruct buffer |
Reimplemented from UResVarPool.
References UVariable::getInt(), GetXYZCoordinates(), roundi(), and varReductionFactor.
Referenced by UFuncKinect().
|
virtual |
Function to implement an inter plug-in method call using UVariables as parameter (and return value). Structures of the base type UDatabase (but not UVariables) may be returned in the returnStruct pointer array. The returnStructCnt should be set to returned count, if values are returned.
name | is the name of the called function |
paramOrder | is a string with one char for each parameter in the call - d is double, s is string, c is class object. |
params | is an array of UVariable pointers, one pointer for each character in paramOrder. NB! params are not declared as constant, and may be used to return values. |
returnStruct | is an array of class object pointers that can be used as parameters or return objects (may be NULL) |
returnStructCnt | is the number of objects in the returnStruct buffer |
Reimplemented from UVarMethodImplement.
References cloud3d.
Referenced by UFuncKinect().
|
private |
produce fake disparity images - if requested.
img | is the true 16-bit depth image to process |
validBits | is number of valid bits in img |
References UImage::copyMeta(), UVariable::getBool(), UImage::getData(), UImage::getDepth(), UImage::getHeight(), UImagePool::getImage(), UVariable::getInt(), UFunctionBase::getStaticResource(), UImage::getWidth(), mini(), UPixel::set(), UImage::setName(), UImage::setSize(), UServerPush::setUpdated(), t_gamma, ULock::tryLock(), ULock::unlock(), UImage::updated(), varImagesC3D, varUseColor, and varUseDepthColor.
Referenced by callGotNewDataWithObject(), decodeReplayLine(), and UFuncKinect().
void UFuncKinect::run | ( | ) |
Run receive thread
References freenect_raw_tilt_state::accelerometer_x, freenect_raw_tilt_state::accelerometer_y, freenect_raw_tilt_state::accelerometer_z, UFunctionBase::aliasName, deviceUseInfo::depthFrameTime, deviceUseInfo::depthIdle, devUse, freenect_get_mks_accel(), freenect_get_tilt_degs(), freenect_get_tilt_state(), freenect_process_events(), freenect_set_led(), freenect_set_tilt_degs(), freenect_update_tilt_state(), UVariable::getBool(), UCamPool::getCam(), UCamBase::getDev(), UVariable::getDouble(), ULogFile::getF(), UVariable::getInt(), UTime::GetMicrosec(), UTime::GetSec(), UFunctionBase::getStaticResource(), UTime::getTimePassed(), UTime::getTimeval(), UVariable::getValued(), UImage::imageNumber, ULogFile::isLogOpen(), ULogFile::isOpen(), URotation::Kappa, KINECT_MAX_DEVICE_USE, lastLoopTime, ULock::lock(), logAcc, logDepthImage, logf, logFileTest(), logImage, logImageToFile(), logVideoImage, UCamPool::makeDevice(), maxi(), mini(), UTime::Now(), UTime::now(), oldCamDevC, oldCamDevD, oldLed, oldTilt, URotation::Omega, URotation::Phi, roundi(), UPosition::set(), UVariable::set3D(), UCamDevBase::setDevice(), UCamMounted::setMountName(), UVariable::setRot(), UVariable::setTime(), UCamBase::setTypeName(), UVariable::setValued(), deviceUseInfo::syncVideoFromDepth, threadRunning, threadStop, ULogFile::toLog(), UImageLog::toLog(), ULock::unlock(), deviceUseInfo::useDepthCnt, deviceUseInfo::useDepthFrame, deviceUseInfo::useVideoCnt, deviceUseInfo::useVideoFrame, varAcc, varAccInterval, varAccLogN, varAccRate, varCamDeviceNum, varFramerate, varFramerateDesired, varImageLogN, varIsOpen, varKinectNumber, varLed, varOrient, varResolution, varTiltDeg, varTiltUse, varTime, varUseDepth, deviceUseInfo::videoIdle, Wait(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by startUFuncKinectThread(), and UFuncKinect().
|
private |
Tell point cloud pool (PCP) that a point cloud owned by pcp, is updated
name | is name of updated point cloud. |
References UResVarPool::callGlobalV(), and UVariable::setValues().
Referenced by UFuncKinect(), and updateCloud().
|
private |
start read thread
References startUFuncKinectThread(), threadHandle, threadRunning, and threadStop.
Referenced by createResources(), and UFuncKinect().
|
privatevirtual |
stop read thread
andWait | waits until thread is terminated, when false, then the call returns when the stop flag is set (i.e. immidiately). |
Reimplemented from UResBase.
References threadHandle, threadRunning, and threadStop.
Referenced by UFuncKinect(), and ~UFuncKinect().
void UFuncKinect::updateCloud | ( | bool | color | ) |
Make PCL file from depth image without using PCL libraries Update point-cloud in point cloud pool (PCP), then name of the cloud is KINECT.
color | if true, then an XYZRGB cloud is maintained, else just a XYZ cloud. |
References UPcpItem::cloud, UPcpItem::cooSys, UVariable::getBool(), UCamPool::getCam(), UImagePool::getImage(), UImage::getImageTime(), UVariable::getInt(), UPcpItem::getPointsCnt(), UCamMounted::getPosRot(), UFunctionBase::getStaticResource(), GetXYZCoordinates(), ULock::lock(), UTime::now(), UPcpItem::relPose, UPcpItem::relPoseUse, UPcpItem::sensorTime, setPointCloudUpdated(), UPcpItem::shapeType, ULock::unlock(), UPcpItem::updateTime, varCamDeviceNum, varImagesC3D, varReductionFactor, varUseColor, UPcpItem::xyzp, and UPcpItem::xyzrgbp.
Referenced by handleKinect(), and UFuncKinect().
|
virtual |
is called when it is time to update replay status (after a step in some replay file)
Reimplemented from UResBase.
References UReplay::isReplay(), UVariable::setBool(), and varReplayLine.
Referenced by UFuncKinect().
|
private |
Referenced by createResources().
|
private |
Array with 3d points
Referenced by callGotNewDataWithObject(), makeObj3Dcloud(), makePCD(), methodCallV(), and ~UFuncKinect().
|
private |
number of accepter depth frames
Referenced by callGotNewDataWithObject(), and init().
|
private |
number of accepted video frames (rgb or ir)
Referenced by callGotNewDataWithObject(), and init().
|
private |
frame count for logging
Referenced by callGotNewDataWithObject().
|
private |
variable for frame rate calculation
Referenced by callGotNewDataWithObject().
|
private |
variable for frame rate calculation
Referenced by callGotNewDataWithObject().
|
private |
image buffer for color in 3d cloud
Referenced by init(), makeObj3Dcloud(), and ~UFuncKinect().
|
private |
Kinect loop keep-alive time
Referenced by handleKinect(), and run().
|
private |
Logfile for acceleration measurement
Referenced by createResources(), handleKinect(), logFileTest(), run(), and ~UFuncKinect().
|
private |
pointer to depth image to log
Referenced by callGotNewDataWithObject(), init(), and run().
|
private |
General Logfile
Referenced by callGotNewDataWithObject(), createResources(), handleKinect(), logFileTest(), run(), and ~UFuncKinect().
|
private |
Logfile
Referenced by createResources(), handleKinect(), logFileTest(), logImageToFile(), run(), and ~UFuncKinect().
|
private |
pointer to video (color or IR) image to log
Referenced by callGotNewDataWithObject(), init(), and run().
|
staticprivate |
|
private |
obj3d data structure
Referenced by init().
|
private |
last used focal length for rectified image
Referenced by GetXYZCoordinates(), init(), initXYTable(), and makeObj3Dcloud().
|
private |
Referenced by callGotNewDataWithObject(), init(), and run().
|
private |
Referenced by run().
|
private |
Depth correction table for kinect
Referenced by init(), and makeObj3Dcloud().
|
private |
Gamma correction table from 11-bit depth - for better display
Referenced by init(), and processDepthImages().
|
private |
X-Position correction table for kinect
Referenced by GetXYZCoordinates(), initXYTable(), and makeObj3Dcloud().
|
private |
Y-Position correction table for kinect
Referenced by GetXYZCoordinates(), initXYTable(), and makeObj3Dcloud().
|
private |
|
private |
|
private |
|
private |
Referenced by createResources(), and run().
|
private |
Referenced by createResources(), and run().
|
private |
Referenced by createResources(), handleKinect(), logFileTest(), and run().
|
private |
Referenced by createResources(), and run().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), GetXYZCoordinates(), makeObj3Dcloud(), run(), and updateCloud().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and makeObj3Dcloud().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
Referenced by createResources(), and run().
|
private |
Referenced by createResources(), handleKinect(), logFileTest(), logImageToFile(), and run().
|
private |
|
private |
is kinect initialized
Referenced by callGotNewDataWithObject(), createResources(), and ~UFuncKinect().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), handleKinect(), and run().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
Referenced by createResources(), and GetXYZCoordinates().
|
private |
Referenced by createResources(), and run().
|
private |
Referenced by createResources(), makeObj3Dcloud(), methodCall(), and updateCloud().
|
private |
Referenced by createResources(), decodeReplayLine(), and updateReplayStatus().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
processing parameters
Referenced by createResources(), GetXYZCoordinates(), and handleKinect().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), and run().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), decodeReplayLine(), and run().
|
private |
Pointers to "own" global variables.
Referenced by callGotNewDataWithObject(), and createResources().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), processDepthImages(), and updateCloud().
|
private |
Referenced by createResources().
|
private |
Referenced by callGotNewDataWithObject(), createResources(), handleKinect(), and run().
|
private |
Referenced by createResources(), handleKinect(), and processDepthImages().
|
private |
Referenced by callGotNewDataWithObject(), and createResources().
|
private |
Short explanation to why processing failed