Browse Source

Rebuild 3DLRF Server

AGP
Gagua on MyIR master 5 years ago
parent
commit
b3c39a93b9
  1. 76
      lib/App/3dSERVER/LRF_ClientHandler.cpp
  2. 18
      lib/App/3dSERVER/LRF_ClientHandler.h
  3. 99
      lib/App/3dSERVER/LRF_HardwareManager.cpp
  4. 7
      lib/App/3dSERVER/LRF_HardwareManager.h
  5. 10
      lib/App/3dSERVER/LRF_Kernel.cpp
  6. 5
      lib/App/3dSERVER/LRF_Kernel.h
  7. 8
      lib/App/3dSERVER/LRF_TargetTracker.cpp
  8. 5
      lib/data/curl/curlRequest.cpp
  9. 1
      lib/data/protocol/protocolLGS3D.h
  10. 4
      lib/data/protocol/protocolLGS3D_server.cpp
  11. 2
      lib/data/protocol/protocolLGS3D_server.h
  12. 5
      lib/data/transport/transportSocket.cpp
  13. 2
      lib/data/transport/transportSocket.h

76
lib/App/3dSERVER/LRF_ClientHandler.cpp

@ -99,7 +99,7 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
#endif #endif
m_pKernelEngine->shutdown(); m_pKernelEngine->shutdown();
m_bClientWorkingMode = CWM_INIT; m_bClientWorkingMode = CWM_INIT;
break;
break;
case CMD_RESET: case CMD_RESET:
#ifdef DEBUG #ifdef DEBUG
LOG("RESET Request"); LOG("RESET Request");
@ -136,7 +136,7 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
LOG("GET_FILE Request"); LOG("GET_FILE Request");
#endif #endif
m_bClientWorkingMode = CWM_FILE; m_bClientWorkingMode = CWM_FILE;
break;
break;
case CMD_RESTART: case CMD_RESTART:
#ifdef DEBUG #ifdef DEBUG
LOG("RESTART Request"); LOG("RESTART Request");
@ -150,7 +150,7 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
LOG("PARAMETERS Request"); LOG("PARAMETERS Request");
#endif #endif
if( m_pKernelEngine != NULL ) { if( m_pKernelEngine != NULL ) {
PLGS_PARAMETERS tPtr;
PLGS_3D_PARAMETERS tPtr;
tPtr = m_pKernelEngine->getDetectionParameters(); tPtr = m_pKernelEngine->getDetectionParameters();
if( tPtr != NULL ) { if( tPtr != NULL ) {
sendParameters( tPtr ); sendParameters( tPtr );
@ -171,8 +171,8 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
LOG("SET PARAMETERS Request"); LOG("SET PARAMETERS Request");
#endif #endif
if( m_pKernelEngine != NULL ) { if( m_pKernelEngine != NULL ) {
PLGS_PARAMETERS tPtr;
tPtr = (PLGS_PARAMETERS) ( Package->m_pData + SUB_CMD_IDX );
PLGS_3D_PARAMETERS tPtr;
tPtr = (PLGS_3D_PARAMETERS) ( Package->m_pData + SUB_CMD_IDX );
if( !m_pKernelEngine->setDetectionParameters( tPtr ) ){ if( !m_pKernelEngine->setDetectionParameters( tPtr ) ){
// Handle error setting parameters // Handle error setting parameters
LOG_ERROR( "Can't set Parameters!" ); LOG_ERROR( "Can't set Parameters!" );
@ -187,28 +187,28 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
LOG("GET SERIAL Request"); LOG("GET SERIAL Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_ADDRESS: case CMD_SET_ADDRESS:
#ifdef DEBUG #ifdef DEBUG
LOG("SET ADDRESS Request"); LOG("SET ADDRESS Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_SOFTWARE_VERSION: case CMD_GET_SOFTWARE_VERSION:
#ifdef DEBUG #ifdef DEBUG
LOG("GET SOFTWARE VER Request"); LOG("GET SOFTWARE VER Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_UNSUPPORTED: case CMD_UNSUPPORTED:
#ifdef DEBUG #ifdef DEBUG
LOG("UNSUPORTED Request"); LOG("UNSUPORTED Request");
#endif #endif
m_bClientWorkingMode = CWM_ERROR; m_bClientWorkingMode = CWM_ERROR;
break;
break;
case CMD_SET_COMM_SPEED: case CMD_SET_COMM_SPEED:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_BORDER: case CMD_BORDER:
case CMD_FULL_BORDER:{ case CMD_FULL_BORDER:{
// Full Draw By LRF // Full Draw By LRF
@ -259,7 +259,7 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
}; };
}; };
break; break;
};
};
case CMD_FULL_RESET: case CMD_FULL_RESET:
#ifdef DEBUG #ifdef DEBUG
LOG("FULL RESET Request"); LOG("FULL RESET Request");
@ -267,45 +267,45 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
sendFullResetACK(); sendFullResetACK();
m_bClientWorkingMode = CWM_INIT; m_bClientWorkingMode = CWM_INIT;
m_pKernelEngine->reset(true); m_pKernelEngine->reset(true);
break;
break;
case CMD_CAMERA: case CMD_CAMERA:
#ifdef DEBUG #ifdef DEBUG
LOG("CAMERA Request"); LOG("CAMERA Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_SERIAL_NUMBER: case CMD_SET_SERIAL_NUMBER:
#ifdef DEBUG #ifdef DEBUG
LOG("SET SERIAL Request"); LOG("SET SERIAL Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_BOARDDATA: case CMD_BOARDDATA:
#ifdef DEBUG #ifdef DEBUG
LOG("BORDER DATA Request"); LOG("BORDER DATA Request");
#endif #endif
break;
break;
case CMD_GET_CAMERA_PARAMETERS: case CMD_GET_CAMERA_PARAMETERS:
#ifdef DEBUG #ifdef DEBUG
LOG("GET CAMERA PARAMS Request"); LOG("GET CAMERA PARAMS Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_CAMERA_PARAMETERS: case CMD_SET_CAMERA_PARAMETERS:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_RELAY: case CMD_RELAY:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_RELAY_PARAMETERS: case CMD_GET_RELAY_PARAMETERS:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_RELAY_PARAMETERS: case CMD_SET_RELAY_PARAMETERS:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_FS_SUB_PACKET: case CMD_FS_SUB_PACKET:
m_bClientWorkingMode = CWM_FILE; m_bClientWorkingMode = CWM_FILE;
break;
break;
case CMD_STATE_2: case CMD_STATE_2:
if( m_bClientWorkingMode!= CWM_BORDER ){ if( m_bClientWorkingMode!= CWM_BORDER ){
if( m_pKernelEngine != NULL ) { if( m_pKernelEngine != NULL ) {
@ -348,50 +348,50 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
break; break;
case CMD_GET_WIDTH_TABLE: case CMD_GET_WIDTH_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_WIDTH_TABLE: case CMD_SET_WIDTH_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_VOLTAGE: case CMD_GET_VOLTAGE:
#ifdef DEBUG #ifdef DEBUG
LOG("Get Voltage Request"); LOG("Get Voltage Request");
#endif #endif
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_VOLTAGE_PARAMETERS: case CMD_GET_VOLTAGE_PARAMETERS:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_VOLTAGE_PARAMETERS: case CMD_SET_VOLTAGE_PARAMETERS:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_CALIBRATION_TABLE: case CMD_GET_CALIBRATION_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_CALIBRATION_TABLE: case CMD_SET_CALIBRATION_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_LRF_DISABLE: case CMD_GET_LRF_DISABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_LRF_DISABLE: case CMD_SET_LRF_DISABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_ZOOM_TABLE: case CMD_GET_ZOOM_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_ZOOM_TABLE: case CMD_SET_ZOOM_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_GET_TILT_TABLE: case CMD_GET_TILT_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break;
break;
case CMD_SET_TILT_TABLE: case CMD_SET_TILT_TABLE:
m_bClientWorkingMode = CWM_PARAMS; m_bClientWorkingMode = CWM_PARAMS;
break; break;
/* Shadow Masking Hidden Zones */ /* Shadow Masking Hidden Zones */
case CMD_GET_HZ_DATA: case CMD_GET_HZ_DATA:
m_bClientWorkingMode = CWM_MASK; m_bClientWorkingMode = CWM_MASK;
break;
break;
case CMD_SET_HZ_DATA:{ case CMD_SET_HZ_DATA:{
m_bClientWorkingMode = CWM_MASK; m_bClientWorkingMode = CWM_MASK;
LOG("Set RayTraced Mask"); LOG("Set RayTraced Mask");
@ -422,10 +422,10 @@ bool LRF_ClientHandler::packetHandler( protocolPackage *Package ){
tShMaskObj->saveRastered(); tShMaskObj->saveRastered();
}; };
}; };
break;
break;
case CMD_GET_HZ_ENABLE: case CMD_GET_HZ_ENABLE:
m_bClientWorkingMode = CWM_MASK; m_bClientWorkingMode = CWM_MASK;
break;
break;
case CMD_SET_HZ_ENABLE: case CMD_SET_HZ_ENABLE:
m_bClientWorkingMode = CWM_MASK; m_bClientWorkingMode = CWM_MASK;
break; break;
@ -614,5 +614,5 @@ void LRF_ClientHandler::dispatchEvent( EVENT_CONTAINER *Evt ){
#undef SUB_CMD_IDX #undef SUB_CMD_IDX
#undef DATA_BEGIN_IDX #undef DATA_BEGIN_IDX
#undef LOG
#undef LOG_ERROR
#undef LOG
#undef LOG_ERROR

18
lib/App/3dSERVER/LRF_ClientHandler.h

@ -14,15 +14,15 @@
*/ */
class LRF_ClientHandler : public networkClientHandler, public protocolLGS3D_Server { class LRF_ClientHandler : public networkClientHandler, public protocolLGS3D_Server {
private: private:
basicLogCollection *m_pLog;
LRF_Kernel *m_pKernelEngine;
E_LRF_WORK_MODE m_bKernelWorkingMode;
E_CLIENT_WORK_MODE m_bClientWorkingMode;
thresholdNode *m_pWorkingSAF;
EventsFIFO m_oOutputFIFO;
uint32_t m_nWorkingSAF;
uint32_t m_nCurrentSampleIDofBoardData;
basicMutex m_mOutputProtector;
basicLogCollection * m_pLog;
LRF_Kernel * m_pKernelEngine;
LRF_WORK_MODE m_bKernelWorkingMode;
CLIENT_WORK_MODE m_bClientWorkingMode;
thresholdNode * m_pWorkingSAF;
EventsFIFO m_oOutputFIFO;
uint32_t m_nWorkingSAF;
uint32_t m_nCurrentSampleIDofBoardData;
basicMutex m_mOutputProtector;
protected: protected:
bool packetHandler( protocolPackage *Package ); bool packetHandler( protocolPackage *Package );
public: public:

99
lib/App/3dSERVER/LRF_HardwareManager.cpp

@ -110,7 +110,7 @@ LRF_HardwareManager::LRF_HardwareManager( config_setting_t *SNode ){
#endif #endif
memset( &m_sPARAMETERS, 0 ,sizeof( LGS_PARAMETERS ));
memset( &m_sPARAMETERS, 0 ,sizeof( LGS_3D_PARAMETERS ));
m_sPARAMETERS.flags.BaseScanCount = BASE_SCAN_COUNT; m_sPARAMETERS.flags.BaseScanCount = BASE_SCAN_COUNT;
m_sPARAMETERS.flags.DetectorsCount = KERNEL_COUNT; m_sPARAMETERS.flags.DetectorsCount = KERNEL_COUNT;
@ -592,8 +592,8 @@ bool LRF_HardwareManager::setHardwareParams( PHW_PARAMS Params ){
return true; return true;
}; };
bool LRF_HardwareManager::getParams( LGS_PARAMETERS &Params ){
memcpy( &Params, &m_sPARAMETERS, sizeof(LGS_PARAMETERS) );
bool LRF_HardwareManager::getParams( LGS_3D_PARAMETERS &Params ){
memcpy( &Params, &m_sPARAMETERS, sizeof(LGS_3D_PARAMETERS) );
return true; return true;
}; };
@ -1629,43 +1629,66 @@ bool LRF_HardwareManager::getDetectionParams( TH_PARAMS &Params ){
#endif #endif
}; };
bool LRF_HardwareManager::setParams( LGS_3D_PARAMETERS *Params ){
if(Params == NULL) return false;
if(m_pSOC == NULL ) return false;
memcpy( &m_sPARAMETERS, Params, sizeof(LGS_3D_PARAMETERS) );
// Save into settings
m_sCP_Detector.delta = m_sPARAMETERS.nDelta;
m_sCP_Detector.flip_size = m_sPARAMETERS.nFlip;
m_sCP_Detector.good_points = m_sPARAMETERS.nGPointSamples;
m_sCP_Detector.offset = m_sPARAMETERS.nOffset;
m_sCP_Detector.order = m_sPARAMETERS.nOrder;
m_sCP_Detector.self_build_ena = m_sPARAMETERS.flags.BuildThByCore;
m_sCP_Detector.master = m_sPARAMETERS.flags.isMaster;
#ifdef DEBUG
char Buffer[256];
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]",
((m_sCP_Detector.master)?"M":"S"),
m_sCP_Detector.delta,
m_sCP_Detector.flip_size,
m_sCP_Detector.good_points,
m_sCP_Detector.order,
m_sCP_Detector.offset,
m_sCP_Detector.self_build_ena
);
LOG( Buffer );
#endif
// Apply new Parameters
if(!m_pSOC->setThCoreParams( &m_sCP_Detector )){
LOG_ERROR("Detection Core Set NEW Params Failure");
return false;
};
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams();
saveCurrentParameters();
return true;
};
bool LRF_HardwareManager::setDetectionParams( TH_PARAMS *Params ){ bool LRF_HardwareManager::setDetectionParams( TH_PARAMS *Params ){
if(Params == NULL) return false;
memcpy( &m_sPARAMETERS, Params, sizeof(LGS_PARAMETERS) );
if( Params == NULL) return false;
if( m_pSOC == NULL ) return false;
memcpy( &m_sCP_Detector, Params, sizeof(TH_PARAMS) );
#ifndef ONPC_TOTTAL_SIMULATOR #ifndef ONPC_TOTTAL_SIMULATOR
if( m_pSOC!=NULL ){
// Save into settings
m_sCP_Detector.delta = m_sPARAMETERS.nDelta;
m_sCP_Detector.flip_size = m_sPARAMETERS.nFlip;
m_sCP_Detector.good_points = m_sPARAMETERS.nGPointSamples;
m_sCP_Detector.offset = m_sPARAMETERS.nOffset;
m_sCP_Detector.order = m_sPARAMETERS.nOrder;
m_sCP_Detector.self_build_ena = m_sPARAMETERS.flags.BuildThByCore;
m_sCP_Detector.master = m_sPARAMETERS.flags.isMaster;
#ifdef DEBUG
char Buffer[256];
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]",
((m_sCP_Detector.master)?"M":"S"),
m_sCP_Detector.delta,
m_sCP_Detector.flip_size,
m_sCP_Detector.good_points,
m_sCP_Detector.order,
m_sCP_Detector.offset,
m_sCP_Detector.self_build_ena
);
LOG( Buffer );
#endif
// Apply new Parameters
if(!m_pSOC->setThCoreParams(Params)){
LOG_ERROR("Detection Core Set NEW Params Failure");
return false;
};
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams();
saveCurrentParameters();
return true;
};
return false;
#ifdef DEBUG
char Buffer[256];
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]",
((m_sCP_Detector.master)?"M":"S"),
m_sCP_Detector.delta,
m_sCP_Detector.flip_size,
m_sCP_Detector.good_points,
m_sCP_Detector.order,
m_sCP_Detector.offset,
m_sCP_Detector.self_build_ena
);
LOG( Buffer );
#endif
// Apply new Parameters
if(!m_pSOC->setThCoreParams( &m_sCP_Detector )){
LOG_ERROR("Detection Core Set NEW Params Failure");
return false;
};
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams();
saveCurrentParameters();
#else #else
return true; return true;
#endif #endif

7
lib/App/3dSERVER/LRF_HardwareManager.h

@ -31,6 +31,7 @@
#include "../../hardware/soc/classSOC.h" #include "../../hardware/soc/classSOC.h"
#include "../../hardware/soc/general/3DLRF.h" #include "../../hardware/soc/general/3DLRF.h"
#include "../../alg/lgs/detectorStructures.h"
#include "../../hardware/soc/general/sitara-am437x.h" #include "../../hardware/soc/general/sitara-am437x.h"
#ifndef PRU_SLAVE #ifndef PRU_SLAVE
@ -106,7 +107,7 @@ typedef enum eDataStatuses{
*/ */
class LRF_HardwareManager { class LRF_HardwareManager {
private: private:
LGS_PARAMETERS m_sPARAMETERS;
LGS_3D_PARAMETERS m_sPARAMETERS;
/* General System Variables*/ /* General System Variables*/
@ -189,10 +190,12 @@ class LRF_HardwareManager {
bool getDetectionParams( TH_PARAMS &Params ); bool getDetectionParams( TH_PARAMS &Params );
bool setDetectionParams( TH_PARAMS *Params ); bool setDetectionParams( TH_PARAMS *Params );
bool getHardwareParams( HW_PARAMS &Params ); bool getHardwareParams( HW_PARAMS &Params );
bool setHardwareParams( PHW_PARAMS Params ); bool setHardwareParams( PHW_PARAMS Params );
bool getParams( LGS_PARAMETERS &Params );
bool getParams( LGS_3D_PARAMETERS &Params );
bool setParams( LGS_3D_PARAMETERS *Params );
thresholdNode *getWorkingMemory( void ); thresholdNode *getWorkingMemory( void );
int getWorkingMemoryID( void ); int getWorkingMemoryID( void );

10
lib/App/3dSERVER/LRF_Kernel.cpp

@ -715,11 +715,11 @@ bool LRF_Kernel::setMode( LRF_WORK_MODE nMode ){
#endif #endif
}; };
PLGS_PARAMETERS LRF_Kernel::getDetectionParameters( void ){
PLGS_PARAMETERS tParam = NULL;
PLGS_3D_PARAMETERS LRF_Kernel::getDetectionParameters( void ){
PLGS_3D_PARAMETERS tParam = NULL;
if( m_pHardwareManager != NULL ){ if( m_pHardwareManager != NULL ){
tParam = (PLGS_PARAMETERS) malloc(sizeof(LGS_PARAMETERS));
memset( tParam, 0 , sizeof(LGS_PARAMETERS));
tParam = (PLGS_3D_PARAMETERS) malloc(sizeof(LGS_3D_PARAMETERS));
memset( tParam, 0 , sizeof(LGS_3D_PARAMETERS));
if( tParam != NULL ){ if( tParam != NULL ){
/*TH_PARAMS tThParams; /*TH_PARAMS tThParams;
if( m_pHardwareManager->getDetectionParams( tThParams ) ){ if( m_pHardwareManager->getDetectionParams( tThParams ) ){
@ -762,7 +762,7 @@ PLGS_PARAMETERS LRF_Kernel::getDetectionParameters( void ){
return tParam; return tParam;
}; };
bool LRF_Kernel::setDetectionParameters( PLGS_PARAMETERS ptr ){
bool LRF_Kernel::setDetectionParameters( PLGS_3D_PARAMETERS ptr ){
bool isCompromised = false; bool isCompromised = false;
HW_PARAMS tHwParams; HW_PARAMS tHwParams;
TH_PARAMS tThParams; TH_PARAMS tThParams;

5
lib/App/3dSERVER/LRF_Kernel.h

@ -23,6 +23,7 @@
#include "../../components/base/basicEventHeap.h" #include "../../components/base/basicEventHeap.h"
#include "LRF_HardwareManager.h" #include "LRF_HardwareManager.h"
#include "LRF_TwinConnector.h" #include "LRF_TwinConnector.h"
#include "../../alg/lgs/detectorStructures.h"
#include "../../alg/lgs/detector.h" #include "../../alg/lgs/detector.h"
#include "../../alg/lgs/mask.h" #include "../../alg/lgs/mask.h"
@ -128,8 +129,8 @@ class LRF_Kernel: public basicThread, public basicEngine{
bool setOffset( uint8_t nOffset ); bool setOffset( uint8_t nOffset );
bool setOrder( uint8_t nOrder ); bool setOrder( uint8_t nOrder );
PLGS_PARAMETERS getDetectionParameters( void );
bool setDetectionParameters( PLGS_PARAMETERS ptr );
PLGS_3D_PARAMETERS getDetectionParameters( void );
bool setDetectionParameters( PLGS_3D_PARAMETERS ptr );
bool reset( bool FullRestart = false ); bool reset( bool FullRestart = false );
bool shutdown( bool Restart = false ); bool shutdown( bool Restart = false );
uint8_t getExitCause( void ){ return m_bExitCause; }; uint8_t getExitCause( void ){ return m_bExitCause; };

8
lib/App/3dSERVER/LRF_TargetTracker.cpp

@ -227,10 +227,10 @@ int LRF_TargetTracker::validateTarget( targetRecord *TR, bool bIsMaster ){
pTREC->area ); pTREC->area );
if( pTREC->bType ) { if( pTREC->bType ) {
tData->type = EVT_TARGET_3D_WHITE; tData->type = EVT_TARGET_3D_WHITE;
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_WHITE, tBuff, (void *)tData );
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_WHITE, NULL, tBuff, (void *)tData );
} else { } else {
tData->type = EVT_TARGET_3D_BLACK; tData->type = EVT_TARGET_3D_BLACK;
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_BLACK, tBuff, (void *)tData );
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_BLACK, NULL, tBuff, (void *)tData );
}; };
if( tEvt != NULL ) { if( tEvt != NULL ) {
tEvt->m_eClass = EVT_CLASS_SENSOR_3D; tEvt->m_eClass = EVT_CLASS_SENSOR_3D;
@ -343,10 +343,10 @@ void LRF_TargetTracker::MirrorComplete( void ){
m_aTargetsPool[index].area ); m_aTargetsPool[index].area );
if( m_aTargetsPool[index].bType ) { if( m_aTargetsPool[index].bType ) {
tData->type = EVT_TARGET_3D_WHITE; tData->type = EVT_TARGET_3D_WHITE;
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_WHITE, tBuff, (void *)tData );
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_WHITE, NULL, tBuff, (void *)tData );
} else { } else {
tData->type = EVT_TARGET_3D_BLACK; tData->type = EVT_TARGET_3D_BLACK;
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_BLACK, tBuff, (void *)tData );
tEvt = createBasicEvent( 0, EVT_CLASS_SENSOR_3D, EVT_TARGET_3D_BLACK, NULL, tBuff, (void *)tData );
}; };
if( tEvt != NULL ) { if( tEvt != NULL ) {
tEvt->m_eClass = EVT_CLASS_SENSOR_3D; tEvt->m_eClass = EVT_CLASS_SENSOR_3D;

5
lib/data/curl/curlRequest.cpp

@ -129,11 +129,14 @@ void curlRequest::init_CURL(){
#else #else
curl_easy_setopt( m_pCURL, CURLOPT_VERBOSE, 0 ); curl_easy_setopt( m_pCURL, CURLOPT_VERBOSE, 0 );
#endif #endif
#ifdef __linux__ #ifdef __linux__
#if LIBCURL_VERSION_NUM >= 0x073C00 //7.60
curl_easy_setopt( m_pCURL, CURLOPT_TCP_FASTOPEN, 1 );
curl_easy_setopt( m_pCURL, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, 0 ); curl_easy_setopt( m_pCURL, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, 0 );
#endif
#endif #endif
curl_easy_setopt( m_pCURL, CURLOPT_NOPROGRESS, 1 ); curl_easy_setopt( m_pCURL, CURLOPT_NOPROGRESS, 1 );
curl_easy_setopt( m_pCURL, CURLOPT_TCP_FASTOPEN, 1 );
curl_easy_setopt( m_pCURL, CURLOPT_TCP_NODELAY, 1 ); curl_easy_setopt( m_pCURL, CURLOPT_TCP_NODELAY, 1 );
curl_easy_setopt( m_pCURL, CURLOPT_NOSIGNAL, 1 ); curl_easy_setopt( m_pCURL, CURLOPT_NOSIGNAL, 1 );
curl_easy_setopt( m_pCURL, CURLOPT_URL, m_pURL ); curl_easy_setopt( m_pCURL, CURLOPT_URL, m_pURL );

1
lib/data/protocol/protocolLGS3D.h

@ -2,6 +2,7 @@
#define __PROTOCOL_LGS_3D_99sd8_HEADERS__ #define __PROTOCOL_LGS_3D_99sd8_HEADERS__
#include "protocol.h" #include "protocol.h"
#include "../../alg/lgs/detectorStructures.h"
#include "protocolLGS_data.h" #include "protocolLGS_data.h"
class protocolLGS_3D: public protocolParser{ class protocolLGS_3D: public protocolParser{

4
lib/data/protocol/protocolLGS3D_server.cpp

@ -228,7 +228,7 @@ bool protocolLGS3D_Server::sendState2(U8 State, U8 bTargetsCount, U8 *pTargetsDa
}; };
}; };
bool protocolLGS3D_Server::sendParameters(PLGS_PARAMETERS ptr){
bool protocolLGS3D_Server::sendParameters( PLGS_3D_PARAMETERS ptr ){
if( m_oDataTransport == NULL ) return false; if( m_oDataTransport == NULL ) return false;
if( ptr != NULL ) { if( ptr != NULL ) {
U8 counter; U8 counter;
@ -237,7 +237,7 @@ bool protocolLGS3D_Server::sendParameters(PLGS_PARAMETERS ptr){
Buffer[CMD_IDX] = CMD_PARAMETERS; Buffer[CMD_IDX] = CMD_PARAMETERS;
Buffer[SUB_CMD_IDX] = SUB_DATA_INTEGRITY_VALID; Buffer[SUB_CMD_IDX] = SUB_DATA_INTEGRITY_VALID;
counter = 6; counter = 6;
for( int i=0; i < sizeof( LGS_PARAMETERS ); i++ ){
for( int i=0; i < sizeof( LGS_3D_PARAMETERS ); i++ ){
Buffer[counter] = *(((U8*)ptr)+i); Buffer[counter] = *(((U8*)ptr)+i);
counter++; counter++;
}; };

2
lib/data/protocol/protocolLGS3D_server.h

@ -18,7 +18,7 @@ class protocolLGS3D_Server: public protocolLGS_3D{
bool sendEvent( uint8_t Code); bool sendEvent( uint8_t Code);
bool sendFlip( uint16_t Count); bool sendFlip( uint16_t Count);
bool sendMode( uint8_t Mode); bool sendMode( uint8_t Mode);
bool sendParameters( PLGS_PARAMETERS ptr );
bool sendParameters( PLGS_3D_PARAMETERS ptr );
bool sendScan( void ); bool sendScan( void );
bool sendShadowInfo( ShadowMask *ShObj ); bool sendShadowInfo( ShadowMask *ShObj );
bool sendShadowStatus( bool Status, uint8_t ShadowID = 0 ); bool sendShadowStatus( bool Status, uint8_t ShadowID = 0 );

5
lib/data/transport/transportSocket.cpp

@ -38,13 +38,12 @@ transportSocket::~transportSocket(){
# endif # endif
}; };
/*
bool transportSocket::create( void ){ bool transportSocket::create( void ){
m_bInitComplete = init(); m_bInitComplete = init();
if( m_bInitComplete ) setConnectionStatus( CS_CONNECTED ); if( m_bInitComplete ) setConnectionStatus( CS_CONNECTED );
return m_bInitComplete; return m_bInitComplete;
}
;*/
};
void transportSocket::m_fThreadAProc(void){ void transportSocket::m_fThreadAProc(void){
int index; int index;

2
lib/data/transport/transportSocket.h

@ -29,7 +29,7 @@ public:
transportSocket(); transportSocket();
virtual ~transportSocket(); virtual ~transportSocket();
bool sendData(unsigned char *Data, int DataSize); bool sendData(unsigned char *Data, int DataSize);
//virtual bool create( void );
virtual bool create( void );
}; };

Loading…
Cancel
Save