// // Created by huli on 2021/3/24. // #ifndef NNXX_TESTS_DISPATCH_COORDINATES_H #define NNXX_TESTS_DISPATCH_COORDINATES_H #include "../error_code/error_code.h" #include "../dispatch/dispatch_parameter.pb.h" #include "../tool/singleton.h" #include "../tool/point3D_tool.h" #include #include //调度的坐标系 class Dispatch_coordinates:public Singleton { // 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。 friend class Singleton; public: #define DISPATCH_COORDINATES_PARAMETER_PATH "../setting/dispatch_coordinates.prototxt" private: // 父类的构造函数必须保护,子类的构造函数必须私有。 Dispatch_coordinates(); public: //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。 Dispatch_coordinates(const Dispatch_coordinates& other) = delete; Dispatch_coordinates& operator =(const Dispatch_coordinates& other) = delete; ~Dispatch_coordinates(); public://API functions //初始化 调度的坐标系 模块。如下三选一 virtual Error_manager dispatch_coordinates_init(); //初始化 调度的坐标系 模块。从文件读取 Error_manager dispatch_coordinates_init_from_protobuf(std::string prototxt_path); //初始化 调度的坐标系 模块。从protobuf读取 Error_manager dispatch_coordinates_init_from_protobuf(Dispatch_proto::Dispatch_coordinates_parameter_all& dispatch_coordinates_parameter_all); public://get or set member variable protected://member functions public://member variable //楼上车位的坐标 1~165 std::map m_packspace_coordinates; //一楼出入口的坐标 1100~1107 std::map m_passageway_coordinates; //搬运器在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406 //搬运器在电梯井的坐标 2101~2112 2201~2212 //机器手在一楼出入口的坐标 1100 和 1107 std::map m_carrier_coordinates; //机器手在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406 //机器手在一楼出入口的坐标 1101~1106 std::map m_catcher_coordinates; Point3D_tool::Point3D_box m_carrier_box;//搬运器 限定范围 Point3D_tool::Point3D_box m_catcher_box;//机器手 限定范围 float m_catcher_b_min; float m_catcher_b_max; float m_catcher_d1_min; float m_catcher_d1_max; float m_catcher_d2_min; float m_catcher_d2_max; float m_default_wheelbase; //默认轴距 float m_catcher_1th_floor_z; //机器手在1楼的z周高度 float m_catcher_2th_floor_z; float m_catcher_3th_floor_z; float m_catcher_4th_floor_z; float m_catcher_d1_d2_distance; //机器手2D1-2D2零位间距1903mm private: }; #endif //NNXX_TESTS_DISPATCH_COORDINATES_H