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.

73 lines
2.1 KiB

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