Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
devices::LuxBase Class Reference

#include <LuxBase.hpp>

List of all members.

Public Types

typedef void(* OnScanReceiveCallbackFunction )(void *)

Public Member Functions

bool cmd_getParameter (MrsParameterId parameter, UINT32 *value)
bool cmd_getStatus ()
bool cmd_saveConfiguration ()
bool cmd_setDataOutputFlags ()
bool cmd_setMountingPos (Position3D mp)
bool cmd_setNtpTimestamp (UINT32 seconds, UINT32 fractionalSec)
bool cmd_setParameter (MrsParameterId parameter, UINT32 value)
bool cmd_setScanAngles (double startAngle, double endAngle)
bool cmd_setScanFrequency (double scanFreq)
bool cmd_setSyncAngleOffset (double syncAngle)
bool cmd_startMeasure (bool weWantScanData=true, bool weWantObjectData=true)
bool cmd_stopMeasure ()
void dumpHeader ()
void dumpMessage ()
UINT16 getDSPError ()
UINT16 getErrorRegister1 ()
UINT16 getErrorRegister2 ()
std::string getFirmwareVersion ()
UINT16 getFPGAError ()
std::string getFPGAVersion ()
UINT16 getScannerStatus ()
std::string getSerialNumber ()
double getTemperature ()
UINT16 getWarnRegister1 ()
UINT16 getWarnRegister2 ()
virtual bool initFile (File::DisconnectFunction function, void *obj)
virtual bool initTcp (Tcp::DisconnectFunction function, void *obj)
virtual bool isRunning ()
 LuxBase (Manager *manager, const UINT8 deviceID, const std::string longName, std::string ipAddress, UINT16 tcpPortNumber, double scanFrequency, double scanStartAngle, double scanEndAngle, double offsetX, double offsetY, double offsetZ, double yawAngle, double pitchAngle, double rollAngle, bool beVerbose, std::string inputFileName)
void memreadLE (BYTE *&buffer, UINT16 &value)
void memreadLE (BYTE *&buffer, UINT32 &value)
virtual bool run (bool weWantScanData=true, bool weWantObjectData=true)
void setOnScanReceiveCallbackFunction (OnScanReceiveCallbackFunction function, void *obj)
virtual bool stop ()
virtual ~LuxBase ()

Static Public Attributes

static const UINT32 ANGULAR_TICKS_PER_ROTATION = 11520

Private Member Functions

UINT32 buildDataHeader (UINT8 *buffer, UINT32 sizeofThisMsg, UINT8 deviceId, UINT16 dataType)
double convertTicktsToAngle (INT16 angleTicks)
UINT16 decodeAnswerInCmdReplyBuffer ()
UINT16 decodeAnswerInInputBuffer ()
void decodeErrorMessage ()
bool decodeGetParameter (UINT32 *value)
bool decodeGetStatus ()
void decodeObjects ()
void decodeScan ()
void decodeSensorInfo ()
double getVAngleOfLayer (bool isRearMirrorSide, UINT8 layerNumber, double hAngle)
void makeIntValueEven (INT16 &value)
void moveDataFromInputToCmdBuffer (UINT32 bytesToBeMoved)
bool readBeamTilt ()
void readCallbackFunction (BYTE *buffer, UINT32 &numOfBytes)
Point2D readPoint2D (UINT8 *buffer)
Point2D readSize2D (UINT8 *buffer)
UINT64 readUINT64ValueLE (UINT8 *buffer)
bool readUpsideDown ()
UINT32 readUValueBE (UINT8 *buffer, UINT8 bytes)
UINT32 readUValueLE (UINT8 *buffer, UINT8 bytes)
INT32 readValueLE (UINT8 *buffer, UINT8 bytes)
bool receiveMrsReply (MrsCommandId cmd, UINT32 timeoutMs, UINT32 *value=NULL)
void removeAnswerFromInputBuffer ()
void removeDataFromInputBuffer (UINT32 bytesToBeRemoved)
bool sendMrsCommand (MrsCommandId cmd, UINT16 para=0, UINT32 value=0)
void updateThreadFunction (bool &endThread, UINT16 &sleepTimeMs)
UINT32 writeValueToBufferBE (UINT8 *buffer, UINT32 value, UINT8 bytes)
UINT32 writeValueToBufferLE (UINT8 *buffer, UINT32 value, UINT8 bytes)

Static Private Member Functions

static std::string int2Version (UINT16 val)
static bool isValidVersion (UINT16 version)
static void readCallbackFunctionS (void *obj, BYTE *buffer, UINT32 &numOfBytes)
static std::string version2string (UINT16 version, const UINT16 timestamp[3])

Private Attributes

double m_beamTiltAngle
bool m_beVerbose
UINT32 m_cmdBufferLevel
UINT8 m_cmdReplyBuffer [MRS_CMDREPLYBUFFERSIZE]
UINT8 m_deviceId
void * m_disconnectFunctionObjPtr
UINT16 m_DSPError
UINT16 m_errorRegister1
UINT16 m_errorRegister2
File m_file
File::DisconnectFunction m_fileDisconnectFunction
UINT16 m_firmwareTimestamp [3]
UINT16 m_firmwareVersion
UINT16 m_FPGAError
UINT16 m_FPGATimestamp [3]
UINT16 m_FPGAVersion
UINT32 m_inBufferLevel
UINT8 m_inputBuffer [MRS_INPUTBUFFERSIZE]
Mutex m_inputBufferMutex
std::string m_inputFileName
std::string m_ipAddress
bool m_isRunning
std::string m_longName
Managerm_manager
double m_offsetX
double m_offsetY
double m_offsetZ
OnScanReceiveCallbackFunction m_onScanReceiveCallback
void * m_onScanReceiveCallbackObjPtr
double m_pitchAngle
bool m_readOnlyMode
double m_rollAngle
double m_scanEndAngle
double m_scanFrequency
UINT16 m_scannerStatus
double m_scanStartAngle
UINT16 m_serialNumber [3]
Tcp m_tcp
Tcp::DisconnectFunction m_tcpDisconnectFunction
UINT16 m_tcpPortNumber
UINT16 m_temperature
Mutex m_updateMutex
 Access mutex for update.
SickThread< LuxBase,&LuxBase::updateThreadFunctionm_updateThread
bool m_upsideDownActive
UINT16 m_warnRegister1
UINT16 m_warnRegister2
bool m_weWantObjectData
bool m_weWantScanData
double m_yawAngle

Static Private Attributes

static const UINT16 Err_CANMessageLost = 0x0100
static const UINT16 Err_ConfReg = 0x0010
static const UINT16 Err_FlexResParameter = 0x0200
static const UINT16 Err_FPGAkonfiguration = 0x0008
static const UINT16 Err_IF_FPGAcontrol = 0x0002
static const UINT16 Err_IF_SPORT = 0x0001
static const UINT16 Err_Parameter = 0x0020
static const UINT16 Err_SPORTdata = 0x0004
static const UINT16 Err_Timing = 0x0040
static const UINT16 Err_TrackingTimeout = 0x0080

Detailed Description

Definition at line 129 of file LuxBase.hpp.


Member Typedef Documentation

Definition at line 132 of file LuxBase.hpp.


Constructor & Destructor Documentation

devices::LuxBase::LuxBase ( Manager manager,
const UINT8  deviceID,
const std::string  longName,
std::string  ipAddress,
UINT16  tcpPortNumber,
double  scanFrequency,
double  scanStartAngle,
double  scanEndAngle,
double  offsetX,
double  offsetY,
double  offsetZ,
double  yawAngle,
double  pitchAngle,
double  rollAngle,
bool  beVerbose,
std::string  inputFileName 
)

Definition at line 50 of file LuxBase.cpp.

Definition at line 94 of file LuxBase.cpp.


Member Function Documentation

UINT32 devices::LuxBase::buildDataHeader ( UINT8 buffer,
UINT32  sizeOfThisMsg,
UINT8  deviceId,
UINT16  dataType 
) [private]

Write the data header for the command into the buffer.The buffer must be at least 24 bytes long.

Return value is the number of bytes that have been written.

Definition at line 2578 of file LuxBase.cpp.

bool devices::LuxBase::cmd_getParameter ( MrsParameterId  parameter,
UINT32 value 
)

Definition at line 851 of file LuxBase.cpp.

Request the staus message from the scanner.

Definition at line 570 of file LuxBase.cpp.

Definition at line 937 of file LuxBase.cpp.

Definition at line 906 of file LuxBase.cpp.

Definition at line 314 of file LuxBase.cpp.

bool devices::LuxBase::cmd_setNtpTimestamp ( UINT32  seconds,
UINT32  fractionalSec 
)

Definition at line 732 of file LuxBase.cpp.

bool devices::LuxBase::cmd_setParameter ( MrsParameterId  parameter,
UINT32  value 
)

Definition at line 810 of file LuxBase.cpp.

bool devices::LuxBase::cmd_setScanAngles ( double  startAngle,
double  endAngle 
)

Definition at line 462 of file LuxBase.cpp.

bool devices::LuxBase::cmd_setScanFrequency ( double  scanFreq)

Definition at line 417 of file LuxBase.cpp.

bool devices::LuxBase::cmd_setSyncAngleOffset ( double  syncAngle)

Definition at line 538 of file LuxBase.cpp.

bool devices::LuxBase::cmd_startMeasure ( bool  weWantScanData = true,
bool  weWantObjectData = true 
)

Definition at line 952 of file LuxBase.cpp.

Definition at line 690 of file LuxBase.cpp.

double devices::LuxBase::convertTicktsToAngle ( INT16  angleTicks) [private]

Definition at line 1911 of file LuxBase.cpp.

Returns the ID ("command") of the message in the reply buffer. If a complete dataset is in the buffer, the return value is non-zero (=valid). Note that the buffer may hold only one complete (!) dataset.

Note: Access to command and input buffer must be mutex'ed, with same mutex to avoid cross-overwrite while decoding!!

Definition at line 2204 of file LuxBase.cpp.

Definition at line 1410 of file LuxBase.cpp.

Definition at line 1545 of file LuxBase.cpp.

bool devices::LuxBase::decodeGetParameter ( UINT32 value) [private]

Definition at line 1085 of file LuxBase.cpp.

Decodes a "GetStatus" message in the input buffer.

Definition at line 1048 of file LuxBase.cpp.

void devices::LuxBase::decodeObjects ( ) [private]

Definition at line 1944 of file LuxBase.cpp.

void devices::LuxBase::decodeScan ( ) [private]

Definition at line 1695 of file LuxBase.cpp.

Definition at line 1857 of file LuxBase.cpp.

Definition at line 2278 of file LuxBase.cpp.

Definition at line 2292 of file LuxBase.cpp.

Definition at line 294 of file LuxBase.hpp.

Definition at line 299 of file LuxBase.hpp.

Definition at line 300 of file LuxBase.hpp.

std::string devices::LuxBase::getFirmwareVersion ( ) [inline]

Definition at line 292 of file LuxBase.hpp.

Definition at line 293 of file LuxBase.hpp.

std::string devices::LuxBase::getFPGAVersion ( ) [inline]

Definition at line 291 of file LuxBase.hpp.

Definition at line 296 of file LuxBase.hpp.

Definition at line 1170 of file LuxBase.cpp.

Definition at line 1147 of file LuxBase.cpp.

double devices::LuxBase::getVAngleOfLayer ( bool  isRearMirrorSide,
UINT8  layerNumber,
double  hAngle 
) [private]

Definition at line 1878 of file LuxBase.cpp.

Definition at line 301 of file LuxBase.hpp.

Definition at line 302 of file LuxBase.hpp.

bool devices::LuxBase::initFile ( File::DisconnectFunction  function,
void *  obj 
) [virtual]

Definition at line 236 of file LuxBase.cpp.

bool devices::LuxBase::initTcp ( Tcp::DisconnectFunction  function,
void *  obj 
) [virtual]

Definition at line 118 of file LuxBase.cpp.

std::string devices::LuxBase::int2Version ( UINT16  val) [static, private]
Examples:
  • 0x1230 --> "1.2.30"
  • 0x123B --> "1.2.3B"
  • 0xFFFF --> "n/a" (special value for "not available")

Definition at line 1215 of file LuxBase.cpp.

bool devices::LuxBase::isRunning ( ) [virtual]

Definition at line 304 of file LuxBase.cpp.

static bool devices::LuxBase::isValidVersion ( UINT16  version) [inline, static, private]

Definition at line 255 of file LuxBase.hpp.

void devices::LuxBase::makeIntValueEven ( INT16 value) [private]

Definition at line 402 of file LuxBase.cpp.

void devices::LuxBase::memreadLE ( BYTE *&  buffer,
UINT16 value 
)

Definition at line 1028 of file LuxBase.cpp.

void devices::LuxBase::memreadLE ( BYTE *&  buffer,
UINT32 value 
)

Definition at line 1037 of file LuxBase.cpp.

void devices::LuxBase::moveDataFromInputToCmdBuffer ( UINT32  bytesToBeMoved) [private]

Definition at line 2150 of file LuxBase.cpp.

bool devices::LuxBase::readBeamTilt ( ) [private]

Read the current beam tilt angle from the scanner. The result is stored in m_beamTilt.

Definition at line 616 of file LuxBase.cpp.

void devices::LuxBase::readCallbackFunction ( BYTE buffer,
UINT32 numOfBytes 
) [private]

Definition at line 2725 of file LuxBase.cpp.

void devices::LuxBase::readCallbackFunctionS ( void *  obj,
BYTE buffer,
UINT32 numOfBytes 
) [static, private]

Definition at line 102 of file LuxBase.cpp.

Point2D devices::LuxBase::readPoint2D ( UINT8 buffer) [private]

Definition at line 2124 of file LuxBase.cpp.

Point2D devices::LuxBase::readSize2D ( UINT8 buffer) [private]

Definition at line 2137 of file LuxBase.cpp.

Little-Endian-Read (unsigned)

Reads a value of 8 bytes from the buffer. The value encoding in the buffer is little endian, that means the lowest-value byte is first in the buffer. Example: Buffer = 0x12 0x34 ==> Value = 0x3412

Definition at line 1301 of file LuxBase.cpp.

Read the current UpsideDown flag from the scanner. The result is stored in m_upsideDownActive.

Definition at line 650 of file LuxBase.cpp.

UINT32 devices::LuxBase::readUValueBE ( UINT8 buffer,
UINT8  bytes 
) [private]

Big-Endian-Read (unsigned)

Reads a value of 1, 2 or 4 bytes from the buffer. The value encoding in the buffer is big endian, that means the highest-value byte is first in the buffer. Example: Buffer = 0x12 0x34 ==> Value = 0x1234

Definition at line 1368 of file LuxBase.cpp.

UINT32 devices::LuxBase::readUValueLE ( UINT8 buffer,
UINT8  bytes 
) [private]

Little-Endian-Read (unsigned)

Reads a value of 1, 2 or 4 bytes from the buffer. The value encoding in the buffer is little endian, that means the lowest-value byte is first in the buffer. Example: Buffer = 0x12 0x34 ==> Value = 0x3412

Definition at line 1267 of file LuxBase.cpp.

INT32 devices::LuxBase::readValueLE ( UINT8 buffer,
UINT8  bytes 
) [private]

Definition at line 1321 of file LuxBase.cpp.

bool devices::LuxBase::receiveMrsReply ( MrsCommandId  cmd,
UINT32  timeoutMs,
UINT32 value = NULL 
) [private]

Definition at line 2368 of file LuxBase.cpp.

Removes the first complete command from the input buffer. It is assumed that a valid command is in the buffer.

Note: Access to input buffer must be mutex'ed.

Definition at line 2314 of file LuxBase.cpp.

void devices::LuxBase::removeDataFromInputBuffer ( UINT32  bytesToBeRemoved) [private]

Remove the first x bytes from the input buffer.

Note that if the host system is fast enough, this does not happen, but the buffer is just invalidated.

Definition at line 2173 of file LuxBase.cpp.

bool devices::LuxBase::run ( bool  weWantScanData = true,
bool  weWantObjectData = true 
) [virtual]

Definition at line 2611 of file LuxBase.cpp.

bool devices::LuxBase::sendMrsCommand ( MrsCommandId  cmd,
UINT16  para = 0,
UINT32  value = 0 
) [private]

Send a command to the scanner.

Definition at line 2447 of file LuxBase.cpp.

Definition at line 108 of file LuxBase.cpp.

bool devices::LuxBase::stop ( ) [virtual]

Definition at line 2772 of file LuxBase.cpp.

void devices::LuxBase::updateThreadFunction ( bool &  endThread,
UINT16 sleepTimeMs 
) [private]

Definition at line 281 of file LuxBase.cpp.

std::string devices::LuxBase::version2string ( UINT16  version,
const UINT16  timestamp[3] 
) [static, private]

Definition at line 1232 of file LuxBase.cpp.

UINT32 devices::LuxBase::writeValueToBufferBE ( UINT8 buffer,
UINT32  value,
UINT8  bytes 
) [private]

Definition at line 2518 of file LuxBase.cpp.

UINT32 devices::LuxBase::writeValueToBufferLE ( UINT8 buffer,
UINT32  value,
UINT8  bytes 
) [private]

Definition at line 2547 of file LuxBase.cpp.


Member Data Documentation

Definition at line 307 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_CANMessageLost = 0x0100 [static, private]

Definition at line 216 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_ConfReg = 0x0010 [static, private]

Definition at line 212 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_FlexResParameter = 0x0200 [static, private]

Definition at line 217 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_FPGAkonfiguration = 0x0008 [static, private]

Definition at line 211 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_IF_FPGAcontrol = 0x0002 [static, private]

Definition at line 209 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_IF_SPORT = 0x0001 [static, private]

Definition at line 208 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_Parameter = 0x0020 [static, private]

Definition at line 213 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_SPORTdata = 0x0004 [static, private]

Definition at line 210 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_Timing = 0x0040 [static, private]

Definition at line 214 of file LuxBase.hpp.

const UINT16 devices::LuxBase::Err_TrackingTimeout = 0x0080 [static, private]

Definition at line 215 of file LuxBase.hpp.

Definition at line 191 of file LuxBase.hpp.

Definition at line 260 of file LuxBase.hpp.

Definition at line 199 of file LuxBase.hpp.

Definition at line 200 of file LuxBase.hpp.

Definition at line 176 of file LuxBase.hpp.

Definition at line 165 of file LuxBase.hpp.

Definition at line 155 of file LuxBase.hpp.

Definition at line 202 of file LuxBase.hpp.

Definition at line 203 of file LuxBase.hpp.

Definition at line 162 of file LuxBase.hpp.

Definition at line 164 of file LuxBase.hpp.

Definition at line 159 of file LuxBase.hpp.

Definition at line 142 of file LuxBase.hpp.

Definition at line 150 of file LuxBase.hpp.

Definition at line 158 of file LuxBase.hpp.

Definition at line 143 of file LuxBase.hpp.

Definition at line 196 of file LuxBase.hpp.

Definition at line 195 of file LuxBase.hpp.

Definition at line 197 of file LuxBase.hpp.

std::string devices::LuxBase::m_inputFileName [private]

Definition at line 180 of file LuxBase.hpp.

std::string devices::LuxBase::m_ipAddress [private]

Definition at line 177 of file LuxBase.hpp.

Definition at line 160 of file LuxBase.hpp.

std::string devices::LuxBase::m_longName [private]

Definition at line 175 of file LuxBase.hpp.

Definition at line 174 of file LuxBase.hpp.

double devices::LuxBase::m_offsetX [private]

Definition at line 185 of file LuxBase.hpp.

double devices::LuxBase::m_offsetY [private]

Definition at line 186 of file LuxBase.hpp.

double devices::LuxBase::m_offsetZ [private]

Definition at line 187 of file LuxBase.hpp.

Definition at line 166 of file LuxBase.hpp.

Definition at line 167 of file LuxBase.hpp.

Definition at line 189 of file LuxBase.hpp.

Definition at line 179 of file LuxBase.hpp.

Definition at line 190 of file LuxBase.hpp.

Definition at line 184 of file LuxBase.hpp.

Definition at line 182 of file LuxBase.hpp.

Definition at line 144 of file LuxBase.hpp.

Definition at line 183 of file LuxBase.hpp.

Definition at line 157 of file LuxBase.hpp.

Definition at line 161 of file LuxBase.hpp.

Definition at line 163 of file LuxBase.hpp.

Definition at line 178 of file LuxBase.hpp.

Definition at line 156 of file LuxBase.hpp.

Access mutex for update.

Definition at line 172 of file LuxBase.hpp.

Definition at line 171 of file LuxBase.hpp.

Definition at line 192 of file LuxBase.hpp.

Definition at line 204 of file LuxBase.hpp.

Definition at line 205 of file LuxBase.hpp.

Definition at line 258 of file LuxBase.hpp.

Definition at line 257 of file LuxBase.hpp.

double devices::LuxBase::m_yawAngle [private]

Definition at line 188 of file LuxBase.hpp.


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


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:51