diff --git a/lib/App/3dSERVER/LRF_HardwareManager.cpp b/lib/App/3dSERVER/LRF_HardwareManager.cpp index 61364a51..925132c6 100644 --- a/lib/App/3dSERVER/LRF_HardwareManager.cpp +++ b/lib/App/3dSERVER/LRF_HardwareManager.cpp @@ -1847,7 +1847,124 @@ bool LRF_HardwareManager::performFlip( void ){ volatile thresholdNode *th_node[40]; #else volatile thresholdNode *th_node[16]; +<<<<<<< HEAD + uint32_t LBA_ID; + uint8_t LRF_ID; + uint32_t cMax; + uint32_t cMin; + thresholdNode tTN; + int32_t cNodeID; + int32_t sNodeID; // Start point + bool QAreaOK; + const uint8_t Orders = m_sPARAMETERS.nOrder+1; + int x,y; + + th_node[0] = (volatile thresholdNode *) m_pSOC->getTH_MEMORY(); + if( th_node[0] != NULL ){ + th_node[1] = th_node[0]+ TH_SIZE_NODES; + th_node[2] = th_node[1]+ TH_SIZE_NODES; + th_node[3] = th_node[2]+ TH_SIZE_NODES; + th_node[4] = th_node[3]+ TH_SIZE_NODES; + th_node[5] = th_node[4]+ TH_SIZE_NODES; + th_node[6] = th_node[5]+ TH_SIZE_NODES; + th_node[7] = th_node[6]+ TH_SIZE_NODES; + th_node[8] = th_node[7]+ TH_SIZE_NODES; + th_node[9] = th_node[8]+ TH_SIZE_NODES; + th_node[10] = th_node[9]+ TH_SIZE_NODES; + th_node[11] = th_node[10]+ TH_SIZE_NODES; + th_node[12] = th_node[11]+ TH_SIZE_NODES; + th_node[13] = th_node[12]+ TH_SIZE_NODES; + th_node[14] = th_node[13]+ TH_SIZE_NODES; + th_node[15] = th_node[14]+ TH_SIZE_NODES; + + m_nGPointsFlags = 0xFF; + for( LRF_ID=0; LRF_ID= m_sPARAMETERS.nGPointSamples ){ +#else + if( tTN.values.cnt ){ +#endif + cMax = 0; + cMin = 4095; + QAreaOK = true; + + for( x = -m_sPARAMETERS.nOrder; x < Orders; x++ ) { + for( y = -m_sPARAMETERS.nOrder; y < Orders; y++ ) { + int LocalX = LocalStrideX+x; + int LocalY = LocalStrideY+y; + if( LocalY < 0 ) LocalY += Q_SCAN_COUNT; + if( LocalY > Q_SCAN_COUNT ) LocalY -= Q_SCAN_COUNT; + if( LocalX < 0 ) LocalX += M_SCAN_POINTS; + if( LocalX > M_SCAN_POINTS ) LocalX -= M_SCAN_POINTS; + uint32_t TestID = LBA_ID + ( LocalY * TH_LINE_NODES ) + LocalX; + + tTN.data = th_node[LRF_ID][TestID].data; +#ifdef STRONG_STAT + if( tTN.values.cnt >= m_sPARAMETERS.nGPointSamples ){ +#else + if( tTN.values.cnt ){ +#endif + if( cMax < tTN.values.max ) cMax = tTN.values.max; + if( cMin > tTN.values.min ) cMin = tTN.values.min; + } else { + QAreaOK = false; + break; + }; + }; + if( !QAreaOK ) break; + }; + if( QAreaOK ){ + tTN.values.cnt = 0x0F; + tTN.values.min =(cMin>m_sCP_Detector.offset)?cMin-m_sCP_Detector.offset:0; + tTN.values.max =(cMax<(4095-m_sCP_Detector.offset))?cMax+m_sCP_Detector.offset:4095; + } else { + // disable detection of that point + tTN.values.cnt = 0; + tTN.values.min = 0; + tTN.values.max = 4095; + }; + } else { // Not Enought points in values.cnt + // disable detection of that point + tTN.values.cnt = 0; +#ifndef TH_JUST_UPDATE_WORKING + tTN.values.min = 0; + tTN.values.max = 4095; +#endif + // Clear GoodPoint Flags at not measured point + m_nGPointsFlags &= ~( 1 << LRF_ID ); + }; +#ifdef TH_JUST_UPDATE_WORKING + // Just Update - Without Remove TH Old Info + if( tTN.values.cnt ){ + th_node[8|LRF_ID][LBA_ID].data = tTN.data; + }; +#else + th_node[8|LRF_ID][LBA_ID].data = tTN.data; +#endif + }; + }; + return true; + }; + }; + return false; +}; + +bool LRF_HardwareManager::performFlip___( void ){ + if( !m_bInitOK ) return false; + if( m_pSOC != NULL ){ + volatile thresholdNode *th_node[16]; +======= #endif +>>>>>>> 1b7de403432a292b2a4962f7b9f88d76f897df9e uint32_t sampleID; uint8_t lrfID; uint32_t cMax; diff --git a/lib/App/3dSERVER/LRF_HardwareManager.h b/lib/App/3dSERVER/LRF_HardwareManager.h index fd7fd299..35fef15b 100644 --- a/lib/App/3dSERVER/LRF_HardwareManager.h +++ b/lib/App/3dSERVER/LRF_HardwareManager.h @@ -126,6 +126,7 @@ class LRF_HardwareManager { void *m_vMemoryBlock[4]; classSOC *m_pSOC; bool performFlip(); + bool performFlip___(); bool cleanTH( uint8_t tID ); void beginService( void ); void restartService( void ); diff --git a/put_to_git b/put_to_git index 8227865a..0046013e 100755 --- a/put_to_git +++ b/put_to_git @@ -1,4 +1,4 @@ #!/bin/bash #git commit -a -m '$1' -git commit -a -m '3D Server - Corrected CAN Bus object to start communication thread' +git commit -a -m '3D Server - New Flip Alg'