// // Created by zx on 2020/7/3. // #include #include "../lidar_locate/Locate_communicator.h" #include #include "../tool/thread_safe_list.h" int main(int argc,char* argv[]) { int exe_id=rand()%1000000; Locate_communicator* pLocator=Locate_communicator::get_instance_pointer(); pLocator->communication_connect("tcp://127.0.0.1:9006"); pLocator->communication_run(); int k=1; Thread_safe_list list; /*nnxx::socket socket{ nnxx::SP, nnxx::BUS }; socket.bind("tcp://127.0.0.1:9005"); socket.connect("tcp://127.0.0.1:9006");*/ int n=0; while(1) { message::Measure_request_msg request; //message::Base_info base_msg; //request.mutable_base_info()->CopyFrom(base_msg); request.mutable_base_info()->set_msg_type(message::eLocate_request_msg); request.mutable_base_info()->set_sender(message::eMain); request.mutable_base_info()->set_receiver(message::eMeasurer); //request.mutable_base_info()->set_timeout_ms(1000); request.set_command_id(exe_id+n++); request.set_terminal_id(rand()%6); message::Measure_response_msg response; message::Measure_request_msg request_1; std::string str=request.SerializeAsString(); Error_manager code=pLocator->locate_request(request,response); if(code!=SUCCESS) { std::cout<