AURobotServers
4
|
#include <uresdisp.h>
Public Member Functions | |
void | createBaseVar () |
void | doRepaintImages () |
UNavPaint * | getNavPaint () |
bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | loadImgToPool (const char *imgName, const int imgPoolNum) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *pars, double *value, UDataBase **returnStruct, int *returnStructCnt) |
void | mouseRescale (bool shiftKey) |
void | paintBold (bool bold) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
void | run () |
void | setAutoHereNow (bool value) |
void | setCROMASource (int cromaImg) |
void | setIntensMax (int val) |
void | setIntensMin (int val) |
void | setNewDataNav () |
void | setRangeRingCnt (int value) |
bool | setResource (UResBase *resource, bool remove) |
void | setRobot (const char *robname) |
void | setRobotPose (char *value) |
void | setScale (double value) |
void | setUVanalysisPosition (int x, int y) |
void | setUvRedisplay (bool value) |
void | setUVSource (int uvImg) |
virtual void | snprint (const char *preString, char *buff, int buffCnt) |
bool | start () |
void | stop (bool andWait) |
void | test4NewImages () |
UResDisp () | |
void | UResDispInit () |
~UResDisp () | |
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) |
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) |
virtual void | createResources () |
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 | print (const char *preString) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
virtual void | updateReplayStatus () |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
virtual bool | decodeReplayLine (char *) |
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 bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual | ~UVarMethodImplement () |
Static Public Member Functions | |
static const char * | getResID () |
static int | getResVersion () |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Protected Member Functions | |
void | addImagePoolImg (int imgPoolNum) |
bool | doFuzzyClassify (UImage *imgsrc) |
UPixel | getCroma (UPixel *rgb, int sourceFormat) |
int | getPixelClass (UPixel yuv, int clustCnt, bool isCROMA) |
void | paintClustEllipse (bool isUV, UMatrix *mV, UMatrix *mQ, UImage *img, int clust) |
void | paintClustPixels (bool isUV, UImage *imgsrc, UImage *imgUV) |
void | removeImagePoolImg (int imgPoolNum) |
void | showUVImage (bool asCROMA) |
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... | |
Static Protected Attributes | |
static const int | UPD_LIST_MAX_CNT = 100 |
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... | |
Private Attributes | |
UImage * | imgBuf |
bool | stopFlag |
pthread_t | thDisp |
Additional Inherited Members | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Display of laserdata using the HIGHGUI library
@author Christian <chrand@mail.dk>
|
inline |
Constructor
References globalThresholdMax, and globalThresholdMin.
UResDisp::~UResDisp | ( | ) |
Destructor
|
protected |
Display this image, and redisplay, when updated
References UHighGuiWindowHandle::getImageNum(), and UHighGuiWindowHandle::setImage().
void UResDisp::createBaseVar | ( | ) |
Create basic polygon values
|
protected |
Classify mouse sample and the-rest into two clusters
void UResDisp::doRepaintImages | ( | ) |
Repaint images in the image pool
References UHighGuiWindowHandle::getImageNum(), UTime::getTimePassed(), globalUvRedisplay, UHighGuiWindowHandle::isTime(), UTime::Now(), and UHighGuiWindowHandle::showImage().
Convert this BGR pixel to a cromatisity only pixel
|
inline |
Get top-view painter
Referenced by UFunctionDisp::handleCommand().
|
protected |
Get cluster number for this pixel. Must know the number of classes the pixels are divided into.
|
inlinestatic |
Fixed name of this resource type
|
inlinestatic |
Fixed varsion number for this resource type. Should follow release version, i.e. version 1.28 gives number 128. Should be incremented only when there is change to this class definition, i.e new or changed functions or variables.
|
virtual |
Is this resource missing any base ressources
Reimplemented from UResVarPool.
References UResPoseHist::getOdoPoseID(), UImagePool::getResClassID(), UResVarPool::getResClassID(), and UResVarPool::gotAllResources().
bool UResDisp::loadImgToPool | ( | const char * | imgName, |
const int | imgPoolNum | ||
) |
Load this image into the image pool
References UHighGuiWindowHandle::img, UImage::loadBMP(), UImage::loadPNG(), and UImage::updated().
Referenced by UFunctionDisp::handleCommand().
|
virtual |
The varPool has methods, and a call to one of these are needed. Do the call now and return (a double sized) result in 'value' and return true if the method call is allowed.
Reimplemented from UResVarPool.
void UResDisp::mouseRescale | ( | bool | shiftKey | ) |
Rescale based on Ctrl-mouse click or shift-ctrl click or ctrl - square
References absi(), globalPixPoint1, globalPixPoint2, and globalPixPointS.
void UResDisp::paintBold | ( | bool | bold | ) |
Try capture an image using openCV highGUI
camIdx | is the camera device number to use Set the paint bold flag |
bold | true or false |
Referenced by UFunctionDisp::handleCommand().
|
protected |
Paint cluster covariance ellipse in UV image, if not UV, then cromatisity
Paint pixels within 'clust' into image in blue
|
virtual |
Print status for this resource
Reimplemented from UResVarPool.
|
protected |
Remove this image, as it is about to be resized
References UHighGuiWindowHandle::getImageNum(), and UHighGuiWindowHandle::removeImage().
void UResDisp::run | ( | ) |
Repaint loop
References globalMouseFlag, globalNavRedisplay, and Wait().
Referenced by startSdlDisp().
|
inline |
set automatic herenow flag
References UHighGuiWindowHandle::img.
Referenced by UFunctionDisp::handleCommand().
|
inline |
Set UV image source
Referenced by UFunctionDisp::handleCommand().
|
inline |
Set UV/CROMA analysis intensity maximum
References globalThresholdMax.
Referenced by UFunctionDisp::handleCommand().
|
inline |
Set UV/CROMA analysis intensity minimum
References globalThresholdMin.
Referenced by UFunctionDisp::handleCommand().
|
inline |
Set navigation data flag to update image
Referenced by UFunctionDisp::handleCommand().
void UResDisp::setRangeRingCnt | ( | int | value | ) |
Set number of range rings
Referenced by UFunctionDisp::handleCommand().
|
virtual |
Set ressource as needed (probably not used by this resource)
Reimplemented from UResVarPool.
References UResPoseHist::getMapPoseID(), UResPoseHist::getOdoPoseID(), UImagePool::getResClassID(), UResBase::getResID(), UResPoseHist::getUtmPoseID(), UResBase::isA(), and UResBase::setResource().
void UResDisp::setRobot | ( | const char * | robname | ) |
Set robot type.
robname | is the type name of the robot - smr, mmr or hako |
Referenced by UFunctionDisp::handleCommand().
void UResDisp::setRobotPose | ( | char * | value | ) |
Set position of robot on display - in meters from bottom position
value | is a string with pose values as a string, p.t. the first cvalue is used only. |
Referenced by UFunctionDisp::handleCommand().
void UResDisp::setScale | ( | double | value | ) |
Set scale (height of display in meters
Referenced by UFunctionDisp::handleCommand().
void UResDisp::setUVanalysisPosition | ( | int | x, |
int | y | ||
) |
Set analysis pixel for UV/CROMA images
X | x-position in source image |
Y | y position in source image |
References globalPixPoint2.
Referenced by UFunctionDisp::handleCommand().
void UResDisp::setUvRedisplay | ( | bool | value | ) |
set automatic herenow flag
References globalUvRedisplay.
Referenced by UFunctionDisp::handleCommand().
|
inline |
Set UV image source
Referenced by UFunctionDisp::handleCommand().
|
protected |
Paint an UV image from the source image in the variable 'imgSourceUV'
asCroma | if false, then show as UV analysis, if trye, then as cromatisity analysis |
References UPixel::asBGR(), UPixel::asYUV(), UImage::clear(), UImage::cvArr(), UImage::getColorType(), UPixel::getGreen(), UImage::getLine(), UImage::getPix(), UImage::getPixRef(), UPixel::getRed(), globalPixPoint2, globalThresholdMax, globalThresholdMin, UImage::height(), UImage::isBGR(), UImage::isBW(), UImage::isRGB(), UImage::isYUV(), ULock::lock(), maxi(), mini(), UImage::name, UPixel::p1, UPixel::p2, UPixel::p3, UImage::paintGridAligned(), PIX_PLANES_BGR, roundi(), UImage::setPix(), UPixel::setRGBto(), UImage::setSize(), UPixel::setYUVto(), UPixel::tone(), UImage::toRGB(), UPixel::u, ULock::unlock(), UImage::updated(), UImage::used, UPixel::v, UImage::width(), and UPixel::y.
|
inlinevirtual |
Print status for this resource
bool UResDisp::start | ( | ) |
|
virtual |
void UResDisp::test4NewImages | ( | ) |
See if new images has emerged in image pool that is not on the display list
References UHighGuiWindowHandle::img, and UImage::used.
void UResDisp::UResDispInit | ( | ) |
Initialize class
|
protected |
Display sync lock
|
protected |
colour analysis intensity limits
|
protected |
colour analysis intensity limits
|
private |
Image buffer if UV or croma image is not in an appropriate format
|
protected |
Pointer to image pool resource
|
protected |
image reference for CROMATICITY analysis
|
protected |
Image source for UV/CROMA image
|
protected |
Painter for navigation image
|
protected |
New data received to image pool
|
protected |
Time of newest data update of image in image pool
|
protected |
New data received - laser data
|
protected |
Time of newest data update of data for laser plane display
|
protected |
New data received - navigation data
|
protected |
Time of newest data update of data for laser plane display
|
protected |
Pointer to a pose history module with current robot position
|
protected |
Pointer to a pose history module with current robot position in map coordinates
|
protected |
Pointer to a pose history module with current robot position in GPS (UTM) coordinates
|
private |
Stop flag for display thread
|
private |
Thread handle for main loop.
|
staticprotected |
allowed number of highgui displayed images
|
protected |
Array of relations between openCV images and SDL draw surfaces
|
protected |
Number of used entries in the image update list
|
protected |
should coordinate systems be alligned at robot always
|
protected |
paint bold
|
protected |
main laser navigation image number in image pool
|
protected |
pos of robot on top view
|
protected |
number of range rings to paint (each 1m)
|
protected |
Pointer to a (root) var-pool with access to all sub-structures
|
protected |
Index to variable with thread running value
|
protected |
scale
|
protected |
should HIGHGUI be used to display images (conflict with gstream)
|
protected |
used by the UV image and cromaticity image to limit colour display
|
protected |
used by the UV image and cromaticity image to limit colour display