// // 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; //默认轴距 2700mm float m_catcher_1th_floor_z; //机器手在1楼的z周高度, 1 float m_catcher_2th_floor_z; //机器手在2楼的z周高度, 2620 float m_catcher_3th_floor_z; //机器手在3楼的z周高度, 5220 float m_catcher_4th_floor_z; //机器手在4楼的z周高度, 5410 float m_carrier_1th_floor_z; //搬运器在1楼的z周高度, 1 float m_carrier_2th_floor_z; //搬运器在2楼的z周高度, 2525 float m_carrier_3th_floor_z; //搬运器在3楼的z周高度, 5125 float m_carrier_4th_floor_z; //搬运器在4楼的z周高度, 7725 float m_catcher_d1_d2_distance; //机器手2D1-2D2零位间距1903mm float m_catcher_wheel_base_limit; //机器手下降过程中的轮距限制 3000mm float m_carrier_y_y1_distance; //小跑车 y-y1的间距1500mm float m_carrier_default_y1_back; //小跑车的默认y1, 回到中跑车 4500mm float m_carrier_default_y1_leave; //小跑车的默认y1, 离开中跑车 10500mm float m_carrier_default_y_back; //小跑车的默认y, 回到中跑车 3000mm float m_carrier_default_y_leave; //小跑车的默认y, 离开中跑车 9000mm float m_carrier_default_x_left; //中跑车的默认x, 左侧电梯井 1mm float m_carrier_default_x_right; //中跑车的默认x, 左侧电梯井 32600mm private: }; #endif //NNXX_TESTS_DISPATCH_COORDINATES_H