Commit Iniziale

This commit is contained in:
2019-10-21 11:37:31 +02:00
commit 44ac6e8802
56 changed files with 32022 additions and 0 deletions

54
libURcom/URCLinterface.h Normal file
View File

@@ -0,0 +1,54 @@
/*
* URCLinterface.h
*
* Created on: Jan 14, 2019
* Author: emanuele
*/
#ifndef URCLINTERFACE_H_
#define URCLINTERFACE_H_
#include "clientMessage.h"
#include <ctime>
#include <iostream>
#include <arpa/inet.h>
#include <spdlog/spdlog.h>
#include <boost/asio.hpp>
#include <boost/format.hpp>
using namespace std;
using namespace boost::asio;
using ip::tcp;
class UR_CLinterface {
public:
UR_CLinterface(shared_ptr<spdlog::logger>);
virtual ~UR_CLinterface();
bool connect(const char* ip, uint16_t port);
void disconnect();
void sendCommand(std::string command);
void sendPose(pose_t pos);
void sendJointPose(jointPose_t pos);
void readData();
void parseData();
clientData_t clientData;
private:
shared_ptr<spdlog::logger> log;
boost::asio::io_service io_service;
boost::asio::streambuf receive_buffer;
boost::system::error_code error;
tcp::socket* rsocket;
uint32_t lastDataLen=0;
unsigned char* lastData=NULL;
bool firstMessage=true;
};
#endif /* URCLINTERFACE_H_ */