dispatch_coordinates.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // Created by huli on 2021/3/24.
  3. //
  4. #ifndef NNXX_TESTS_DISPATCH_COORDINATES_H
  5. #define NNXX_TESTS_DISPATCH_COORDINATES_H
  6. #include "../error_code/error_code.h"
  7. #include "../dispatch/dispatch_parameter.pb.h"
  8. #include "../tool/singleton.h"
  9. #include "../tool/point3D_tool.h"
  10. #include <glog/logging.h>
  11. #include <map>
  12. //调度的坐标系
  13. class Dispatch_coordinates:public Singleton<Dispatch_coordinates>
  14. {
  15. // 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。
  16. friend class Singleton<Dispatch_coordinates>;
  17. public:
  18. #define DISPATCH_COORDINATES_PARAMETER_PATH "../setting/dispatch_coordinates.prototxt"
  19. private:
  20. // 父类的构造函数必须保护,子类的构造函数必须私有。
  21. Dispatch_coordinates();
  22. public:
  23. //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。
  24. Dispatch_coordinates(const Dispatch_coordinates& other) = delete;
  25. Dispatch_coordinates& operator =(const Dispatch_coordinates& other) = delete;
  26. ~Dispatch_coordinates();
  27. public://API functions
  28. //初始化 调度的坐标系 模块。如下三选一
  29. virtual Error_manager dispatch_coordinates_init();
  30. //初始化 调度的坐标系 模块。从文件读取
  31. Error_manager dispatch_coordinates_init_from_protobuf(std::string prototxt_path);
  32. //初始化 调度的坐标系 模块。从protobuf读取
  33. Error_manager dispatch_coordinates_init_from_protobuf(Dispatch_proto::Dispatch_coordinates_parameter_all& dispatch_coordinates_parameter_all);
  34. public://get or set member variable
  35. protected://member functions
  36. public://member variable
  37. //楼上车位的坐标 1~165
  38. std::map<int, Point3D_tool::Point3D> m_packspace_coordinates;
  39. //一楼出入口的坐标 1100~1107
  40. std::map<int, Point3D_tool::Point3D> m_passageway_coordinates;
  41. //搬运器在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
  42. //搬运器在电梯井的坐标 2101~2112 2201~2212
  43. //机器手在一楼出入口的坐标 1100 和 1107
  44. std::map<int, Point3D_tool::Point3D> m_carrier_coordinates;
  45. //机器手在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
  46. //机器手在一楼出入口的坐标 1101~1106
  47. std::map<int, Point3D_tool::Point3D> m_catcher_coordinates;
  48. Point3D_tool::Point3D_box m_carrier_box;//搬运器 限定范围
  49. Point3D_tool::Point3D_box m_catcher_box;//机器手 限定范围
  50. float m_catcher_b_min;
  51. float m_catcher_b_max;
  52. float m_catcher_d1_min;
  53. float m_catcher_d1_max;
  54. float m_catcher_d2_min;
  55. float m_catcher_d2_max;
  56. float m_default_wheelbase; //默认轴距
  57. float m_catcher_1th_floor_z; //机器手在1楼的z周高度
  58. float m_catcher_2th_floor_z;
  59. float m_catcher_3th_floor_z;
  60. float m_catcher_4th_floor_z;
  61. float m_catcher_d1_d2_distance; //机器手2D1-2D2零位间距1903mm
  62. private:
  63. };
  64. #endif //NNXX_TESTS_DISPATCH_COORDINATES_H