Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef UR_COMMUNICATION_H_
00020 #define UR_COMMUNICATION_H_
00021
00022 #include "robot_state.h"
00023 #include "do_output.h"
00024 #include <vector>
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <string.h>
00028 #include <sys/time.h>
00029 #include <thread>
00030 #include <mutex>
00031 #include <condition_variable>
00032 #include <sys/types.h>
00033 #include <sys/socket.h>
00034 #include <netinet/in.h>
00035 #include <netinet/tcp.h>
00036 #include <netdb.h>
00037 #include <iostream>
00038 #include <unistd.h>
00039 #include <chrono>
00040 #include <fcntl.h>
00041 #include <sys/types.h>
00042
00043
00044 class UrCommunication {
00045 private:
00046 int pri_sockfd_, sec_sockfd_;
00047 struct sockaddr_in pri_serv_addr_, sec_serv_addr_;
00048 struct hostent *server_;
00049 bool keepalive_;
00050 std::thread comThread_;
00051 int flag_;
00052 void run();
00053
00054 public:
00055 bool connected_;
00056 RobotState* robot_state_;
00057
00058 UrCommunication(std::condition_variable& msg_cond, std::string host);
00059 bool start();
00060 void halt();
00061
00062 };
00063
00064 #endif