9 #include "../aron_conversions/eigen.h"
16 template <
class ReaderT,
class EigenT,
int rows,
int cols,
int options>
21 typename ReaderT::InputType&
input,
24 std::string typeAsString;
25 std::vector<int> shape;
26 std::vector<unsigned char>
data;
27 aron_r.readNDArray(
input, shape, typeAsString,
data);
30 ret.rows() == shape.at(0) and
ret.cols() == shape.at(1),
32 __PRETTY_FUNCTION__,
"Received wrong dimensions for member 'pose'."));
36 "Received wrong typename",
39 std::memcpy(
reinterpret_cast<unsigned char*
>(
ret.data()),
data.data(),
data.size());
42 template <
class ReaderT,
class EigenT,
int cols,
int options>
47 typename ReaderT::InputType&
input,
50 std::string typeAsString;
51 std::vector<int> shape;
52 std::vector<unsigned char>
data;
53 aron_r.readNDArray(
input, shape, typeAsString,
data);
55 ret.resize(shape.at(0));
58 ret.rows() == shape.at(0) and
ret.cols() == shape.at(1),
60 __PRETTY_FUNCTION__,
"Received wrong dimensions for member 'pose'."));
64 "Received wrong typename",
67 std::memcpy(
reinterpret_cast<unsigned char*
>(
ret.data()),
data.data(),
data.size());
70 template <
class ReaderT,
class EigenT,
int rows,
int options>
75 typename ReaderT::InputType&
input,
78 std::string typeAsString;
79 std::vector<int> shape;
80 std::vector<unsigned char>
data;
81 aron_r.readNDArray(
input, shape, typeAsString,
data);
83 ret.resize(shape.at(1));
86 ret.rows() == shape.at(0) and
ret.cols() == shape.at(1),
88 __PRETTY_FUNCTION__,
"Received wrong dimensions for member 'pose'."));
92 "Received wrong typename",
95 std::memcpy(
reinterpret_cast<unsigned char*
>(
ret.data()),
data.data(),
data.size());
98 template <
class ReaderT,
class EigenT,
int options>
103 typename ReaderT::InputType&
input,
106 std::string typeAsString;
107 std::vector<int> shape;
108 std::vector<unsigned char>
data;
109 aron_r.readNDArray(
input, shape, typeAsString,
data);
111 ret.resize(shape.at(0), shape.at(1));
114 ret.rows() == shape.at(0) and
ret.cols() == shape.at(1),
116 __PRETTY_FUNCTION__,
"Received wrong dimensions for member 'pose'."));
120 "Received wrong typename",
123 std::memcpy(
reinterpret_cast<unsigned char*
>(
ret.data()),
data.data(),
data.size());
126 template <
class WriterT,
class EigenT,
int rows,
int cols,
int options>
132 typename WriterT::ReturnType&
ret,
135 ret = aron_w.writeNDArray(
136 {
static_cast<int>(
input.rows()),
static_cast<int>(
input.cols()),
sizeof(EigenT)},
138 reinterpret_cast<const unsigned char*
>(
input.data()),
142 template <
class ReaderT,
class EigenT>
146 read(ReaderT& aron_r,
typename ReaderT::InputType&
input, Eigen::Quaternion<EigenT>&
ret)
148 std::string typeAsString;
149 std::vector<int> shape;
150 std::vector<unsigned char>
data;
151 aron_r.readNDArray(
input, shape, typeAsString,
data);
153 reinterpret_cast<unsigned char*
>(
ret.coeffs().data()),
data.data(),
data.size());
156 template <
class WriterT,
class EigenT>
161 const Eigen::Quaternion<EigenT>&
input,
162 typename WriterT::ReturnType&
ret,
165 ret = aron_w.writeNDArray({1, 4,
sizeof(EigenT)},
167 reinterpret_cast<const unsigned char*
>(
input.coeffs().data()),