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

#include <ugmk.h>

Inheritance diagram for UGmk:
Inheritance graph

Public Member Functions

void clear ()
 
const char * getCode ()
 
unsigned long getCodeInt ()
 
UTime getTime ()
 
bool isCrcValid ()
 
bool isPosValid ()
 
bool isValid ()
 
void set (const char *newCode)
 
void set (UPosition pos, URotation rot)
 
void setPosValid (bool value)
 
void setTime (UTime atTime)
 
 UGmk ()
 
 ~UGmk ()
 
- Public Member Functions inherited from UPosRot
void clear ()
 
UPlane getCamToRobPlane (UPlane plane)
 Convert this plane from camera to robot coordinates. Assumes that this pose is the camera pose relative to the robot. More...
 
virtual const char * getDataType ()
 
double getKappa ()
 
UMatrix4 getMtoRMatrix ()
 
double getOmega ()
 
double getPhi ()
 
UPositiongetPos ()
 
UPosRotgetPosRot ()
 
UPlane getRobToCamPlane (UPlane plane)
 Convert this plane from robot to camera coordinates. Assumes that this pose is the camera pose relative to the robot. More...
 
URotationgetRot ()
 
UMatrix4 getRtoMMatrix ()
 
double getTheta ()
 
double getX ()
 
double getY ()
 
double getZ ()
 
UPosition pos ()
 
void print (const char *prestring)
 
URotation rot ()
 
void set (UPosition pos, URotation rot)
 
void set (double x, double y, double z, double Omega, double Phi, double Kappa)
 
void setCtoR (UPosRot *camera, UPosRot *guidemark, bool mirror)
 
void setFromPose (double x, double y, double h)
 
void setKappa (double value)
 
void setOmega (double value)
 
void setPhi (double value)
 
void setPos (UPosition pos)
 
void setRot (URotation rot)
 
void setRtoC (UPosRot *camera, UPosRot *guidemark)
 
void setTheta (double value)
 
void setX (double value)
 
void setY (double value)
 
void setZ (double value)
 
 UPosRot ()
 
 ~UPosRot ()
 
- Public Member Functions inherited from UPosition
void add (const UPosition *pos)
 
void add (const UPosition pos)
 
void add (const double ix, const double iy, const double iz)
 
UPosition added (UPosition *pos)
 
UPosition added (UPosition pos)
 
UMatrix4 asCol3 ()
 
UMatrix4 asCol4 ()
 
UMatrix4 asMatrix4x4 ()
 
UMatrix4 asRow3 ()
 
UMatrix4 asRow4 ()
 
UMatrix4 asVector3 (bool column)
 
UMatrix4 asVector4 (bool column)
 
void clear (void)
 
virtual const char * codeXml (char *buf, const int bufCnt, const char *extraAttr)
 
virtual const char * codeXml (const char *name, char *buf, const int bufCnt, const char *extraAttr)
 
int copy (UMatrix4 *pos)
 
int copy (const URotation *rot)
 
UPosition cross (UPosition p2)
 
void cross (UPosition p1, UPosition p2)
 
double dist (const UPosition *pTo)
 
double dist (UPosition To)
 
double dist ()
 
double distSq (const UPosition *pTo)
 
double distSq ()
 
double distXY ()
 
double distXY (UPosition p2)
 
double dot (UPosition p2)
 
double get (int idx)
 
UMatrix4 getPixelPos (UMatrix4 *A, UMatrix4 *b)
 
UPositiongetPos ()
 
UPosition getTangentPointXY (const UPosition centre, const double radius, const bool rightSide, bool *valid, double *ang=NULL)
 
bool load (const char *valueString)
 
int LoadFromReg (Uconfig *ini, const char *subject, const char *key)
 
UPosition operator* (const double scalar)
 
void operator*= (const double scalar)
 
UPosition operator+ (UPosition pos)
 
void operator+= (const UPosition pos)
 
UPosition operator- (UPosition pos)
 
void operator-= (const UPosition pos)
 
UPosition operator= (UMatrix4 vec)
 
UPosition operator= (const URotation rot)
 
UPosition operator= (const U2Dpos val)
 
void print (const char *leadString)
 
void println (const char *leadString)
 
bool save (FILE *fmap, const char *key)
 
int SaveToReg (Uconfig *ini, const char *subject, const char *key)
 
void scale (const double val)
 
UPosition scaled (const double val)
 
void set (const double ix, const double iy, const double iz)
 
void set (const int idx, const double value)
 
void setPos (UPosition fromPos)
 
void show (const char *leadString)
 
virtual void snprint (const char *leadString, char *s, const int bufferLength)
 
void sprint (char *s, const char *leadString)
 
void subtract (const UPosition *pos)
 
UPosition subtracted (UPosition *pos)
 
UPosition subtracted (UPosition pos)
 
int toUnitVector ()
 
void transfer (UMatrix4 *mA)
 
UPosition transferred (UMatrix4 *mA)
 
 UPosition ()
 
 UPosition (double ix, double iy, double iz)
 
 UPosition (double ix, double iy)
 
virtual ~UPosition ()
 
- Public Member Functions inherited from UDataBase
bool isA (const char *typeString)
 
virtual bool isAlsoA (const char *typeString)
 
 UDataBase ()
 
virtual ~UDataBase ()
 
- Public Member Functions inherited from URotation
void add (URotation *rot)
 
void add (URotation rot)
 
void add (double iOmega, double iPhi, double iKappa)
 
URotation added (URotation *rot)
 
UMatrix4 asMatrix3x3CtoW ()
 
UMatrix4 asMatrix3x3K ()
 
UMatrix4 asMatrix3x3Kt ()
 
UMatrix4 asMatrix3x3MtoR ()
 
UMatrix4 asMatrix3x3O ()
 
UMatrix4 asMatrix3x3Ot ()
 
UMatrix4 asMatrix3x3P ()
 
UMatrix4 asMatrix3x3Pt ()
 
UMatrix4 asMatrix3x3RtoM ()
 
UMatrix4 asMatrix3x3WtoC ()
 
UMatrix4 asMatrix4x4CtoW ()
 
UMatrix4 asMatrix4x4CtoW (UPosition *pos)
 
UMatrix4 asMatrix4x4MtoR ()
 
UMatrix4 asMatrix4x4MtoR (UPosition *pos)
 
UMatrix4 asMatrix4x4MtoR (UPosition pos)
 
UMatrix4 asMatrix4x4RtoM ()
 
UMatrix4 asMatrix4x4RtoM (UPosition *pos)
 
UMatrix4 asMatrix4x4RtoM (UPosition pos)
 
UMatrix4 asMatrix4x4WtoC ()
 
UMatrix4 asMatrix4x4WtoC (UPosition *pos)
 
UMatrix4 asUnitZVector3CtoW ()
 
UMatrix4 asUnitZVector4CtoW ()
 
UMatrix4 asVector3 ()
 
UMatrix4 asVector4 ()
 
void clear (void)
 
virtual const char * codeXml (char *buff, const int buffCnt, const char *extra)
 
virtual const char * codeXml (const char *name, char *buff, const int buffCnt, const char *extra)
 
int copy (UMatrix4 *rot)
 
int copy (UPosition *pos)
 
URotationgetRot ()
 
void LimitToPi ()
 
void limitToPi ()
 
bool load (const char *valueString)
 
int LoadFromReg (Uconfig *ini, const char *subject, const char *key)
 
URotation operator* (double val)
 
void operator*= (double val)
 
URotation operator+ (URotation rot)
 
void operator+= (URotation rot)
 
URotation operator- (URotation rot)
 
void operator-= (URotation rot)
 
URotation operator= (UMatrix4 vec)
 
URotation operator= (UPosition pos)
 
void print (const char *leadString)
 
bool save (FILE *fmap, const char *key)
 
int SaveToReg (Uconfig *ini, const char *subject, const char *key)
 
void scale (double val)
 
URotation scaled (double val)
 
void set (double iOmega, double iPhi, double iKappa)
 
void setFromYZ (UPosition posY, UPosition posZ)
 
void setRot (URotation rot)
 
void show (const char *leadString)
 
void snprint (const char *leadString, bool inDegree, char *s, const int bufferLength)
 
void sprint (char *s, const char *leadString, bool inDegree=true)
 
void subtract (URotation *rot)
 
URotation subtracted (URotation *rot)
 
 URotation ()
 
 URotation (double iOmega, double iPhi, double iKappa)
 
virtual ~URotation ()
 

Static Public Member Functions

static unsigned long getCodeInt (const char *newCode, bool *okCrc=NULL)
 
- Static Public Member Functions inherited from UPosition
static UPosition position (double ix, double iy, double iz)
 

Static Public Attributes

static const int MAX_CODE_LENGTH = 30
 

Protected Attributes

char code [MAX_CODE_LENGTH]
 
unsigned long codeInt
 
bool crcOK
 
UTime time
 
bool valid
 
bool validPos
 

Additional Inherited Members

- Public Attributes inherited from UPosition
double x
 
double y
 
double z
 
- Public Attributes inherited from URotation
double Kappa
 
double Omega
 
double Phi
 

Detailed Description

Holds information of a guidemark

Author
Christian Andersen

Constructor & Destructor Documentation

UGmk::UGmk ( )

Constructor

References clear(), code, and codeInt.

UGmk::~UGmk ( )

Destructor

Member Function Documentation

void UGmk::clear ( void  )

Clear guidemark

References crcOK, valid, and validPos.

Referenced by UBarcode::clear(), and UGmk().

const char* UGmk::getCode ( )
inline

Get long code string

References code, UPosRot::pos(), and UPosRot::rot().

Referenced by UFunctionCamGmk::handleGmkGetCommand(), and UFunctionCamGmk::sendGmk().

unsigned long UGmk::getCodeInt ( const char *  newCode,
bool *  okCrc = NULL 
)
static

Convert a string code to a long unsigned integer.

Parameters
newCodeis a string with the values of the 4-bit codes - up to max length of square code block
okCrcis set to true, if the 8-bit code CRC is validated successfut
Returns
the gmk code as a signed long integer (no test for overflow), if crc fails, then the value includes the full code (to be compatible with old function)

References getCRC(), hex2int(), and mini().

Referenced by UFunctionCamGmk::handleGmkGetCommand(), UResCamIfGmk::newDataAvailable(), UNavPaint::paintGmks(), UFunctionCamGmk::sendGmk(), and UResCamIfGmk::snprint().

unsigned long UGmk::getCodeInt ( )
inline

Get the integer (unsigned long) code value

References codeInt.

Referenced by set(), and setTime().

UTime UGmk::getTime ( )
inline
bool UGmk::isCrcValid ( )
inline

Get valid flag (for code)

References crcOK.

Referenced by UFunctionCamGmk::handleGmkGetCommand(), and UFunctionCamGmk::sendGmk().

bool UGmk::isPosValid ( )
inline

Get is position valid flag

References validPos.

bool UGmk::isValid ( )
inline

Get valid flag (for code)

References valid.

void UGmk::set ( const char *  newCode)

Set code

References code, codeInt, crcOK, getCodeInt(), MAX_CODE_LENGTH, and valid.

Referenced by USmlTag::getGmk().

void UGmk::set ( UPosition  pos,
URotation  rot 
)

Set time and position

References UPosRot::setPos(), UPosRot::setRot(), and validPos.

void UGmk::setPosValid ( bool  value)
inline

Set is position valid flag

References validPos.

Referenced by USmlTag::getGmk().

void UGmk::setTime ( UTime  atTime)
inline

Set time

References getCodeInt(), and time.

Referenced by USmlTag::getGmk(), and UBarcode::setData().

Member Data Documentation

char UGmk::code[MAX_CODE_LENGTH]
protected

Full code as found in image

Referenced by getCode(), set(), and UGmk().

unsigned long UGmk::codeInt
protected

Short version of code - first 8 values

Referenced by getCodeInt(), set(), and UGmk().

bool UGmk::crcOK
protected

CRC is OK

Referenced by clear(), isCrcValid(), and set().

const int UGmk::MAX_CODE_LENGTH = 30
static
UTime UGmk::time
protected

Time for guidemark position position

Referenced by getTime(), and setTime().

bool UGmk::valid
protected

Validity of code data.

Referenced by clear(), isValid(), and set().

bool UGmk::validPos
protected

Validity of position information. true (1) if valid.

Referenced by clear(), isPosValid(), set(), UBarcode::setData(), and setPosValid().


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