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.

84 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PATHFINDER_BINARY_LOG_HEADER__
  2. #define __PATHFINDER_BINARY_LOG_HEADER__
  3. #include <ctype.h>
  4. #include <err.h>
  5. #include <errno.h>
  6. #include <getopt.h>
  7. #include <ifaddrs.h>
  8. #include <netdb.h>
  9. #include <paths.h>
  10. #include <poll.h>
  11. #include <stdio.h>
  12. #include <signal.h>
  13. #include <stdint.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16. #include <time.h>
  17. #include <unistd.h>
  18. #include <arpa/inet.h>
  19. #include <netinet/ip.h>
  20. #include <netinet/udp.h>
  21. #include <sys/param.h> /* MIN() */
  22. #include <sys/socket.h>
  23. #include "../base/basicSettingsProvider.h"
  24. #include "../base/basicFunctionality.h"
  25. #define MAX_RECORD_PAYLOAD 4095
  26. typedef struct S_BLOG_RECORD{
  27. uint8_t type;
  28. uint64_t ts;
  29. uint8_t payload[MAX_RECORD_PAYLOAD];
  30. } BLOG_RECORD;
  31. typedef struct S_BNO_DATA{
  32. uint8_t temperature;
  33. int16_t gravity_z;
  34. int16_t gravity_y;
  35. int16_t gravity_x;
  36. int16_t lacc_z;
  37. int16_t lacc_y;
  38. int16_t lacc_x;
  39. int16_t quaterion_z;
  40. int16_t quaterion_y;
  41. int16_t quaterion_x;
  42. int16_t quaterion_w;
  43. int16_t pitch;
  44. int16_t roll;
  45. int16_t yaw;
  46. int16_t gyro_z;
  47. int16_t gyro_y;
  48. int16_t gyro_x;
  49. int16_t mag_z;
  50. int16_t mag_y;
  51. int16_t mag_x;
  52. int16_t acc_z;
  53. int16_t acc_y;
  54. int16_t acc_x;
  55. } BNO_DATA;//45 bytes
  56. #define LRF_MAX_ANGLES 6000
  57. typedef struct S_LRF_DATA{
  58. uint64_t start_ts;
  59. uint16_t range[LRF_MAX_ANGLES];
  60. } LRF_DATA;
  61. class objectPathfinderBinaryLog{
  62. protected:
  63. char m_sUUID[42];
  64. public:
  65. objectPathfinderBinaryLog * getInstance();
  66. private:
  67. basicLogCollection * m_pLog;
  68. static objectPathfinderBinaryLog * _instance;
  69. objectPathfinderBinaryLog();
  70. virtual ~objectPathfinderBinaryLog();
  71. void uuidgen(void);
  72. BLOG_RECORD m_sRecBuffer;
  73. FILE * m_pFID;
  74. };
  75. #endif