28 #include <boost/predef/other/endian.h> 31 #include <msgpack.hpp> 35 #if BOOST_ENDIAN_LITTLE_BYTE 36 #define ENDIANNESS_STR "<" 37 #elif BOOST_ENDIAN_BIG_BYTE 38 #define ENDIANNESS_STR ">" 40 #error Cannot determine endianness 56 return ENDIANNESS_STR
"f4";
60 return ENDIANNESS_STR
"f8";
68 return ENDIANNESS_STR
"i2";
72 return ENDIANNESS_STR
"i4";
76 return ENDIANNESS_STR
"i8";
84 return ENDIANNESS_STR
"u2";
88 return ENDIANNESS_STR
"u4";
92 return ENDIANNESS_STR
"u8";
118 static std::string
MsgId() {
return "array"; }
122 const std::vector<int64_t>&
shape) {
124 arr.
type = TypeStr<T>();
126 arr.
data.ptr = (
const char*)ptr;
128 for (int64_t n : shape) num *= n;
129 arr.
data.size =
sizeof(T) * num;
147 static std::string
MsgId() {
return "mesh_data"; }
191 static std::string
MsgId() {
return "set_mesh_data"; }
210 static std::string
MsgId() {
return "get_mesh_data"; }
226 static std::string
MsgId() {
return "camera_data"; }
234 std::array<double, 4>
R;
236 std::array<double, 3>
t;
252 R, t, intrinsic_model, intrinsic_parameters, width, height, images);
258 static std::string
MsgId() {
return "set_camera_data"; }
278 static std::string
MsgId() {
return "set_time"; }
288 static std::string
MsgId() {
return "set_active_camera"; }
297 static std::string
MsgId() {
return "set_properties"; }
322 static std::string
MsgId() {
return "status"; }
325 Status(
int code,
const std::string& str) : code(code), str(str) {}
328 return Status(1,
"unsupported msg_id");
331 return Status(2,
"error during unpacking");
std::string msg_id
Definition: Messages.h:308
std::string msg_id
Definition: Messages.h:315
std::string TypeStr< float >()
Definition: Messages.h:55
std::string TypeStr< uint8_t >()
Definition: Messages.h:79
std::string path
Definition: Messages.h:298
Definition: Messages.h:117
int32_t time
The time for which to return the data.
Definition: Messages.h:265
static std::string MsgId()
Definition: Messages.h:226
std::string path
Path defining the location in the scene tree.
Definition: Messages.h:196
std::string TypeStr()
Definition: Messages.h:51
Status(int code, const std::string &str)
Definition: Messages.h:325
CameraData data
The data to be set.
Definition: Messages.h:270
std::string TypeStr< int64_t >()
Definition: Messages.h:75
int32_t time
The time associated with this data.
Definition: Messages.h:198
struct for storing MeshData, e.g., PointClouds, TriangleMesh, ..
Definition: Messages.h:146
Definition: Messages.h:321
std::string TypeStr< int8_t >()
Definition: Messages.h:63
static std::string MsgId()
Definition: Messages.h:118
std::string path
Definition: Messages.h:289
static std::string MsgId()
Definition: Messages.h:147
Definition: Messages.h:190
struct for storing camera data
Definition: Messages.h:225
Definition: Messages.h:257
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t int32_t
Definition: K4aPlugin.cpp:395
Definition: Messages.h:296
msgpack::type::raw_ref data
Definition: Messages.h:134
Definition: Messages.h:307
std::string path
Path defining the location in the scene tree.
Definition: Messages.h:215
Definition: Messages.h:277
const T * Ptr()
Definition: Messages.h:137
std::string path
Path defining the location in the scene tree.
Definition: Messages.h:263
std::map< std::string, Array > textures
map of arrays that can be interpreted as textures
Definition: Messages.h:177
GetMeshData()
Definition: Messages.h:212
static Status OK()
Definition: Messages.h:326
MSGPACK_DEFINE_MAP(type, shape, data)
std::vector< int64_t > shape
Definition: Messages.h:133
Array vertices
shape must be [num_verts,3]
Definition: Messages.h:150
Status()
Definition: Messages.h:324
static Status ErrorUnsupportedMsgId()
Definition: Messages.h:327
static std::string MsgId()
Definition: Messages.h:191
int height
Definition: Messages.h:246
std::string TypeStr< uint16_t >()
Definition: Messages.h:83
std::map< std::string, Array > face_attributes
stores arbitrary attributes for each face
Definition: Messages.h:163
std::map< std::string, Array > line_attributes
stores arbitrary attributes for each line
Definition: Messages.h:174
std::string TypeStr< uint32_t >()
Definition: Messages.h:87
std::string layer
The layer for which to return the data.
Definition: Messages.h:267
std::string TypeStr< uint64_t >()
Definition: Messages.h:91
static std::string MsgId()
Definition: Messages.h:210
static std::string MsgId()
Definition: Messages.h:258
Array lines
Definition: Messages.h:172
std::vector< double > intrinsic_parameters
Definition: Messages.h:242
std::string TypeStr< int16_t >()
Definition: Messages.h:67
int32_t time
The time for which to return the data.
Definition: Messages.h:217
std::string intrinsic_model
Definition: Messages.h:241
static std::string MsgId()
Definition: Messages.h:297
static std::string MsgId()
Definition: Messages.h:288
std::string TypeStr< int32_t >()
Definition: Messages.h:71
static std::string MsgId()
Definition: Messages.h:278
SetTime()
Definition: Messages.h:279
std::string str
string representation of the code
Definition: Messages.h:337
CameraData()
Definition: Messages.h:228
std::map< std::string, Array > images
map of arrays that can be interpreted as camera images
Definition: Messages.h:249
SetMeshData()
Definition: Messages.h:193
int32_t time
Definition: Messages.h:280
Definition: Messages.h:287
Definition: PinholeCameraIntrinsic.cpp:35
std::string layer
The layer for this data.
Definition: Messages.h:200
int height
Definition: FilePCD.cpp:72
std::array< double, 3 > t
translation
Definition: Messages.h:236
struct for defining a "get_mesh_data" message, which requests mesh data.
Definition: Messages.h:209
std::string layer
The layer for which to return the data.
Definition: Messages.h:219
MeshData data
The data to be set.
Definition: Messages.h:203
SetCameraData()
Definition: Messages.h:260
static Array FromPtr(const T *const ptr, const std::vector< int64_t > &shape)
Definition: Messages.h:121
Definition: Messages.h:314
int width
image dimensions in pixels
Definition: Messages.h:245
Array faces
Definition: Messages.h:161
std::array< double, 4 > R
rotation R as quaternion [x,y,z,w]
Definition: Messages.h:234
static Status ErrorUnpackingFailed()
Definition: Messages.h:330
static std::string MsgId()
Definition: Messages.h:322
std::map< std::string, Array > vertex_attributes
Definition: Messages.h:153
int32_t code
return code. 0 means everything is OK.
Definition: Messages.h:335
int width
Definition: FilePCD.cpp:71
std::string type
Definition: Messages.h:132
std::string TypeStr< double >()
Definition: Messages.h:59