loc_point.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _LOC_POINT_HPP_
  2. #define _LOC_POINT_HPP_
  3. #include "point.h"
  4. #include "line_fit.h"
  5. struct loc_message;
  6. struct loc_point:point
  7. {
  8. int64_t m_time;
  9. int m_ct;
  10. uint32_t m_cid;
  11. uint8_t m_type;
  12. int m_sid;
  13. int m_site_cell_index = -1;
  14. uint64_t m_time_tmp = 0;
  15. float m_acc;
  16. float m_rav;
  17. int m_cell_index = -1;
  18. std::string m_direction;
  19. double m_speed_change_rate = 0.0;
  20. int m_cred_level;
  21. int m_tof[2];
  22. int16_t m_rsp[2];
  23. int m_step;
  24. double m_area;
  25. point m_sol[2];
  26. double m_dist;
  27. double m_speed;
  28. double m_speed_avg = 0;
  29. double m_angle; // 输出角度信息到历史记录zengmg
  30. int m_stat;
  31. bool m_useless;
  32. double m_dist1; //smooth phase 1
  33. double m_dist2; //smooth phase 3
  34. double m_smooth_x;
  35. double m_smooth_y;
  36. fit_result m_k;
  37. fit_result&set_k(const fit_result&k)
  38. {
  39. return m_k=k;
  40. }
  41. loc_point();
  42. const point& operator[](int i)const
  43. {
  44. return m_sol[i];
  45. }
  46. point& operator[](int i)
  47. {
  48. return m_sol[i];
  49. }
  50. double loc_dist(const point&pt)const
  51. {
  52. return m_sol[0].dist_direct(pt);
  53. }
  54. double loc_dist(const loc_point&lp)const
  55. {
  56. return m_sol[0].dist_direct(lp.m_sol[0]);
  57. }
  58. bool is_same_site(const loc_point&o)const
  59. {
  60. return m_sid==o.m_sid;
  61. }
  62. double time_off(const loc_point&o)const
  63. {
  64. return (o.m_time-m_time)/1000.;
  65. }
  66. double ct_off(const loc_point&o)const
  67. {
  68. return o.m_ct-m_ct;
  69. }
  70. void debug_out(const char * str="")const ;
  71. void set_sol(int i,const point&p) ;
  72. bool b_50m()const
  73. {
  74. static int tof_50m=50/(15.65*2.996*1e-4);
  75. return m_tof[0]==0?m_tof[1]>tof_50m:m_tof[0]>tof_50m;
  76. }
  77. loc_point& reset() ;
  78. int inc_cl(int cred_level) ;
  79. int set_cl(int cred_level) ;
  80. int cl()const ;
  81. void set_source(const loc_message&li,const loc_message&li2) ;
  82. void set_source(const loc_message&li) ;
  83. };
  84. #endif