// // // 20210425, hl_dispatch 和 hl_dispatch_B的版本进行同步, 此时调度管理的功能全部完成.后续可能还需要日志记录. // #include #include "./error_code/error_code.h" //#include "LogFiles.h" #include #include "./communication/communication_socket_base.h" #include "./tool/thread_pool.h" #include "./system/system_communication.h" #include "./system/system_executor.h" #include "./dispatch/dispatch_manager.h" #include "./dispatch/dispatch_communication.h" #include "./dispatch/dispatch_coordinates.h" #include "./tool/common_data.h" #include // std::for_each #define LIVOX_NUMBER 2 GOOGLE_GLOG_DLL_DECL void shut_down_logging(const char* data, int size) { time_t tt; time( &tt ); tt = tt + 8*3600; // transform the time zone tm* t= gmtime( &tt ); char buf[255]={0}; sprintf(buf,"./%d%02d%02d-%02d%02d%02d-dump.txt", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); FILE* tp_file=fopen(buf,"w"); fprintf(tp_file,data,strlen(data)); fclose(tp_file); } #include using namespace std; std::string sendMsg(int terminal_id,int parkingspace_index_id, float x, std::string key, message::Dispatch_motion_direction direction) { message::Locate_information locateInformation; message::Dispatch_request_msg dispatchRequestMsg; message::Base_info t_base_info; message::Car_info car_info; message::Parkspace_info parkspace_info; t_base_info.set_msg_type(message::eDispatch_request_msg); t_base_info.set_sender(message::eMain); t_base_info.set_receiver(message::eDispatch_manager); t_base_info.set_timeout_ms(100000000); car_info.set_car_height(1.6); car_info.set_car_width(1.8); car_info.set_license("鄂Awk123"); car_info.set_car_wheel_width(1.8); car_info.set_car_wheel_base(2.8); locateInformation.set_locate_x(x); locateInformation.set_locate_y(3); locateInformation.set_locate_angle(90); locateInformation.set_locate_length(3.2); locateInformation.set_locate_height(1.6); locateInformation.set_locate_width(1.8); locateInformation.set_locate_correct(true); locateInformation.set_locate_wheel_width(1.8); locateInformation.set_locate_wheel_base(2.8); parkspace_info.set_parkingspace_index_id(parkingspace_index_id); parkspace_info.set_parkingspace_room_id(1); parkspace_info.set_parkingspace_direction(message::Direction::eForward); parkspace_info.set_parkingspace_floor_id(3); parkspace_info.set_parkingspace_height(1.5); parkspace_info.set_parkingspace_width(1.5); parkspace_info.set_parkingspace_status(message::Parkspace_status::eParkspace_empty); parkspace_info.mutable_car_info()->CopyFrom(car_info); dispatchRequestMsg.mutable_base_info()->CopyFrom(t_base_info); dispatchRequestMsg.mutable_locate_information()->CopyFrom(locateInformation); dispatchRequestMsg.set_command_key(key); dispatchRequestMsg.set_dispatch_motion_direction(direction); dispatchRequestMsg.set_terminal_id(terminal_id); dispatchRequestMsg.mutable_parkspace_info()->CopyFrom(parkspace_info); LOG(INFO) << dispatchRequestMsg.DebugString(); return dispatchRequestMsg.SerializeAsString(); } int main(int argc,char* argv[]) { Error_manager t_error; const char* logPath = "./"; google::InitGoogleLogging("LidarMeasurement"); google::SetStderrLogging(google::INFO); google::SetLogDestination(0, logPath); google::SetLogFilenameExtension("zxlog"); google::InstallFailureSignalHandler(); google::InstallFailureWriter(&shut_down_logging); FLAGS_colorlogtostderr = true; // Set log color FLAGS_logbufsecs = 0; // Set log output speed(s) FLAGS_max_log_size = 1024; // Set max log file size(GB) FLAGS_stop_logging_if_full_disk = true; // Dispatch_communication_test dispatchCommunicationTest; // dispatchCommunicationTest.communication_init(); // std::this_thread::sleep_for(std::chrono::seconds(1)); nnxx::socket socket{nnxx::SP, nnxx::BUS}; // socket.bind("tcp://192.168.2.168:30000"); std::this_thread::sleep_for(std::chrono::seconds(1)); // // socket.send(sendMsg(1, 79, 7.755, "12345678901234567890123456_s1_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(2, 78, 11.055, "12345678901234567890123456_s2_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(3, 79, 14.655, "12345678901234567890123456_s3_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(4, 39, 17.955, "12345678901234567890123456_s4_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(5, 40, 21.555, "12345678901234567890123456_s5_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(6, 27, 24.855, "12345678901234567890123456_s6_wU", message::Dispatch_motion_direction::E_STORE_CAR)); // socket.send(sendMsg(1, 79, 7.755, "12345678901234567890123456_p1_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); socket.send(sendMsg(2, 37, 11.055, "12345678901234567890123456_p2_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); socket.send(sendMsg(3, 36, 14.655, "12345678901234567890123456_p3_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); socket.send(sendMsg(4, 19, 17.955, "12345678901234567890123456_p4_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); socket.send(sendMsg(5, 39, 21.555, "12345678901234567890123456_p5_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); socket.send(sendMsg(6, 40, 24.855, "12345678901234567890123456_p6_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); // socket.send(sendMsg(7, 39, 24.855, "12345678901234567890123456_p7_wU", message::Dispatch_motion_direction::E_PICKUP_CAR)); // std::this_thread::sleep_for(std::chrono::seconds(5)); //// // // message::Dispatch_control_request_msg control_reqeust; // control_reqeust.mutable_base_info()->set_msg_type(message::eDispatch_control_request_msg); // control_reqeust.mutable_base_info()->set_sender(message::eDispatch_control); // control_reqeust.mutable_base_info()->set_receiver(message::eDispatch_manager); // control_reqeust.mutable_base_info()->set_timeout_ms(100000000); // control_reqeust.set_command_key("12345678901234567890123456_p5_wU+120"); // control_reqeust.set_dispatch_task_type(message::ROBOT_MOVE); // control_reqeust.set_dispatch_device_type(message::ROBOT_2); // control_reqeust.set_dispatch_source(0); // control_reqeust.set_dispatch_destination(1403); // LOG(INFO) << control_reqeust.DebugString(); // socket.send(control_reqeust.SerializeAsString()); while (1) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); std::string str; message::Base_msg base_info; str=socket.recv(1); if ( str.size() > 0 ) { base_info.ParseFromString(str); if ( base_info.base_info().msg_type() == message::eDispatch_manager_status_msg ) { // std::cout << " Time_tool::get_instance_references().get_current_time_millisecond() = " << Time_tool::get_instance_references().get_current_time_millisecond() << std::endl; // std::cout <m_request_x = 11055; tp_catcher_task1->m_request_y = 3000; tp_catcher_task1->m_request_b = 90; tp_catcher_task1->m_request_z = 5410; tp_catcher_task1->m_request_d1 = 355; tp_catcher_task1->m_request_d2 = 455; tp_catcher_task1->m_request_wheelbase = 2800; tp_catcher_task1->m_request_clamp_motion = Catcher_task::E_CLAMP_LOOSE; t_error = t_catcher.execute_task(tp_task_Base1, Dispatch_device_base::DISPATCH_TASK_ONE_LEVEL); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::cout << " ---------------------------------------------------" << std::endl; /* char zxczxcxzc1 ; std::cin >> zxczxcxzc1 ; while ( 1 ) { std::cout << " huli test :::: " << " ===================================== " << std::endl; std::cout << " huli test :::: " << " tp_catcher_task->get_task_statu = " << tp_catcher_task->get_task_statu() << std::endl; std::cout << " huli test :::: " << " tp_catcher_task->m_respons_status = " << tp_catcher_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_key = " << tp_catcher_task->m_respons_key << std::endl; std::cout << " huli test :::: " << " m_respons_status = " << tp_catcher_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_x = " << tp_catcher_task->m_respons_x << std::endl; std::cout << " huli test :::: " << " m_respons_y = " << tp_catcher_task->m_respons_y << std::endl; std::cout << " huli test :::: " << " m_respons_b = " << tp_catcher_task->m_respons_b << std::endl; std::cout << " huli test :::: " << " m_respons_z = " << tp_catcher_task->m_respons_z << std::endl; std::cout << " huli test :::: " << " m_respons_d1 = " << tp_catcher_task->m_respons_d1 << std::endl; std::cout << " huli test :::: " << " m_respons_d2 = " << tp_catcher_task->m_respons_d2 << std::endl; std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_catcher_task->m_respons_wheelbase << std::endl; std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_catcher_task->m_respons_clamp_motion << std::endl; std::cout << " ---------------------------------------------------" << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_catcher.get_dispatch_device_status() << std::endl; int heat = t_catcher.m_last_heartbeat; std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl; std::cout << " huli test :::: " << " m_actual_device_status = " << t_catcher.m_actual_device_status << std::endl; std::cout << " huli test :::: " << " m_actual_load_status = " << t_catcher.m_actual_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_x = " << t_catcher.m_actual_x << std::endl; std::cout << " huli test :::: " << " m_actual_y = " << t_catcher.m_actual_y << std::endl; std::cout << " huli test :::: " << " m_actual_b = " << t_catcher.m_actual_b << std::endl; std::cout << " huli test :::: " << " m_actual_z = " << t_catcher.m_actual_z << std::endl; std::cout << " huli test :::: " << " m_actual_d1 = " << t_catcher.m_actual_d1 << std::endl; std::cout << " huli test :::: " << " m_actual_d2 = " << t_catcher.m_actual_d2 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_catcher.m_actual_clamp_motion1 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_catcher.m_actual_clamp_motion2 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion3 = " << t_catcher.m_actual_clamp_motion3 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion4 = " << t_catcher.m_actual_clamp_motion4 << std::endl; std::cout << " huli test :::: " << " m_actual_error_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_catcher.m_actual_error_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_warning_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_catcher.m_actual_warning_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_error_description = " << t_catcher.m_actual_error_description << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } */ Carrier t_carrier20; t_error = t_carrier20.dispatch_device_base_init(0); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::this_thread::sleep_for(std::chrono::seconds(2)); std::shared_ptr tp_task_Base20(new Carrier_task); Carrier_task * tp_carrier_task20 = (Carrier_task *)tp_task_Base20.get(); tp_carrier_task20->task_init(NULL,std::chrono::milliseconds(15000)); tp_carrier_task20->m_request_key = "x23456789012345678901234567890c0"; tp_carrier_task20->m_request_x = 1; // tp_carrier_task20->m_request_x = 32600; tp_carrier_task20->m_request_y = 3000; tp_carrier_task20->m_request_z = 2525; tp_carrier_task20->m_request_y1 = 4500; tp_carrier_task20->m_request_y2 = 1700; tp_carrier_task20->m_request_clamp_motion = Carrier_task::E_CLAMP_LOOSE; tp_carrier_task20->m_request_joint_motion_x = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task20->m_request_joint_motion_y = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task20->m_request_space_id = 555; tp_carrier_task20->m_request_floor_id = 555; tp_carrier_task20->m_request_wheelbase = 555; t_error = t_carrier20.execute_task(tp_task_Base20, Dispatch_device_base::DISPATCH_TASK_ONE_LEVEL); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::cout << " ---------------------------------------------------" << std::endl; /* char zxczxcxzc20 ; std::cin >> zxczxcxzc20 ; while ( 1 ) { std::cout << " huli test :::: " << " ===================================== " << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl; std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl; std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl; std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl; std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl; std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl; std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl; std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl; std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl; std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl; std::cout << " ---------------------------------------------------" << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl; int heat = t_carrier.m_last_heartbeat; std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl; std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl; std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl; std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl; std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl; std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl; std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl; std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl; std::cout << " huli test :::: " << " m_actual_error_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_error_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_warning_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_warning_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } */ Carrier t_carrier21; t_error = t_carrier21.dispatch_device_base_init(1); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::this_thread::sleep_for(std::chrono::seconds(2)); std::shared_ptr tp_task_Base21(new Carrier_task); Carrier_task * tp_carrier_task21 = (Carrier_task *)tp_task_Base21.get(); tp_carrier_task21->task_init(NULL,std::chrono::milliseconds(15000)); tp_carrier_task21->m_request_key = "x23456789012345678901234567890c1"; // tp_carrier_task21->m_request_x = 1; tp_carrier_task21->m_request_x = 32600; tp_carrier_task21->m_request_y = 3000; tp_carrier_task21->m_request_z = 2525; tp_carrier_task21->m_request_y1 = 4500; tp_carrier_task21->m_request_y2 = 1700; tp_carrier_task21->m_request_clamp_motion = Carrier_task::E_CLAMP_LOOSE; tp_carrier_task21->m_request_joint_motion_x = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task21->m_request_joint_motion_y = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task21->m_request_space_id = 555; tp_carrier_task21->m_request_floor_id = 555; tp_carrier_task21->m_request_wheelbase = 555; t_error = t_carrier21.execute_task(tp_task_Base21, Dispatch_device_base::DISPATCH_TASK_ONE_LEVEL); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::cout << " ---------------------------------------------------" << std::endl; /* char zxczxcxzc21 ; std::cin >> zxczxcxzc21 ; while ( 1 ) { std::cout << " huli test :::: " << " ===================================== " << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl; std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl; std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl; std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl; std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl; std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl; std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl; std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl; std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl; std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl; std::cout << " ---------------------------------------------------" << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl; int heat = t_carrier.m_last_heartbeat; std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl; std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl; std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl; std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl; std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl; std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl; std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl; std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl; std::cout << " huli test :::: " << " m_actual_error_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_error_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_warning_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_warning_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } */ Carrier t_carrier22; t_error = t_carrier22.dispatch_device_base_init(2); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::this_thread::sleep_for(std::chrono::seconds(2)); std::shared_ptr tp_task_Base22(new Carrier_task); Carrier_task * tp_carrier_task22 = (Carrier_task *)tp_task_Base22.get(); tp_carrier_task22->task_init(NULL,std::chrono::milliseconds(15000)); tp_carrier_task22->m_request_key = "x23456789012345678901234567890c2"; tp_carrier_task22->m_request_x = 24855; // tp_carrier_task22->m_request_x = 4700; tp_carrier_task22->m_request_y = 3000; tp_carrier_task22->m_request_z = 5125; tp_carrier_task22->m_request_y1 = 4500; tp_carrier_task22->m_request_y2 = 1700; tp_carrier_task22->m_request_clamp_motion = Carrier_task::E_CLAMP_LOOSE; tp_carrier_task22->m_request_joint_motion_x = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task22->m_request_joint_motion_y = Carrier_task::E_JOINT_HOLD_OUT; tp_carrier_task22->m_request_space_id = 555; tp_carrier_task22->m_request_floor_id = 555; tp_carrier_task22->m_request_wheelbase = 555; t_error = t_carrier22.execute_task(tp_task_Base22, Dispatch_device_base::DISPATCH_TASK_ONE_LEVEL); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::cout << " ---------------------------------------------------" << std::endl; /* char zxczxcxzc22 ; std::cin >> zxczxcxzc22 ; while ( 1 ) { std::cout << " huli test :::: " << " ===================================== " << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->get_task_statu = " << tp_carrier_task->get_task_statu() << std::endl; std::cout << " huli test :::: " << " tp_carrier_task->m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_key = " << tp_carrier_task->m_respons_key << std::endl; std::cout << " huli test :::: " << " m_respons_status = " << tp_carrier_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_x = " << tp_carrier_task->m_respons_x << std::endl; std::cout << " huli test :::: " << " m_respons_y = " << tp_carrier_task->m_respons_y << std::endl; std::cout << " huli test :::: " << " m_respons_z = " << tp_carrier_task->m_respons_z << std::endl; std::cout << " huli test :::: " << " m_respons_y1 = " << tp_carrier_task->m_respons_y1 << std::endl; std::cout << " huli test :::: " << " m_respons_y2 = " << tp_carrier_task->m_respons_y2 << std::endl; std::cout << " huli test :::: " << " m_respons_clamp_motion = " << tp_carrier_task->m_respons_clamp_motion << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_x = " << tp_carrier_task->m_respons_joint_motion_x << std::endl; std::cout << " huli test :::: " << " m_respons_joint_motion_y = " << tp_carrier_task->m_respons_joint_motion_y << std::endl; std::cout << " huli test :::: " << " m_respons_space_id = " << tp_carrier_task->m_respons_space_id << std::endl; std::cout << " huli test :::: " << " m_respons_floor_id = " << tp_carrier_task->m_respons_floor_id << std::endl; std::cout << " huli test :::: " << " m_respons_wheelbase = " << tp_carrier_task->m_respons_wheelbase << std::endl; std::cout << " ---------------------------------------------------" << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::cout << " huli test :::: " << " t_carrier_base.get_carrier_status() = " << t_carrier.get_dispatch_device_status() << std::endl; int heat = t_carrier.m_last_heartbeat; std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl; std::cout << " huli test :::: " << " m_actual_device_status = " << t_carrier.m_actual_device_status << std::endl; std::cout << " huli test :::: " << " m_actual_load_status = " << t_carrier.m_actual_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_x = " << t_carrier.m_actual_x << std::endl; std::cout << " huli test :::: " << " m_actual_y = " << t_carrier.m_actual_y << std::endl; std::cout << " huli test :::: " << " m_actual_z = " << t_carrier.m_actual_z << std::endl; std::cout << " huli test :::: " << " m_actual_y1 = " << t_carrier.m_actual_y1 << std::endl; std::cout << " huli test :::: " << " m_actual_y2 = " << t_carrier.m_actual_y2 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion1 = " << t_carrier.m_actual_clamp_motion1 << std::endl; std::cout << " huli test :::: " << " m_actual_clamp_motion2 = " << t_carrier.m_actual_clamp_motion2 << std::endl; std::cout << " huli test :::: " << " m_actual_small_sports_car_motion = " << t_carrier.m_actual_small_sports_car_motion << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x1 = " << t_carrier.m_actual_joint_motion_x1 << std::endl; std::cout << " huli test :::: " << " m_actual_joint_motion_x2 = " << t_carrier.m_actual_joint_motion_x2 << std::endl; std::cout << " huli test :::: " << " m_actual_error_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_error_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_warning_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_carrier.m_actual_warning_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_error_description = " << t_carrier.m_actual_error_description << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } */ /* Passageway t_passageway; t_error = t_passageway.dispatch_device_base_init(1); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::this_thread::sleep_for(std::chrono::seconds(2)); std::shared_ptr tp_task_Base3(new Passageway_task); Passageway_task * tp_passageway_task = (Passageway_task *)tp_task_Base3.get(); tp_passageway_task->task_init(NULL,std::chrono::milliseconds(15000)); tp_passageway_task->m_request_key = "ABCDEF"; tp_passageway_task->m_request_inside_door_motion = Passageway_task::DOOR_OPEN; tp_passageway_task->m_request_outside_door_motion = Passageway_task::DOOR_CLOSE; tp_passageway_task->m_request_turntable_direction = Passageway_task::TURNTABLE_DIRECTION_OUTSIDE; t_error = t_passageway.execute_task(tp_task_Base3, Dispatch_device_base::E_ONE_LEVEL); std::cout << " huli test :::: " << " t_error = " << t_error << std::endl; std::cout << " ---------------------------------------------------" << std::endl; char zxczxcxzc3 ; std::cin >> zxczxcxzc3 ; while ( 1 ) { std::cout << " huli test :::: " << " ===================================== " << std::endl; std::cout << " huli test :::: " << " tp_passageway_task->get_task_statu = " << tp_passageway_task->get_task_statu() << std::endl; std::cout << " huli test :::: " << " tp_passageway_task->m_respons_status = " << tp_passageway_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_key = " << tp_passageway_task->m_respons_key << std::endl; std::cout << " huli test :::: " << " m_respons_status = " << tp_passageway_task->m_respons_status << std::endl; std::cout << " huli test :::: " << " m_respons_inside_door_motion = " << tp_passageway_task->m_respons_inside_door_motion << std::endl; std::cout << " huli test :::: " << " m_respons_outside_door_motion = " << tp_passageway_task->m_respons_outside_door_motion << std::endl; std::cout << " huli test :::: " << " m_respons_turntable_direction = " << tp_passageway_task->m_respons_turntable_direction << std::endl; std::cout << " ---------------------------------------------------" << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::cout << " huli test :::: " << " t_passageway_base.get_passageway_status() = " << t_passageway.get_dispatch_device_status() << std::endl; int heat = t_passageway.m_last_heartbeat; std::cout << " huli test :::: " << " m_last_heartbeat = " << heat << std::endl; std::cout << " huli test :::: " << " m_actual_device_status = " << t_passageway.m_actual_device_status << std::endl; std::cout << " huli test :::: " << " m_actual_inside_load_status = " << t_passageway.m_actual_inside_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_outside_load_status = " << t_passageway.m_actual_outside_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_front_overstep_the_boundary = " << t_passageway.m_actual_front_overstep_the_boundary << std::endl; std::cout << " huli test :::: " << " m_actual_back_overstep_the_boundary = " << t_passageway.m_actual_back_overstep_the_boundary << std::endl; std::cout << " huli test :::: " << " m_actual_height_overstep_the_boundary = " << t_passageway.m_actual_height_overstep_the_boundary << std::endl; std::cout << " huli test :::: " << " m_actual_outside_door_sensor = " << t_passageway.m_actual_outside_door_sensor << std::endl; std::cout << " huli test :::: " << " m_actual_inside_door_motion = " << t_passageway.m_actual_inside_door_motion << std::endl; std::cout << " huli test :::: " << " m_actual_outside_door_motion = " << t_passageway.m_actual_outside_door_motion << std::endl; std::cout << " huli test :::: " << " m_actual_turntable_load_status = " << t_passageway.m_actual_turntable_load_status << std::endl; std::cout << " huli test :::: " << " m_actual_turntable_direction = " << t_passageway.m_actual_turntable_direction << std::endl; std::cout << " huli test :::: " << " m_actual_error_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_passageway.m_actual_error_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_warning_code = " << std::endl; for (int i = 0; i < 50; ++i) { printf("0x%x ", t_passageway.m_actual_warning_code[i]); } std::cout << std::endl; std::cout << " huli test :::: " << " m_actual_error_description = " << t_passageway.m_actual_error_description << std::endl; std::cout << " huli test :::: " << " *********************************************** = " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } */ while (1) { } char ch123 ; std::cin >> ch123 ; Dispatch_communication::get_instance_references().communication_uninit(); return 0; int t_dispatch_id = 0; // std::cin >> t_dispatch_id ; if ( argc == 2 ) { std::cout << " huli test :::: " << " argv[1] = " << argv[1] << std::endl; t_dispatch_id = atoi(argv[1]); } std::cout << " huli test :::: " << " t_dispatch_id = " << t_dispatch_id << std::endl; Dispatch_manager::get_instance_references().dispatch_manager_init(t_dispatch_id); std::cout << "Dispatch_manager = " << Dispatch_manager::get_instance_references().get_dispatch_manager_status() << std::endl; System_executor::get_instance_references().system_executor_init(8); std::cout << "System_executor = " << System_executor::get_instance_references().get_system_executor_status() << std::endl; System_communication::get_instance_references().communication_init(); char ch ; std::cin >> ch ; System_communication::get_instance_references().communication_uninit(); System_executor::get_instance_references().system_executor_uninit(); Dispatch_manager::get_instance_references().dispatch_manager_uninit(); return 0; }