فهرست منبع

20210324, 调度坐标

huli 4 سال پیش
والد
کامیت
76c0181b8b

+ 1 - 1
dispatch/carrier.cpp

@@ -214,7 +214,7 @@ Error_manager Carrier::update_device_communication()
 		m_actual_joint_motion_x2 = (Dispatch_device_base::Joint_motion)tp_carrier_status_from_plc_to_dispatch->m_actual_joint_motion_x2;
 		memcpy(m_actual_error_code, tp_carrier_status_from_plc_to_dispatch->m_actual_error_code, 50);
 		memcpy(m_actual_warning_code, tp_carrier_status_from_plc_to_dispatch->m_actual_warning_code, 50);
-		m_actual_error_description = (char*)(tp_carrier_status_from_plc_to_dispatch->m_actual_error_description);
+		m_actual_error_description = (char*)(tp_carrier_status_from_plc_to_dispatch->m_actual_error_description-2);
 
 		//重连之后,搬运器状态   E_DISCONNECT  ->>  E_THREE_LEVEL_WORK
 		if ( m_dispatch_device_status == Dispatch_device_base::E_DISCONNECT )

+ 18 - 0
dispatch/catcher.cpp

@@ -44,6 +44,8 @@ Catcher::Catcher()
 
 	memset(m_actual_error_code, 0, 50);	//搬运器设备的报警信息位
 	memset(m_actual_warning_code, 0, 50);	//升降机设备的报警信息位
+
+	m_catcher_direction = CATCHER_DIRECTION_UNKNOW;
 }
 
 Catcher::~Catcher()
@@ -204,6 +206,22 @@ Error_manager Catcher::update_device_communication()
 		memcpy(m_actual_warning_code, tp_catcher_status_from_plc_to_dispatch->m_actual_warning_code, 50);
 		m_actual_error_description = (char*)(tp_catcher_status_from_plc_to_dispatch->m_actual_error_description-2);
 
+		//机器手朝向
+		if ( m_actual_b >= CATCHER_DIRECTION_POSITIVE_MIN && m_actual_b <= CATCHER_DIRECTION_POSITIVE_MAX )
+		{
+			m_catcher_direction = CATCHER_DIRECTION_POSITIVE;
+		}
+		else if ( m_actual_b >= CATCHER_DIRECTION_NEGATIVE_MIN && m_actual_b <= CATCHER_DIRECTION_NEGATIVE_MAX )
+		{
+			m_catcher_direction = CATCHER_DIRECTION_NEGATIVE;
+		}
+		else
+		{
+			m_catcher_direction = CATCHER_DIRECTION_UNKNOW;
+		}
+
+
+
 		//重连之后,搬运器状态   E_DISCONNECT  ->>  E_THREE_LEVEL_WORK
 		if ( m_dispatch_device_status == Dispatch_device_base::E_DISCONNECT )
 		{

+ 6 - 5
dispatch/catcher.h

@@ -70,7 +70,7 @@ public:
 	unsigned char						m_last_heartbeat;			//上一次的心跳
 	//机器人的设备状态数据,
 	Device_status						m_actual_device_status;			//机器人的硬件设备状态
-	Load_status							m_actual_load_status;				//机器人的负载状态, 小跑车上面是否有车.
+	Load_status							m_actual_load_status;				//机器人的负载状态, 机器人上面是否有车.
 	//机器人的真实状态, 可能是路径中间的坐标
 	float 								m_actual_x;					//机器人坐标x轴,
 	float 								m_actual_y;					//机器人坐标y轴,
@@ -78,10 +78,10 @@ public:
 	float 								m_actual_z;					//机器人坐标z轴,
 	float 								m_actual_d1;				//机器人坐标d1轴, 机器人抓车杆纵向移动(前轮抓杆)
 	float 								m_actual_d2;				//机器人坐标d2轴, 机器人抓车杆纵向移动(后轮抓杆)
-	Clamp_motion						m_actual_clamp_motion1;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-	Clamp_motion						m_actual_clamp_motion2;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-	Clamp_motion						m_actual_clamp_motion3;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
-	Clamp_motion						m_actual_clamp_motion4;		//小跑车夹车杆. 0=无动作,1=夹紧,2=松开
+	Clamp_motion						m_actual_clamp_motion1;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+	Clamp_motion						m_actual_clamp_motion2;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+	Clamp_motion						m_actual_clamp_motion3;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
+	Clamp_motion						m_actual_clamp_motion4;		//机器人夹车杆. 0=无动作,1=夹紧,2=松开
 
 	//机器人设备的错误码
 	unsigned char						m_actual_error_code[50];	//机器人设备的故障信息位
@@ -89,6 +89,7 @@ public:
 	std::string							m_actual_error_description;//机器人设备的错误描述
 
 
+	Catcher_direction 					m_catcher_direction;		//机器手的朝向, true:90度   false:270度
 
 
 private:

+ 138 - 0
dispatch/dispatch_coordinates.cpp

@@ -0,0 +1,138 @@
+//
+// Created by huli on 2021/3/24.
+//
+
+#include "dispatch_coordinates.h"
+#include "../tool/proto_tool.h"
+
+
+Dispatch_coordinates::Dispatch_coordinates()
+{
+
+}
+
+Dispatch_coordinates::~Dispatch_coordinates()
+{
+
+}
+
+//初始化 调度的坐标系 模块。如下三选一
+Error_manager Dispatch_coordinates::dispatch_coordinates_init()
+{
+	return  dispatch_coordinates_init_from_protobuf(DISPATCH_COORDINATES_PARAMETER_PATH);
+}
+
+//初始化 调度的坐标系 模块。从文件读取
+Error_manager Dispatch_coordinates::dispatch_coordinates_init_from_protobuf(std::string prototxt_path)
+{
+	Dispatch_proto::Dispatch_coordinates_parameter_all t_dispatch_coordinates_parameter_all;
+	if(!  proto_tool::read_proto_param(prototxt_path,t_dispatch_coordinates_parameter_all) )
+	{
+		return Error_manager(DISPATCH_COORDINATES_READ_PROTOBUF_ERROR,MINOR_ERROR,
+							 "Dispatch_coordinates read_proto_param  failed");
+	}
+
+	return dispatch_coordinates_init_from_protobuf(t_dispatch_coordinates_parameter_all);
+}
+
+//初始化 调度的坐标系 模块。从protobuf读取
+Error_manager Dispatch_coordinates::dispatch_coordinates_init_from_protobuf(Dispatch_proto::Dispatch_coordinates_parameter_all& dispatch_coordinates_parameter_all)
+{
+	LOG(INFO) << " ---Dispatch_coordinates::dispatch_coordinates_init_from_protobuf() run--- "<< this;
+	Error_manager t_error;
+	int size;
+
+	size = dispatch_coordinates_parameter_all.packspace_coordinates_parameters_size();
+	for (int i = 0; i < size; ++i)
+	{
+		Point3D_tool::Point3D t_point3d;
+		int id = dispatch_coordinates_parameter_all.packspace_coordinates_parameters(i).id();
+		t_point3d.x = dispatch_coordinates_parameter_all.packspace_coordinates_parameters(i).x();
+		t_point3d.y = dispatch_coordinates_parameter_all.packspace_coordinates_parameters(i).y();
+		t_point3d.z = dispatch_coordinates_parameter_all.packspace_coordinates_parameters(i).z();
+		m_packspace_coordinates[id] = t_point3d;
+	}
+
+	size = dispatch_coordinates_parameter_all.passageway_coordinates_parameters_size();
+	for (int i = 0; i < size; ++i)
+	{
+		Point3D_tool::Point3D t_point3d;
+		int id = dispatch_coordinates_parameter_all.passageway_coordinates_parameters(i).id();
+		t_point3d.x = dispatch_coordinates_parameter_all.passageway_coordinates_parameters(i).x();
+		t_point3d.y = dispatch_coordinates_parameter_all.passageway_coordinates_parameters(i).y();
+		t_point3d.z = dispatch_coordinates_parameter_all.passageway_coordinates_parameters(i).z();
+		m_passageway_coordinates[id] = t_point3d;
+	}
+
+	size = dispatch_coordinates_parameter_all.carrier_coordinates_parameters_size();
+	for (int i = 0; i < size; ++i)
+	{
+		Point3D_tool::Point3D t_point3d;
+		int id = dispatch_coordinates_parameter_all.carrier_coordinates_parameters(i).id();
+		t_point3d.x = dispatch_coordinates_parameter_all.carrier_coordinates_parameters(i).x();
+		t_point3d.y = dispatch_coordinates_parameter_all.carrier_coordinates_parameters(i).y();
+		t_point3d.z = dispatch_coordinates_parameter_all.carrier_coordinates_parameters(i).z();
+		m_carrier_coordinates[id] = t_point3d;
+	}
+
+	size = dispatch_coordinates_parameter_all.catcher_coordinates_parameters_size();
+	for (int i = 0; i < size; ++i)
+	{
+		Point3D_tool::Point3D t_point3d;
+		int id = dispatch_coordinates_parameter_all.passageway_coordinates_parameters(i).id();
+		t_point3d.x = dispatch_coordinates_parameter_all.catcher_coordinates_parameters(i).x();
+		t_point3d.y = dispatch_coordinates_parameter_all.catcher_coordinates_parameters(i).y();
+		t_point3d.z = dispatch_coordinates_parameter_all.catcher_coordinates_parameters(i).z();
+		m_catcher_coordinates[id] = t_point3d;
+	}
+
+
+	m_carrier_box.x_min = dispatch_coordinates_parameter_all.carrier_box_parameters().x_min();
+	m_carrier_box.x_max = dispatch_coordinates_parameter_all.carrier_box_parameters().x_max();
+	m_carrier_box.y_min = dispatch_coordinates_parameter_all.carrier_box_parameters().y_min();
+	m_carrier_box.y_max = dispatch_coordinates_parameter_all.carrier_box_parameters().y_max();
+	m_carrier_box.z_min = dispatch_coordinates_parameter_all.carrier_box_parameters().z_min();
+	m_carrier_box.z_max = dispatch_coordinates_parameter_all.carrier_box_parameters().z_max();
+
+	m_catcher_box.x_min = dispatch_coordinates_parameter_all.catcher_box_parameters().x_min();
+	m_catcher_box.x_max = dispatch_coordinates_parameter_all.catcher_box_parameters().x_max();
+	m_catcher_box.y_min = dispatch_coordinates_parameter_all.catcher_box_parameters().y_min();
+	m_catcher_box.y_max = dispatch_coordinates_parameter_all.catcher_box_parameters().y_max();
+	m_catcher_box.z_min = dispatch_coordinates_parameter_all.catcher_box_parameters().z_min();
+	m_catcher_box.z_max = dispatch_coordinates_parameter_all.catcher_box_parameters().z_max();
+
+	m_catcher_b_min = dispatch_coordinates_parameter_all.catcher_b_min();
+	m_catcher_b_max = dispatch_coordinates_parameter_all.catcher_b_max();
+	m_catcher_d1_min = dispatch_coordinates_parameter_all.catcher_d1_min();
+	m_catcher_d1_max = dispatch_coordinates_parameter_all.catcher_d1_max();	
+	m_catcher_d2_min = dispatch_coordinates_parameter_all.catcher_d2_min();
+	m_catcher_d2_max = dispatch_coordinates_parameter_all.catcher_d2_max();
+
+	std::cout << " huli test :::: " << " m_packspace_coordinates.size() = " << m_packspace_coordinates.size() << std::endl;
+	std::cout << " huli test :::: " << " m_passageway_coordinates.size() = " << m_passageway_coordinates.size() << std::endl;
+	std::cout << " huli test :::: " << " m_carrier_coordinates.size() = " << m_carrier_coordinates.size() << std::endl;
+	std::cout << " huli test :::: " << " m_catcher_coordinates.size() = " << m_catcher_coordinates.size() << std::endl;
+
+/*
+	if ( communication_parameter_all.communication_parameters().has_bind_string() )
+	{
+		t_error = communication_bind(communication_parameter_all.communication_parameters().bind_string());
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+	}
+
+
+	for(int i=0;i<communication_parameter_all.communication_parameters().connect_string_vector_size();++i)
+	{
+		t_error = communication_connect( communication_parameter_all.communication_parameters().connect_string_vector(i) );
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+	}
+*/
+
+	return Error_code::SUCCESS;
+}

+ 79 - 0
dispatch/dispatch_coordinates.h

@@ -0,0 +1,79 @@
+//
+// 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 <glog/logging.h>
+#include <map>
+
+//调度的坐标系
+class Dispatch_coordinates:public Singleton<Dispatch_coordinates>
+{
+// 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。
+   friend class Singleton<Dispatch_coordinates>;
+
+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<int, Point3D_tool::Point3D>	m_packspace_coordinates;
+
+	//一楼出入口的坐标 1100~1107
+	std::map<int, Point3D_tool::Point3D>	m_passageway_coordinates;
+
+	//搬运器在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
+	//搬运器在电梯井的坐标 2101~2112 2201~2212
+	//机器手在一楼出入口的坐标 1100 和 1107
+	std::map<int, Point3D_tool::Point3D>	m_carrier_coordinates;
+
+	//机器手在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
+	//机器手在一楼出入口的坐标 1101~1106
+	std::map<int, Point3D_tool::Point3D>	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;
+
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_DISPATCH_COORDINATES_H

+ 16 - 0
dispatch/dispatch_device_base.h

@@ -125,6 +125,22 @@ public:
 		BOUNDARY_OVERSTEP       = 1,    //超界
 	};
 
+//机器手朝向角度
+#define CATCHER_DIRECTION_POSITIVE_MIN				70
+#define CATCHER_DIRECTION_POSITIVE_CENTER			90
+#define CATCHER_DIRECTION_POSITIVE_MAX				110
+#define CATCHER_DIRECTION_NEGATIVE_MIN				250
+#define CATCHER_DIRECTION_NEGATIVE_CENTER			270
+#define CATCHER_DIRECTION_NEGATIVE_MAX				290
+
+	//机器手朝向
+	enum Catcher_direction
+	{
+		CATCHER_DIRECTION_UNKNOW               		= 0,    //
+		CATCHER_DIRECTION_POSITIVE               	= 1,    //朝正, 70~110度
+		CATCHER_DIRECTION_NEGATIVE               	= 2,    //朝反, 250~290度
+	};
+
 public:
 	Dispatch_device_base();
 	Dispatch_device_base(const Dispatch_device_base& other)= default;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3745 - 4
dispatch/dispatch_parameter.pb.cc


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2597 - 173
dispatch/dispatch_parameter.pb.h


+ 115 - 0
dispatch/dispatch_parameter.proto

@@ -25,4 +25,119 @@ message Laser_parameter_all
     repeated Carrier_parameter      carrier_parameters=4;
     required int32                  passageway_size=5;
     repeated Passageway_parameter   passageway_parameters=6;
+}
+
+
+
+
+
+
+
+
+/*
+        Packspace_coordinates   id 的表示含义
+
+        1~165           2楼~12楼的停车位
+
+        1100            0号出口(在一楼)(目前没有)
+        1101~1106       1~6号出入口 (在一楼)
+        1107            7号出口(在一楼)
+        1201~1206       1~6号出入口上方2楼处
+        1301~1306       1~6号出入口上方3楼处
+        1401~1406       1~6号出入口上方4楼处
+
+        2101~2112       左侧电梯井(1楼~12楼)(一号搬运器的待机点)
+        2201~2212       右侧电梯井(1楼~12楼)(二号搬运器的待机点)
+
+(由于工程问题, 每一个车位的x值略有不同, 不是等比数列)
+*/
+
+//楼上车位的坐标 1~165
+message Packspace_coordinates_parameter
+{
+    optional int32                  id = 1[default = 0];
+    optional int32                  x = 2[default = 0];
+    optional int32                  y = 3[default = 0];
+    optional int32                  z = 4[default = 0];
+}
+//一楼出入口的坐标 1100~1107
+message Passageway_coordinates_parameter
+{
+    optional int32                  id = 1[default = 0];
+    optional int32                  x = 2[default = 0];
+    optional int32                  y = 3[default = 0];
+    optional int32                  z = 4[default = 0];
+}
+
+//搬运器在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
+//搬运器在电梯井的坐标 2101~2112 2201~2212
+//机器手在一楼出入口的坐标 1100 和 1107
+message Carrier_coordinates_parameter
+{
+    optional int32                  id = 1[default = 0];
+    optional int32                  x = 2[default = 0];
+    optional int32                  y = 3[default = 0];
+    optional int32                  z = 4[default = 0];
+}
+
+//机器手在2~4楼交界处 的坐标 1201~1206 1301~1306 1401~1406
+//机器手在一楼出入口的坐标 1101~1106
+message Catcher_coordinates_parameter
+{
+    optional int32                  id = 1[default = 0];
+    optional int32                  x = 2[default = 0];
+    optional int32                  y = 3[default = 0];
+    optional int32                  z = 4[default = 0];
+}
+//注意了, 搬运器和机器手在同层的z轴坐标是不同的, 机器手比搬运器高一点.
+//x轴和y必须相同,
+//搬运器和机器手交接时 使用汽车前轮对齐, 搬运器的Y1固定不同, 所以其他的3个夹杆需要根须轴距来计算.
+
+
+//搬运器 限定范围
+message Carrier_box_parameter
+{
+    optional int32                  x_min = 1[default = -1000000];
+    optional int32                  x_max = 2[default = 1000000];
+    optional int32                  y_min = 3[default = -1000000];
+    optional int32                  y_max = 4[default = 1000000];
+    optional int32                  z_min = 5[default = -1000000];
+    optional int32                  z_max = 6[default = 1000000];
+}
+
+
+//机器手 限定范围
+message Catcher_box_parameter
+{
+    optional int32                  x_min = 1[default = -1000000];
+    optional int32                  x_max = 2[default = 1000000];
+    optional int32                  y_min = 3[default = -1000000];
+    optional int32                  y_max = 4[default = 1000000];
+    optional int32                  z_min = 5[default = -1000000];
+    optional int32                  z_max = 6[default = 1000000];
+}
+
+message Axis_range_parameter
+{
+    optional int32                  min = 1[default = -1000000];
+    optional int32                  max = 2[default = 1000000];
+}
+
+
+message Dispatch_coordinates_parameter_all
+{
+    repeated Packspace_coordinates_parameter            packspace_coordinates_parameters = 1;
+    repeated Passageway_coordinates_parameter           passageway_coordinates_parameters = 2;
+    repeated Carrier_coordinates_parameter              carrier_coordinates_parameters = 3;
+    repeated Catcher_coordinates_parameter              catcher_coordinates_parameters = 4;
+
+    optional Carrier_box_parameter                      carrier_box_parameters = 5;
+    optional Catcher_box_parameter                      catcher_box_parameters = 6;
+    optional int32                                      catcher_b_min = 7;
+    optional int32                                      catcher_b_max = 8;
+    optional int32                                      catcher_d1_min = 9;
+    optional int32                                      catcher_d1_max = 10;
+    optional int32                                      catcher_d2_min = 11;
+    optional int32                                      catcher_d2_max = 12;
+
 }

+ 1 - 1
dispatch/passageway.cpp

@@ -261,7 +261,7 @@ Error_manager Passageway::update_device_communication()
 		m_actual_turntable_direction = (Dispatch_device_base::Turntable_direction)tp_passageway_status_from_plc_to_dispatch->m_actual_turntable_direction;
 		memcpy(m_actual_error_code, tp_passageway_status_from_plc_to_dispatch->m_actual_error_code, 50);
 		memcpy(m_actual_warning_code, tp_passageway_status_from_plc_to_dispatch->m_actual_warning_code, 50);
-		m_actual_error_description = (char*)(tp_passageway_status_from_plc_to_dispatch->m_actual_error_description);
+		m_actual_error_description = (char*)(tp_passageway_status_from_plc_to_dispatch->m_actual_error_description-2);
 
 		//重连之后,搬运器状态   E_DISCONNECT  ->>  E_THREE_LEVEL_WORK
 		if ( m_dispatch_device_status == Dispatch_device_base::E_DISCONNECT )

+ 7 - 3
error_code/error_code.h

@@ -343,7 +343,7 @@ enum Error_code
 	DISPATCH_MANAGER_TASK_TYPE_ERROR,					//调度管理模块,任务类型错误
 	DISPATCH_MANAGER_IS_NOT_READY,						//调度管理模块,不在准备状态
 
-	DISPATCH_DEVICE_ERROR_BASE								= 0x13030000,
+	DISPATCH_DEVICE_ERROR_BASE								= 0x13020000,
 	DISPATCH_DEVICE_READ_PROTOBUF_ERROR,				//调度设备模块,读取参数错误
 	DISPATCH_DEVICE_STATUS_BUSY,						//调度设备模块,状态正忙
 	DISPATCH_DEVICE_STATUS_ERROR,						//调度设备模块,状态错误
@@ -369,7 +369,7 @@ enum Error_code
 	CARRIER_RESPONS_ERROR,						//搬运器模块,指令的执行失败
 	CARRIER_TASK_NOTHINGNESS,					//搬运器模块,任务不存在
 
-	CATCHER_ERROR_BASE								= 0x13030000,
+	CATCHER_ERROR_BASE								= 0x13040000,
 	CATCHER_READ_PROTOBUF_ERROR,				//抓取器模块,读取参数错误
 	CATCHER_STATUS_BUSY,						//抓取器模块,状态正忙
 	CATCHER_STATUS_ERROR,						//抓取器模块,状态错误
@@ -380,7 +380,7 @@ enum Error_code
 	CATCHER_RESPONS_ERROR,						//抓取器模块,指令的执行失败
 	CATCHER_TASK_NOTHINGNESS,					//抓取器模块,任务不存在
 
-	PASSAGEWAY_ERROR_BASE								= 0x13040000,
+	PASSAGEWAY_ERROR_BASE								= 0x13050000,
 	PASSAGEWAY_READ_PROTOBUF_ERROR,				//通道口模块,读取参数错误
 	PASSAGEWAY_STATUS_BUSY,						//通道口模块,状态正忙
 	PASSAGEWAY_STATUS_ERROR,						//通道口模块,状态错误
@@ -392,6 +392,10 @@ enum Error_code
 	PASSAGEWAY_TASK_NOTHINGNESS,					//通道口模块,任务不存在
 
 
+	//DISPATCH_COORDINATES module, 通信模块
+	DISPATCH_COORDINATES_ERROR_BASE					= 0x13060000,
+	DISPATCH_COORDINATES_READ_PROTOBUF_ERROR,				//模块,读取参数错误
+
 
 	//snap7 通信模块 错误码
 	SNAP7_ERROR_BASE								= 0x1401000,

+ 2 - 42
main.cpp

@@ -15,6 +15,7 @@
 
 #include "./dispatch/dispatch_manager.h"
 #include "./dispatch/dispatch_communication.h"
+#include "./dispatch/dispatch_coordinates.h"
 
 
 #include "./tool/common_data.h"
@@ -51,54 +52,13 @@ GOOGLE_GLOG_DLL_DECL void shut_down_logging(const char* data, int size)
 #include <chrono>
 using namespace std;
 
-void myfunction (int i) {  // function:
-	std::cout << ' ' << i;
-}
-
-
-class AAA
-{
-public:
-	int a;
-};
-
-class BBB:public AAA
-{
-public:
-	int b;
-};
-
-class CCC:public AAA
-{
-public:
-	int c;
-};
 
 
 
 int main(int argc,char* argv[])
 {
+	Dispatch_coordinates::get_instance_references().dispatch_coordinates_init();
 
-	message::Dispatch_plan_request_msg		m_dispatch_plan_request_msg;		//2调度总规划的请求, 用于启动整个调度算法(调度管理->调度算法)
-
-	m_dispatch_plan_request_msg.mutable_base_info()->set_msg_type(message::Message_type::eDispatch_plan_request_msg);
-	m_dispatch_plan_request_msg.mutable_base_info()->set_timeout_ms(50);
-	m_dispatch_plan_request_msg.mutable_base_info()->set_sender(message::Communicator::eDispatch_mamager);
-	m_dispatch_plan_request_msg.mutable_base_info()->set_receiver(message::Communicator::eDispatch_control);
-	m_dispatch_plan_request_msg.set_command_key("m_command_key");
-//
-//std::cout << " huli test :::: " << " 1231231231231231 = " << m_dispatch_plan_request_msg.has_dispatch_source() << std::endl;
-//	m_dispatch_plan_request_msg.set_dispatch_source(50);
-//	std::cout << " huli test :::: " << " 1231231231231231 = " << m_dispatch_plan_request_msg.has_dispatch_source() << std::endl;
-//
-//	m_dispatch_plan_request_msg.clear_dispatch_source();
-//	std::cout << " huli test :::: " << " 1231231231231231 = " << m_dispatch_plan_request_msg.has_dispatch_source() << std::endl;
-
-	int aaa =  m_dispatch_plan_request_msg.dispatch_task_type();
-	std::cout << " huli test :::: " << " aaa = " << aaa << std::endl;
-
-	m_dispatch_plan_request_msg.DebugString();
-	std::cout << " huli test :::: " << " m_dispatch_plan_request_msg.DebugString() = " << m_dispatch_plan_request_msg.DebugString() << std::endl;
 
 	return 0;
 

+ 264 - 0
setting/dispatch_coordinates.prototxt

@@ -0,0 +1,264 @@
+
+
+packspace_coordinates_parameters
+{
+    id:1
+    x:300
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:2
+    x:2500
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:3
+    x:4700
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:4
+    x:7200
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:5
+    x:9400
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:6
+    x:11600
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:7
+    x:14100
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:8
+    x:16300
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:9
+    x:18500
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:10
+    x:21000
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:11
+    x:23200
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:12
+    x:25400
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:13
+    x:27900
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:14
+    x:30100
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:15
+    x:32300
+    y:9000
+    z:2525
+}
+
+packspace_coordinates_parameters
+{
+    id:16
+    x:300
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:17
+    x:2500
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:18
+    x:4700
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:19
+    x:7200
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:20
+    x:9400
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:21
+    x:11600
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:22
+    x:14100
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:23
+    x:16300
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:24
+    x:18500
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:25
+    x:21000
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:26
+    x:23200
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:27
+    x:25400
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:28
+    x:27900
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:29
+    x:30100
+    y:9000
+    z:2525
+}
+packspace_coordinates_parameters
+{
+    id:30
+    x:32300
+    y:9000
+    z:2525
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+carrier_box_parameters
+{
+    x_min:0
+    x_max:32600
+    y_min:3000
+    y_max:9100
+    z_min:0
+    z_max:29000
+}
+
+catcher_box_parameters
+{
+    x_min:7000
+    x_max:25500
+    y_min:2500
+    y_max:3600
+    z_min:0
+    z_max:5420
+}
+
+catcher_b_min:80
+catcher_b_max:280
+catcher_d1_min:0
+catcher_d1_max:650
+catcher_d2_min:0
+catcher_d2_max:650
+
+
+
+
+
+
+
+
+

+ 2 - 0
tool/common_data.h

@@ -20,6 +20,8 @@ public:
 
 
 
+
+
 	//整车的测量信息
 	struct Car_measure_information
 	{

+ 5 - 0
tool/point3D_tool.cpp

@@ -0,0 +1,5 @@
+//
+// Created by huli on 2021/3/24.
+//
+
+#include "point3D_tool.h"

+ 33 - 0
tool/point3D_tool.h

@@ -0,0 +1,33 @@
+//
+// Created by huli on 2021/3/24.
+//
+
+#ifndef NNXX_TESTS_POINT3D_TOOL_H
+#define NNXX_TESTS_POINT3D_TOOL_H
+
+
+class Point3D_tool
+{
+public:
+	//坐标
+	struct Point3D
+	{
+		float x=0;				//x轴
+		float y=0;				//y轴
+		float z=0;				//z轴
+	};
+
+	//平面坐标的限定范围
+	struct Point3D_box
+	{
+		float x_min=0;				//x轴最小值
+		float x_max=0;				//x轴最大值
+		float y_min=0;				//y轴最小值
+		float y_max=0;				//y轴最大值
+		float z_min=0;				//z轴最小值
+		float z_max=0;				//z轴最大值
+	};
+};
+
+
+#endif //NNXX_TESTS_POINT3D_TOOL_H