11 #include "../BasicDatatypes.hpp" 12 #include "../manager.hpp" 13 #include "../interfaces/tcp.hpp" 14 #include "../interfaces/file.hpp" 15 #include "../tools/SickThread.hpp" 16 #include "../datatypes/Position3D.hpp" 17 #include "../datatypes/Point2D.hpp" 18 #include "../datatypes/Scan.hpp" 24 #define MRS_INPUTBUFFERSIZE 65536 // Size of the main input buffer 25 #define MRS_CMDREPLYBUFFERSIZE 8192 // Size of the command reply buffer (some bytes should be enough...) 132 typedef void (*OnScanReceiveCallbackFunction)(
void*);
170 void updateThreadFunction(
bool& endThread,
UINT16& sleepTimeMs);
208 static const UINT16 Err_IF_SPORT = 0x0001;
209 static const UINT16 Err_IF_FPGAcontrol = 0x0002;
210 static const UINT16 Err_SPORTdata = 0x0004;
211 static const UINT16 Err_FPGAkonfiguration = 0x0008;
212 static const UINT16 Err_ConfReg = 0x0010;
213 static const UINT16 Err_Parameter = 0x0020;
215 static const UINT16 Err_TrackingTimeout = 0x0080;
216 static const UINT16 Err_CANMessageLost = 0x0100;
217 static const UINT16 Err_FlexResParameter = 0x0200;
229 UINT16 decodeAnswerInInputBuffer();
230 UINT16 decodeAnswerInCmdReplyBuffer();
231 void removeAnswerFromInputBuffer();
232 bool decodeGetStatus();
233 bool decodeGetParameter(
UINT32* value);
234 void decodeObjects();
236 void decodeSensorInfo();
237 void decodeErrorMessage();
238 double convertTicktsToAngle(
INT16 angleTicks);
242 bool readUpsideDown();
243 double getVAngleOfLayer(
bool isRearMirrorSide,
UINT8 layerNumber,
double hAngle);
247 static void readCallbackFunctionS(
void* obj,
BYTE* buffer,
UINT32& numOfBytes);
248 void readCallbackFunction(
BYTE* buffer,
UINT32& numOfBytes);
249 void removeDataFromInputBuffer(
UINT32 bytesToBeRemoved);
250 void moveDataFromInputToCmdBuffer(
UINT32 bytesToBeMoved);
251 void makeIntValueEven(
INT16& value);
253 static std::string int2Version (
UINT16 val);
254 static std::string version2string (
UINT16 version,
const UINT16 timestamp[3]);
264 std::string ipAddress,
UINT16 tcpPortNumber,
265 double scanFrequency,
double scanStartAngle,
double scanEndAngle,
double offsetX,
266 double offsetY,
double offsetZ,
double yawAngle,
double pitchAngle,
double rollAngle,
267 bool beVerbose, std::string inputFileName);
272 virtual bool run(
bool weWantScanData =
true,
bool weWantObjectData =
true);
273 virtual bool isRunning();
276 void setOnScanReceiveCallbackFunction(OnScanReceiveCallbackFunction
function,
void* obj);
278 bool cmd_getStatus();
279 bool cmd_stopMeasure();
280 bool cmd_startMeasure(
bool weWantScanData =
true,
bool weWantObjectData =
true);
284 bool cmd_setScanAngles(
double startAngle,
double endAngle);
285 bool cmd_setSyncAngleOffset(
double syncAngle);
286 bool cmd_setScanFrequency(
double scanFreq);
287 bool cmd_setDataOutputFlags();
288 bool cmd_saveConfiguration();
289 bool cmd_setNtpTimestamp(
UINT32 seconds,
UINT32 fractionalSec);
295 double getTemperature();
297 std::string getSerialNumber();
307 static const UINT32 ANGULAR_TICKS_PER_ROTATION = 11520;
312 #endif // LUXBASE_HPP 0x0010 = sets a parameter in the sensor
UINT16 getWarnRegister2()
void * m_disconnectFunctionObjPtr
std::string getFirmwareVersion()
std::string getFPGAVersion()
0x0004 = ID of the SaveConfig command
A Position with orientation.
0x0031 = sets NTP fractional seconds
std::string m_inputFileName
#define MRS_CMDREPLYBUFFERSIZE
void(* DisconnectFunction)(void *obj)
File::DisconnectFunction m_fileDisconnectFunction
0x001A = resets all parameters to the factory defaults
0x0001 = ID of the GetStatus command
0x0000 = ID of the Reset command
0x0030 = sets NTP seconds
Mutex m_updateMutex
Access mutex for update.
UINT16 getErrorRegister2()
UINT16 getWarnRegister1()
UINT16 getScannerStatus()
0x0003 = ID of the SetConfig command
0x0002 = ID of the SetMode command
0x0006 = ID of the FlashFirmware command
0x0020 = starts the measurement with the currenly configured settings
0x0005 = ID of the ReadConfig command
void(* DisconnectFunction)(void *obj)
OnScanReceiveCallbackFunction m_onScanReceiveCallback
Tcp::DisconnectFunction m_tcpDisconnectFunction
#define MRS_INPUTBUFFERSIZE
UINT16 getErrorRegister1()
void * m_onScanReceiveCallbackObjPtr
static bool isValidVersion(UINT16 version)
0x0011 = reads a parameter from the sensor
SickThread< LuxBase,&LuxBase::updateThreadFunction > m_updateThread
0x0021 = stops the measurement
Wrapper class for posix threads.