Created
April 9, 2018 18:10
-
-
Save SysOverdrive/c044dafcf26ead5d6ffa29ba1e489fd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct center { | |
center() : x(0), y(0), z(0) {} | |
int x; | |
int y; | |
int z; | |
MSGPACK_DEFINE(x, y, z); | |
}; | |
typedef struct normal { | |
normal() : x(0), y(0), z(0) {} | |
int x; | |
int y; | |
int z; | |
MSGPACK_DEFINE(x, y, z); | |
}; | |
typedef struct circle_3d { | |
circle_3d() : radius(0) {} | |
int radius; | |
MSGPACK_DEFINE(MSGPACK_DEFINE(center), MSGPACK_DEFINE(normal), radius); | |
}; | |
typedef struct PupilTopStruct { | |
PupilTopStruct() : confidence(0), timestamp(0) {} //Default Values | |
std::string topic; | |
double confidence; | |
int timestamp; | |
MSGPACK_DEFINE(topic, MSGPACK_DEFINE(circle_3d), confidence, timestamp); | |
}; | |
zmq::message_t info; | |
subSocket->recv(&info); | |
char* payload = static_cast<char*>(info.data()); | |
std::string rplInfo = std::string(payload, info.size()); | |
msgpack::object_handle result; | |
result = msgpack::unpack(payload, info.size()); | |
msgpack::object obj(result.get()); | |
printf(" \nINFO.Data : \n"); | |
msgpack::object_handle oh = msgpack::unpack(payload, info.size()); | |
msgpack::object deserialized = oh.get(); | |
std::cout << deserialized << std::endl; | |
//PupilStruct rvec; | |
PupilClass rvec; | |
deserialized.convert(rvec); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment