dispatch_coordinates.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. //调度坐标参数
  19. #define DISPATCH_COORDINATES_PARAMETER_PATH "../setting/dispatch_coordinates.prototxt"
  20. //出入口的功能模式
  21. enum Passageway_functioning_pattern
  22. {
  23. PASSAGEWAY_FUNCTIONING_PATTERN_UNKNOWN = 0, //未知
  24. PASSAGEWAY_FUNCTIONING_PATTERN_INLET = 1, //单向入口
  25. PASSAGEWAY_FUNCTIONING_PATTERN_OUTLET = 2, //单向出口
  26. PASSAGEWAY_FUNCTIONING_PATTERN_BIDIRECTION = 3, //双向口
  27. };
  28. private:
  29. // 父类的构造函数必须保护,子类的构造函数必须私有。
  30. Dispatch_coordinates();
  31. public:
  32. //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。
  33. Dispatch_coordinates(const Dispatch_coordinates& other) = delete;
  34. Dispatch_coordinates& operator =(const Dispatch_coordinates& other) = delete;
  35. ~Dispatch_coordinates();
  36. public://API functions
  37. //初始化 调度的坐标系 模块。如下三选一
  38. virtual Error_manager dispatch_coordinates_init();
  39. //初始化 调度的坐标系 模块。从文件读取
  40. Error_manager dispatch_coordinates_init_from_protobuf(std::string prototxt_path);
  41. //初始化 调度的坐标系 模块。从protobuf读取
  42. Error_manager dispatch_coordinates_init_from_protobuf(Dispatch_proto::Dispatch_coordinates_parameter_all& dispatch_coordinates_parameter_all);
  43. public://get or set member variable
  44. protected://member functions
  45. public://member variable
  46. //楼上车位的坐标 1~165
  47. std::map<int, Point3D_tool::Point3D> m_packspace_coordinates;
  48. //一楼出入口的坐标 1100~1107
  49. std::map<int, Point3D_tool::Point3D> m_passageway_coordinates;
  50. //搬运器在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
  51. //搬运器在电梯井的坐标 2101~2112 2201~2212
  52. //机器手在一楼出入口的坐标 1100 和 1107
  53. std::map<int, Point3D_tool::Point3D> m_carrier_coordinates;
  54. //机器手在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
  55. //机器手在一楼出入口的坐标 1101~1106
  56. std::map<int, Point3D_tool::Point3D> m_catcher_coordinates;
  57. Point3D_tool::Point3D_box m_carrier_box;//搬运器 限定范围
  58. Point3D_tool::Point3D_box m_catcher_box;//机器手 限定范围
  59. float m_catcher_b_min;
  60. float m_catcher_b_max;
  61. float m_catcher_d1_min;
  62. float m_catcher_d1_max;
  63. float m_catcher_d2_min;
  64. float m_catcher_d2_max;
  65. float m_default_wheelbase; //默认轴距 2700mm
  66. float m_catcher_1th_floor_z; //机器手在1楼的z周高度, 1
  67. float m_catcher_2th_floor_z; //机器手在2楼的z周高度, 2620
  68. float m_catcher_3th_floor_z; //机器手在3楼的z周高度, 5220
  69. float m_catcher_4th_floor_z; //机器手在4楼的z周高度, 5410
  70. float m_carrier_1th_floor_z; //搬运器在1楼的z周高度, 1
  71. float m_carrier_2th_floor_z; //搬运器在2楼的z周高度, 2525
  72. float m_carrier_3th_floor_z; //搬运器在3楼的z周高度, 5125
  73. float m_carrier_4th_floor_z; //搬运器在4楼的z周高度, 7725
  74. float m_catcher_d1_d2_distance; //机器手2D1-2D2零位间距1903mm
  75. float m_catcher_wheel_base_limit; //机器手下降过程中的轮距限制 3000mm
  76. float m_carrier_y_y1_distance; //小跑车 y-y1的间距1500mm
  77. float m_carrier_default_y1_back; //小跑车的默认y1, 回到中跑车 4500mm
  78. float m_carrier_default_y1_leave; //小跑车的默认y1, 离开中跑车 10500mm
  79. float m_carrier_default_y_back; //小跑车的默认y, 回到中跑车 3000mm
  80. float m_carrier_default_y_leave; //小跑车的默认y, 离开中跑车 9000mm
  81. float m_carrier_default_x_left; //中跑车的默认x, 左侧电梯井 1mm
  82. float m_carrier_default_x_right; //中跑车的默认x, 左侧电梯井 32600mm
  83. int m_passageway_terminal_id_min; //通道口终端id最小值, 默认0
  84. int m_passageway_terminal_id_max; //通道口终端id最大值, 默认7
  85. int m_passageway_terminal_number; //通道口终端个数, 默认8
  86. std::map<int, Passageway_functioning_pattern> m_passageway_functioning_pattern_map;//出入口的功能模式
  87. int m_parkspace_id_min; //车位id最小值, 默认1
  88. int m_parkspace_id_max; //车位id最小值, 默认165
  89. int m_parkspace_id_total; //车位id总数, 默认165
  90. int m_car_wheel_base_min; //汽车轮距最小值, 默认1000
  91. int m_car_wheel_base_max; //汽车轮距最大值, 默认4000
  92. private:
  93. };
  94. #endif //NNXX_TESTS_DISPATCH_COORDINATES_H