ur_communication.h
Go to the documentation of this file.
00001 /*
00002  * ur_communication.h
00003  *
00004  * Copyright 2015 Thomas Timm Andersen
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
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 /* UR_COMMUNICATION_H_ */


ur_modern_driver
Author(s): Thomas Timm Andersen
autogenerated on Wed Apr 3 2019 02:55:31