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

#include <uclientfunclasergui.h>

Inheritance diagram for UClientFuncLaserGui:
Inheritance graph

Public Member Functions

void clear ()
 
void doImage (UHighGuiWindowHandle *sourceImg, char *imgFullName, UPosition *imPos=NULL, URotation *imRot=NULL)
 
double getHeight ()
 
UPosition getPixToRobFloor (UPosition camPos, URotation camRot, double f, int w, int h, int x, int y)
 
double getRobPos ()
 
bool getSaveImages ()
 
virtual bool onEvent (const char *interface, const char *dataType, void *data)
 
void repaint ()
 
bool saveImage ()
 
void setHistDisplay (int scansToDisplay)
 
void setObstList (UObstHist *value)
 
bool setPaintVar (const char *name, const char *value)
 
void setSaveImages (bool value)
 
void setScale (double height)
 
void setScale (double height, double mmrPos)
 
void setSfPool (USFPool *pool)
 
 UClientFuncLaserGui ()
 
virtual ~UClientFuncLaserGui ()
 
- Public Member Functions inherited from UClientFuncLaser
virtual void changedNamespace (const char *newNamespace)
 
virtual const char * commandList ()
 
virtual void handleNewData (USmlTag *tag, const char *ifname)
 
virtual const char * name ()
 
 UClientFuncLaser ()
 
virtual ~UClientFuncLaser ()
 
- Public Member Functions inherited from UClientFuncBase
int getMsgCnt ()
 
bool getVerbose ()
 
bool sendMsg (UClientPortSml *cnn, const char *buff, int buffCnt)
 
bool sendMsg (UClientPortSml *cnn, const char *buff)
 
void setVerbose (bool value)
 
 UClientFuncBase ()
 
virtual ~UClientFuncBase ()
 
- Public Member Functions inherited from UCallBack
bool addOnEvent (UOnEvent *dataObject)
 
 UCallBack ()
 
virtual ~UCallBack ()
 

Public Attributes

bool paintBold
 
bool paintCurves
 
bool paintGPS
 
bool paintGridOdo
 
double paintGridSize
 
bool paintIntervalLines
 
bool paintMmr
 
bool paintObst
 
bool paintPathAll
 
int paintPathHistCnt
 
bool paintPathLines
 
bool paintPathLinesAll
 
bool paintPlan
 
bool paintRoadLines
 
int paintScanHistCnt
 
bool paintSpeed
 
bool paintVar
 
bool paintVisPoly
 
int paintVisPolyCnt
 
- Public Attributes inherited from UClientFuncBase
ULock decodeLock
 

Protected Member Functions

bool doRepaint (ULaserDataSet *scan)
 
virtual void doTimeTick ()
 
virtual bool gotNewData (ULaserDataSet *scan)
 
bool paintNewestScan ()
 
- Protected Member Functions inherited from UClientFuncLaser
UTime getLaserTime (int histNum)
 
virtual bool gotNewEkfData ()
 
virtual bool gotNewFreePolyData ()
 
virtual bool gotNewPathData ()
 
virtual bool gotNewPlanData ()
 
void setPose (UPoseTime poseTime)
 
void setPoseIfNewer (UPose pose, UTime t)
 
- Protected Member Functions inherited from UClientFuncBase
void handleHelp (USmlTag *tag)
 
void printReply (USmlTagIn *tag, const char *preString)
 

Private Member Functions

void paintCross (UImage *img, int x, int y, int size, CvScalar col, int lineWidth)
 
bool paintEkfData ()
 
void paintFreePoly (UProbPoly *poly, UPose seenFromPose, bool historic)
 
void paintHistScan (UImage *img, ULaserDataSet *scan, UPose seenFromPose, UPose *lastPose)
 
void paintLineSegments (UPose seenFromPose)
 
void paintObstGrp (UImage *img, UObstacleGroup *obst, UPose seenFromPose, int grpIdx)
 
bool paintOdoData (UPose seenFromPose)
 
void paintOdoDest (UImage *img, UPose seenFromPose)
 
bool paintOdoGrid (double stepSize, bool bold)
 
bool paintPathData (ULaserPathResult *path, int num)
 
void paintPis (UImage *img, ULaserDataSet *scan, UPose seenFromPose, const int cnt)
 
bool paintPlannerData (bool paintAll)
 
void paintPose (UImage *img, int x, int y, double h, int size, CvScalar col, int lineWidth)
 
void paintPostHistLine (UImage *img, ULaserDataSet *scan, UPose seenFromPose, UPose *lastPose)
 
bool paintRangeRings (CvPoint robPos, UPosition devPos)
 
bool paintRobotMmr (CvPoint robPos)
 
bool paintRobotSmr (CvPoint robPos)
 
bool paintScanStatData (ULaserDataSet *scan, bool paintVar, bool paintVarL, bool paintTilt)
 
bool paintWpc (ULaserWpc *wpc)
 
void paintWpListData ()
 

Private Attributes

UHighGuiWindowHandle cvw
 
UImageimg
 
double MaxRange
 
UObstHistobsts
 
bool repaintImage
 
UTime repaintImageTime
 
bool saveImages
 
bool scannerWindowOK
 
USFPoolsfPool
 
double StartPos
 
UTime t1
 
int updates
 

Additional Inherited Members

- Protected Attributes inherited from UClientFuncLaser
UPosition ciGoal
 
UPose ekfPose
 
UTime ekfTime
 
int ekfuSkipd
 
int ekfuUsed
 
UProbPoly freePoly [MAX_FREE_POLY_HIST]
 
int freePolyCnt
 
int freePolyNewest
 
UPosRot laserPose
 
UPoseTime odoPose
 
ULaserPathResultpaths [MAX_NEW_PATH_CANDIDATES]
 
int pathsCnt
 
UPlannerData planner
 
UPoseTime poseHist [MAX_POSE_HIST]
 
int poseHistCnt
 
int poseHistNewest
 
ULaserDataHistory scanHist
 
UPose toPose
 
ULaserWpc wpcData
 
- Protected Attributes inherited from UClientFuncBase
int msgHandled
 
char serverNamespace [MAX_SML_NAME_LENGTH]
 
int serverNamespaceValue
 
bool verboseMessages
 

Detailed Description

Shows a receiced laser scan

Author
Christian Andersen

Constructor & Destructor Documentation

UClientFuncLaserGui::UClientFuncLaserGui ( )
UClientFuncLaserGui::~UClientFuncLaserGui ( )
virtual

Destructor

Member Function Documentation

void UClientFuncLaserGui::clear ( void  )
void UClientFuncLaserGui::doImage ( UHighGuiWindowHandle sourceImg,
char *  imgFullName,
UPosition imPos = NULL,
URotation imRot = NULL 
)
bool UClientFuncLaserGui::doRepaint ( ULaserDataSet scan)
protected

Do the acual repaint of laser scan related data

References UImage::clear(), UImage::cvArr(), UClientFuncLaser::freePoly, UClientFuncLaser::freePolyCnt, UClientFuncLaser::freePolyNewest, ULaserDataSet::getCount(), ULaserDataSet::getData(), UObstHist::getGroup(), UObstHist::getGrpsCnt(), ULaserDataSet::getPisCnt(), UPosRot::getPos(), ULaserDataSet::getPose(), ULaserData::getPosition(), UPosRot::getRtoMMatrix(), ULaserDataHistory::getScan(), ULaserDataHistory::getScansCnt(), ULaserDataSet::getScanTime(), ULaserDataSet::getSensorPose(), ULaserDataSet::getSerial(), UImage::height(), img, ULaserData::inZoneA(), ULaserData::inZoneB(), ULaserData::isDazzled(), ULaserDataSet::isStatValid(), UClientFuncLaser::laserPose, MaxRange, mini(), obsts, UClientFuncLaser::odoPose, paintBold, paintCross(), paintCurves, paintEkfData(), paintFreePoly(), paintGPS, paintGridOdo, paintGridSize, paintHistScan(), paintIntervalLines, paintLineSegments(), paintMmr, paintObst, paintObstGrp(), paintOdoData(), paintOdoDest(), paintOdoGrid(), paintPathData(), paintPathHistCnt, paintPathLines, paintPis(), paintPlan, paintPlannerData(), paintPostHistLine(), paintRangeRings(), paintRobotMmr(), paintRobotSmr(), paintScanHistCnt, paintScanStatData(), paintSpeed, paintVar, paintVisPoly, paintVisPolyCnt, paintWpc(), UClientFuncLaser::paths, UClientFuncLaser::pathsCnt, roundi(), saveImage(), saveImages, UClientFuncLaser::scanHist, scannerWindowOK, UPoseTime::setPt(), UImage::setSize(), StartPos, UPoseTime::t, updates, UImage::width(), UClientFuncLaser::wpcData, UPosition::x, and UPosition::y.

Referenced by getRobPos(), and paintNewestScan().

void UClientFuncLaserGui::doTimeTick ( )
protectedvirtual

Called when idle

Reimplemented from UClientFuncBase.

References UTime::getTimePassed(), paintNewestScan(), repaintImage, and repaintImageTime.

Referenced by getRobPos().

double UClientFuncLaserGui::getHeight ( )
inline

Paint the used set of passable intervals in this image. Assume image pose is known Get display window height

References MaxRange.

Referenced by clientCmdLine().

UPosition UClientFuncLaserGui::getPixToRobFloor ( UPosition  camPos,
URotation  camRot,
double  f,
int  w,
int  h,
int  x,
int  y 
)

Get position on robot floor for this (x,y) pixel position, given camera position/rotation (in robot coordinates), the image size and the focal length. Result may be invalid if line is parallel to plane and behind robot if pointing up. f is focal length (in pixels) and (w,h) is image size matching this focal length. Returns position where a line in the pixel direction crosses the floor plane.

References URotation::asMatrix4x4RtoM(), ULine::getPlaneLineCrossing(), UCamPar::getPtoCRob(), UCamPar::setCameraParameters(), and ULine::setFromPoints().

Referenced by doImage(), and getRobPos().

double UClientFuncLaserGui::getRobPos ( )
inline
bool UClientFuncLaserGui::getSaveImages ( )
inline

Get save status

References clear(), and saveImages.

Referenced by clientCmdLine().

bool UClientFuncLaserGui::gotNewData ( ULaserDataSet scan)
protectedvirtual

Called when a new scan is received

Reimplemented from UClientFuncLaser.

References repaint().

Referenced by getRobPos().

bool UClientFuncLaserGui::onEvent ( const char *  interface,
const char *  dataType,
void *  data 
)
virtual
void UClientFuncLaserGui::paintCross ( UImage img,
int  x,
int  y,
int  size,
CvScalar  col,
int  lineWidth 
)
private

Paint a cross in image (2 lines in an x) at position x,y with size in pixels across. In this color

References UImage::cvArr().

Referenced by doRepaint(), getRobPos(), and paintPathData().

bool UClientFuncLaserGui::paintEkfData ( )
private
void UClientFuncLaserGui::paintFreePoly ( UProbPoly poly,
UPose  seenFromPose,
bool  historic 
)
private
void UClientFuncLaserGui::paintHistScan ( UImage img,
ULaserDataSet scan,
UPose  seenFromPose,
UPose lastPose 
)
private
void UClientFuncLaserGui::paintLineSegments ( UPose  seenFromPose)
private
bool UClientFuncLaserGui::paintNewestScan ( )
protected

Repaint newest scan (with potentially new settings

References doRepaint(), ULaserDataHistory::getNewest(), ULaserDataHistory::getScansCnt(), and UClientFuncLaser::scanHist.

Referenced by doTimeTick(), and getRobPos().

void UClientFuncLaserGui::paintObstGrp ( UImage img,
UObstacleGroup obst,
UPose  seenFromPose,
int  grpIdx 
)
private
bool UClientFuncLaserGui::paintOdoData ( UPose  seenFromPose)
private
void UClientFuncLaserGui::paintOdoDest ( UImage img,
UPose  seenFromPose 
)
private

Paint odometry end pose, using endPoseX, endPoseY, endPoseH from calculator.

References UPlannerData::findPose(), UPose::getMapToPosePose(), UPose::h, UImage::height(), MaxRange, paintBold, paintPose(), UClientFuncLaser::planner, roundi(), StartPos, UImage::width(), UPose::x, and UPose::y.

Referenced by doRepaint(), and getRobPos().

bool UClientFuncLaserGui::paintOdoGrid ( double  stepSize,
bool  bold 
)
private
bool UClientFuncLaserGui::paintPathData ( ULaserPathResult path,
int  num 
)
private
void UClientFuncLaserGui::paintPis ( UImage img,
ULaserDataSet scan,
UPose  seenFromPose,
const int  cnt 
)
private
bool UClientFuncLaserGui::paintPlannerData ( bool  paintAll)
private
void UClientFuncLaserGui::paintPose ( UImage img,
int  x,
int  y,
double  h,
int  size,
CvScalar  col,
int  lineWidth 
)
private

Paint a pose circle with heading vector

References UImage::cvArr(), and roundi().

Referenced by getRobPos(), and paintOdoDest().

void UClientFuncLaserGui::paintPostHistLine ( UImage img,
ULaserDataSet scan,
UPose  seenFromPose,
UPose lastPose 
)
private
bool UClientFuncLaserGui::paintRangeRings ( CvPoint  robPos,
UPosition  devPos 
)
private

Paint laser scanner range circles

References UImage::cvArr(), UImage::height(), img, MaxRange, paintBold, roundi(), UPosition::x, and UPosition::y.

Referenced by doRepaint(), and getRobPos().

bool UClientFuncLaserGui::paintRobotMmr ( CvPoint  robPos)
private
bool UClientFuncLaserGui::paintRobotSmr ( CvPoint  robPos)
private
bool UClientFuncLaserGui::paintScanStatData ( ULaserDataSet scan,
bool  paintVar,
bool  paintVarL,
bool  paintTilt 
)
private
bool UClientFuncLaserGui::paintWpc ( ULaserWpc wpc)
private
void UClientFuncLaserGui::paintWpListData ( )
private
void UClientFuncLaserGui::repaint ( )

Set repaint flag

References UTime::Now(), repaintImage, and repaintImageTime.

Referenced by clientCmdLine(), gotNewData(), onEvent(), and setScale().

bool UClientFuncLaserGui::saveImage ( )
void UClientFuncLaserGui::setHistDisplay ( int  scansToDisplay)
inline

Set number of history scans to display. default is -1, that is all available scans

References paintScanHistCnt.

Referenced by clientCmdLine().

void UClientFuncLaserGui::setObstList ( UObstHist value)

Set pointer to obstacles

References UCallBack::addOnEvent(), and obsts.

Referenced by clientCmdLine(), and getRobPos().

bool UClientFuncLaserGui::setPaintVar ( const char *  name,
const char *  value 
)
void UClientFuncLaserGui::setSaveImages ( bool  value)
inline

Save images at every update

References saveImages.

Referenced by clientCmdLine().

void UClientFuncLaserGui::setScale ( double  height)
inline

Set scale of MMR image i.e. height of image in meter

References MaxRange.

Referenced by clientCmdLine().

void UClientFuncLaserGui::setScale ( double  height,
double  mmrPos 
)
inline

Set MMR image height and position of mmr. All in meter.

References doImage(), MaxRange, UClientFuncLaser::name(), repaint(), setPaintVar(), and StartPos.

void UClientFuncLaserGui::setSfPool ( USFPool pool)

Set pointer to scan feature pool

References UCallBack::addOnEvent(), and sfPool.

Referenced by clientCmdLine(), and getRobPos().

Member Data Documentation

UHighGuiWindowHandle UClientFuncLaserGui::cvw
private

openCV variables to show image

Referenced by doImage().

UImage* UClientFuncLaserGui::img
private
double UClientFuncLaserGui::MaxRange
private
UObstHist* UClientFuncLaserGui::obsts
private

Pointer to obstacle list

Referenced by doRepaint(), onEvent(), setObstList(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintBold
bool UClientFuncLaserGui::paintCurves

Paint statistical curves

Referenced by doRepaint(), and setPaintVar().

bool UClientFuncLaserGui::paintGPS

Paint all support stuff Paint EKF (GPS) data

Referenced by doRepaint(), and setPaintVar().

bool UClientFuncLaserGui::paintGridOdo

paint grid (rectangular odo grid

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

double UClientFuncLaserGui::paintGridSize

Distance between grid lines - in meter

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintIntervalLines

Paint interval lines

Referenced by doImage(), doRepaint(), paintPathData(), and setPaintVar().

bool UClientFuncLaserGui::paintMmr

Paint robot as an MMR (else and smr)

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintObst

Paint planning info (var and mission line)

Referenced by doRepaint(), and setPaintVar().

bool UClientFuncLaserGui::paintPathAll

Pint all planned routes

Referenced by paintPathData(), setPaintVar(), and UClientFuncLaserGui().

int UClientFuncLaserGui::paintPathHistCnt

Number of scans to use in path hist

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintPathLines

Paint path lines - alternative and used path

Referenced by doRepaint(), paintPathData(), and setPaintVar().

bool UClientFuncLaserGui::paintPathLinesAll

Paint path lines for all, also alternaive paths

Referenced by doImage(), paintPathData(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintPlan

Paint planning info (var and mission line)

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintRoadLines

Paint road lines

Referenced by paintPathData(), and setPaintVar().

int UClientFuncLaserGui::paintScanHistCnt

Number of scans to use in path hist

Referenced by doRepaint(), paintLineSegments(), setHistDisplay(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::paintSpeed

Paint robot speed

Referenced by doRepaint(), and setPaintVar().

bool UClientFuncLaserGui::paintVar

Paint variables

Referenced by doRepaint(), getRobPos(), and setPaintVar().

bool UClientFuncLaserGui::paintVisPoly

Paint vision based polygon

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

int UClientFuncLaserGui::paintVisPolyCnt

Number of vision poygons to paint

Referenced by doRepaint(), setPaintVar(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::repaintImage
private

Flag to indicate that image should be repainted

Referenced by doTimeTick(), and repaint().

UTime UClientFuncLaserGui::repaintImageTime
private

Timestamp of oldest data not painted

Referenced by doTimeTick(), and repaint().

bool UClientFuncLaserGui::saveImages
private

Save image at every update?

Referenced by doRepaint(), getSaveImages(), setSaveImages(), and UClientFuncLaserGui().

bool UClientFuncLaserGui::scannerWindowOK
private

Is laser scanner window created

Referenced by clear(), doRepaint(), and UClientFuncLaserGui().

USFPool* UClientFuncLaserGui::sfPool
private

Pointer to scanfeatures

Referenced by clear(), onEvent(), paintLineSegments(), saveImage(), setSfPool(), and UClientFuncLaserGui().

double UClientFuncLaserGui::StartPos
private
UTime UClientFuncLaserGui::t1
private

timeing?

Referenced by paintOdoData().

int UClientFuncLaserGui::updates
private

Number of updates that is received

Referenced by doRepaint(), and UClientFuncLaserGui().


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