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

#include <uresdisp.h>

Inheritance diagram for UResDisp:
Inheritance graph

Public Member Functions

void createBaseVar ()
 
void doRepaintImages ()
 
UNavPaintgetNavPaint ()
 
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)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (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)
 
UVarCalcgetVarPool ()
 
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 ()
 
UCmdExegetCorePointer ()
 
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
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 

Protected Attributes

ULock dispSync
 
int globalThresholdMax
 colour analysis intensity limits More...
 
int globalThresholdMin
 colour analysis intensity limits More...
 
UImagePoolimgPool
 
int imgSourceCROMA
 
int imgSourceUV
 
UNavPaint navPaint
 
bool newDataImgPool
 
UTime newDataImgPoolAt
 
bool newDataLaser
 
UTime newDataLaserAt
 
bool newDataNav
 
UTime newDataNavAt
 
UResPoseHistposeHist
 
UResPoseHistposeMap
 
UResPoseHistposeUtm
 
UHighGuiWindowHandle updList [UPD_LIST_MAX_CNT]
 
int updListCnt
 
UVariablevarAutoHereNow
 should coordinate systems be alligned at robot always More...
 
UVariablevarBold
 paint bold More...
 
UVariablevarNavImg
 
UVariablevarPos
 pos of robot on top view More...
 
UVariablevarRangeRings
 number of range rings to paint (each 1m) More...
 
UResVarPoolvarRoot
 
UVariablevarRunning
 
UVariablevarScale
 scale More...
 
UVariablevarUseHighGUI
 should HIGHGUI be used to display images (conflict with gstream) More...
 
UVariablevarUVCROMAmaxY
 used by the UV image and cromaticity image to limit colour display More...
 
UVariablevarUVCROMAminY
 used by the UV image and cromaticity image to limit colour display More...
 
- 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
 
UReplayreplayParent
 
UTime replayTimeNext
 

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

UImageimgBuf
 
bool stopFlag
 
pthread_t thDisp
 

Additional Inherited Members

- Public Attributes inherited from UReplay
bool replayTimeAdvancePending
 
UTime replayTimeNow
 

Detailed Description

Display of laserdata using the HIGHGUI library

    @author Christian <chrand@mail.dk>

Constructor & Destructor Documentation

UResDisp::UResDisp ( )
inline

Constructor

References globalThresholdMax, and globalThresholdMin.

UResDisp::~UResDisp ( )

Destructor

Member Function Documentation

void UResDisp::addImagePoolImg ( int  imgPoolNum)
protected

Display this image, and redisplay, when updated

References UHighGuiWindowHandle::getImageNum(), and UHighGuiWindowHandle::setImage().

void UResDisp::createBaseVar ( )

Create basic polygon values

bool UResDisp::doFuzzyClassify ( UImage imgsrc)
protected

Classify mouse sample and the-rest into two clusters

void UResDisp::doRepaintImages ( )
UPixel UResDisp::getCroma ( UPixel rgb,
int  sourceFormat 
)
protected

Convert this BGR pixel to a cromatisity only pixel

UNavPaint* UResDisp::getNavPaint ( )
inline

Get top-view painter

Referenced by UFunctionDisp::handleCommand().

int UResDisp::getPixelClass ( UPixel  yuv,
int  clustCnt,
bool  isCROMA 
)
protected

Get cluster number for this pixel. Must know the number of classes the pixels are divided into.

static const char* UResDisp::getResID ( )
inlinestatic

Fixed name of this resource type

static int UResDisp::getResVersion ( )
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.

bool UResDisp::gotAllResources ( char *  missingThese,
int  missingTheseCnt 
)
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().

bool UResDisp::methodCall ( const char *  name,
const char *  paramOrder,
char **  strings,
const double *  pars,
double *  value,
UDataBase **  returnStruct,
int *  returnStructCnt 
)
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

Parameters
camIdxis the camera device number to use Set the paint bold flag
boldtrue or false

Referenced by UFunctionDisp::handleCommand().

void UResDisp::paintClustEllipse ( bool  isUV,
UMatrix mV,
UMatrix mQ,
UImage img,
int  clust 
)
protected

Paint cluster covariance ellipse in UV image, if not UV, then cromatisity

void UResDisp::paintClustPixels ( bool  isUV,
UImage imgsrc,
UImage imgUV 
)
protected

Paint pixels within 'clust' into image in blue

const char * UResDisp::print ( const char *  preString,
char *  buff,
int  buffCnt 
)
virtual

Print status for this resource

Reimplemented from UResVarPool.

void UResDisp::removeImagePoolImg ( int  imgPoolNum)
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().

void UResDisp::setAutoHereNow ( bool  value)
inline

set automatic herenow flag

References UHighGuiWindowHandle::img.

Referenced by UFunctionDisp::handleCommand().

void UResDisp::setCROMASource ( int  cromaImg)
inline

Set UV image source

Referenced by UFunctionDisp::handleCommand().

void UResDisp::setIntensMax ( int  val)
inline

Set UV/CROMA analysis intensity maximum

References globalThresholdMax.

Referenced by UFunctionDisp::handleCommand().

void UResDisp::setIntensMin ( int  val)
inline

Set UV/CROMA analysis intensity minimum

References globalThresholdMin.

Referenced by UFunctionDisp::handleCommand().

void UResDisp::setNewDataNav ( )
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().

bool UResDisp::setResource ( UResBase resource,
bool  remove 
)
virtual
void UResDisp::setRobot ( const char *  robname)

Set robot type.

Parameters
robnameis 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

Parameters
valueis 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

Parameters
Xx-position in source image
Yy 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().

void UResDisp::setUVSource ( int  uvImg)
inline

Set UV image source

Referenced by UFunctionDisp::handleCommand().

void UResDisp::showUVImage ( bool  asCROMA)
protected
virtual void UResDisp::snprint ( const char *  preString,
char *  buff,
int  buffCnt 
)
inlinevirtual

Print status for this resource

bool UResDisp::start ( )

Start repaint loop

References startSdlDisp().

Referenced by UFunctionDisp::createResources().

void UResDisp::stop ( bool  andWait)
virtual

Stop repaint loop

Reimplemented from UResBase.

References Wait().

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

Member Data Documentation

ULock UResDisp::dispSync
protected

Display sync lock

int UResDisp::globalThresholdMax
protected

colour analysis intensity limits

int UResDisp::globalThresholdMin
protected

colour analysis intensity limits

UImage* UResDisp::imgBuf
private

Image buffer if UV or croma image is not in an appropriate format

UImagePool* UResDisp::imgPool
protected

Pointer to image pool resource

int UResDisp::imgSourceCROMA
protected

image reference for CROMATICITY analysis

int UResDisp::imgSourceUV
protected

Image source for UV/CROMA image

UNavPaint UResDisp::navPaint
protected

Painter for navigation image

bool UResDisp::newDataImgPool
protected

New data received to image pool

UTime UResDisp::newDataImgPoolAt
protected

Time of newest data update of image in image pool

bool UResDisp::newDataLaser
protected

New data received - laser data

UTime UResDisp::newDataLaserAt
protected

Time of newest data update of data for laser plane display

bool UResDisp::newDataNav
protected

New data received - navigation data

UTime UResDisp::newDataNavAt
protected

Time of newest data update of data for laser plane display

UResPoseHist* UResDisp::poseHist
protected

Pointer to a pose history module with current robot position

UResPoseHist* UResDisp::poseMap
protected

Pointer to a pose history module with current robot position in map coordinates

UResPoseHist* UResDisp::poseUtm
protected

Pointer to a pose history module with current robot position in GPS (UTM) coordinates

bool UResDisp::stopFlag
private

Stop flag for display thread

pthread_t UResDisp::thDisp
private

Thread handle for main loop.

const int UResDisp::UPD_LIST_MAX_CNT = 100
staticprotected

allowed number of highgui displayed images

UHighGuiWindowHandle UResDisp::updList[UPD_LIST_MAX_CNT]
protected

Array of relations between openCV images and SDL draw surfaces

int UResDisp::updListCnt
protected

Number of used entries in the image update list

UVariable* UResDisp::varAutoHereNow
protected

should coordinate systems be alligned at robot always

UVariable* UResDisp::varBold
protected

paint bold

UVariable* UResDisp::varNavImg
protected

main laser navigation image number in image pool

UVariable* UResDisp::varPos
protected

pos of robot on top view

UVariable* UResDisp::varRangeRings
protected

number of range rings to paint (each 1m)

UResVarPool* UResDisp::varRoot
protected

Pointer to a (root) var-pool with access to all sub-structures

UVariable* UResDisp::varRunning
protected

Index to variable with thread running value

UVariable* UResDisp::varScale
protected

scale

UVariable* UResDisp::varUseHighGUI
protected

should HIGHGUI be used to display images (conflict with gstream)

UVariable* UResDisp::varUVCROMAmaxY
protected

used by the UV image and cromaticity image to limit colour display

UVariable* UResDisp::varUVCROMAminY
protected

used by the UV image and cromaticity image to limit colour display


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