You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.9 KiB

7 years ago
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __LRF_TARGETTRACKER_H_INCL__
  2. #define __LRF_TARGETTRACKER_H_INCL__
  3. #include "../../components/base/basicFunctionality.h"
  4. #include "../../components/base/basicLogCollection.h"
  5. #include "../../components/base/basicEventHeap.h"
  6. #include "../../hardware/soc/general/3DLRF.h"
  7. #define TRACKER_MAX_TARGETS_POOL 128
  8. #define TRACKER_DEFAULT_TTL_VALUE 3 // Scans to live
  9. typedef vector<uint32_t> vectorIDS;
  10. typedef struct S_TRACKING_RECORD{
  11. bool bActive;
  12. bool bMaster;
  13. bool bType;
  14. // Time
  15. uint32_t nUTS;
  16. uint32_t nUTmS;
  17. // Legacy
  18. uint32_t beginID;
  19. uint32_t endID;
  20. uint8_t kernelID;
  21. // Position in Sample Matrix
  22. uint32_t beginColumn;
  23. uint16_t beginRow;
  24. uint32_t endColumn;
  25. uint16_t endRow;
  26. // Detected Sample Data
  27. uint32_t area;
  28. uint32_t reducedRange;
  29. uint32_t areaCount;
  30. // Tracking Purpose variables
  31. uint32_t mTTL;
  32. uint32_t mSST;
  33. }TRACKING_RECORD;
  34. /**
  35. * TODO: Add class description
  36. *
  37. * @author gagua
  38. */
  39. class LRF_targetTracker {
  40. private:
  41. basicLogCollection *m_pLog;
  42. basicEventHeap *m_pEventHeap;
  43. uint32_t m_nSST;
  44. bool m_bPoolOverflow;
  45. uint32_t m_nWidth;
  46. uint32_t m_nDelta;
  47. uint32_t m_nSTS;
  48. uint32_t m_nSTS_R;
  49. TRACKING_RECORD m_aTargetsPool[TRACKER_MAX_TARGETS_POOL];
  50. TRACKING_RECORD *createTrackingRecord( targetRecord *TR, bool master = true );
  51. void clearTrackingRecord( int index );
  52. bool compareTrackingRecords( TRACKING_RECORD *A, TRACKING_RECORD *B );
  53. void extentTrackingRecord( TRACKING_RECORD *A, TRACKING_RECORD *B );
  54. public:
  55. // Constructor
  56. explicit LRF_targetTracker( int SST = 0, uint32_t Width = 0, uint32_t Delta = 32 );
  57. // Destructor
  58. virtual ~LRF_targetTracker();
  59. int validateTarget( targetRecord *TR, bool master = true );
  60. void ScanComplete( void );
  61. void MirrorComplete( void );
  62. uint32_t getSST( void ){ return m_nSST; };
  63. };
  64. #endif // __LRF_TARGETTRACKER_H_INCL__