EgoInterface.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifdef EGODLL_EXPORTS
  3. #define EGODLL_API __declspec(dllexport)
  4. #else
  5. #define EGODLL_API __declspec(dllimport)
  6. #endif
  7. #include <stdint.h>
  8. #include <memory>
  9. #include <array>
  10. #include "../common/comm.h"
  11. struct PointXYZI ///< user defined point type
  12. {
  13. float x;
  14. float y;
  15. float z;
  16. uint8_t intensity;
  17. };
  18. class IRender
  19. {
  20. public:
  21. virtual void OnRender(std::unique_ptr<uint8_t>& pBuffer,int32_t width,int32_t height) = 0;
  22. };
  23. class IEgoNotify
  24. {
  25. public:
  26. virtual void OnRobot(std::unique_ptr<UserCamera>& info) = 0;
  27. virtual void OnSigin(bool bRet) = 0;
  28. virtual void OnNotifyDel(int32_t peer) = 0;
  29. virtual void OnNotifyKickOff() = 0;
  30. virtual void OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4, int32_t r5) = 0;
  31. virtual void OnNotifyImu(int32_t x, int32_t y) = 0;
  32. virtual void OnNotifyPing(int32_t value) = 0;
  33. #ifdef LIDAR_SENSOR
  34. virtual void OnLidarData(bool isLeft, bool isDense, int32_t seq, PointXYZI* data, int32_t length) = 0;
  35. #endif
  36. };
  37. enum ControlStatus
  38. {
  39. Ok,
  40. GearNotN,
  41. BootStrap,//ÒѼӵç
  42. Startup,//ÒÑÆô¶¯
  43. Emergency,
  44. Steer,
  45. Throttle,
  46. Brake,
  47. ArmTriger,
  48. };
  49. class IEgoControl
  50. {
  51. public:
  52. virtual void Login(std::string account, std::string pass) = 0;
  53. virtual void Start(std::array<IRender*, RenderPosition::ALL>& ar) = 0;
  54. //virtual void ReqCarList() = 0;
  55. virtual void OnCarConnect(int32_t peer) = 0;
  56. virtual void OnCarLeave() = 0;
  57. virtual ControlStatus CheckStatus() = 0;
  58. };
  59. EGODLL_API IEgoControl* GetEgoController(IEgoNotify* n);