mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Tested and bugfixed masterboard data parsing
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <string.h>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <netinet/in.h>
|
||||
|
||||
namespace message_types {
|
||||
enum message_type {
|
||||
@@ -58,11 +59,11 @@ struct version_message {
|
||||
int8_t source;
|
||||
int8_t robot_message_type;
|
||||
int8_t project_name_size;
|
||||
char* project_name;
|
||||
char project_name[15];
|
||||
uint8_t major_version;
|
||||
uint8_t minor_version;
|
||||
int svn_revision;
|
||||
char* build_date;
|
||||
char build_date[25];
|
||||
};
|
||||
|
||||
struct masterboard_data {
|
||||
@@ -95,7 +96,7 @@ private:
|
||||
version_message version_msg_;
|
||||
masterboard_data mb_data_;
|
||||
|
||||
std::mutex val_lock_; // Locks the variables while unpack parses data;
|
||||
std::recursive_mutex val_lock_; // Locks the variables while unpack parses data;
|
||||
|
||||
std::condition_variable* pMsg_cond_; //Signals that new vars are available
|
||||
bool new_data_available_; //to avoid spurious wakes
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
class UrCommunication {
|
||||
private:
|
||||
int sockfd_;
|
||||
int pri_sockfd_, sec_sockfd_;
|
||||
struct sockaddr_in pri_serv_addr_, sec_serv_addr_;
|
||||
struct hostent *server_;
|
||||
bool keepalive_;
|
||||
|
||||
Reference in New Issue
Block a user