27 #include <SimoxUtility/algorithm/get_map_keys_values.h>
32 #include <RobotAPI/interface/aron/Aron.h>
46 std::vector<nlohmann::json>& elements,
49 elements =
input.get<std::vector<nlohmann::json>>();
54 std::map<std::string, nlohmann::json>& elements,
57 elements =
input.get<std::map<std::string, nlohmann::json>>();
61 {
"unsigned char", ::armarx::aron::type::matrix::UINT8},
62 {
"unsigned short", ::armarx::aron::type::matrix::UINT16},
63 {
"unsigned int", ::armarx::aron::type::matrix::UINT32},
64 {
"char", ::armarx::aron::type::matrix::INT8},
65 {
"short", ::armarx::aron::type::matrix::INT16},
66 {
"int", ::armarx::aron::type::matrix::INT32},
67 {
"long", ::armarx::aron::type::matrix::INT64},
68 {
"float", ::armarx::aron::type::matrix::FLOAT32},
69 {
"double", ::armarx::aron::type::matrix::FLOAT64}};
75 const std::vector<T> d =
input.at(
"data").get<std::vector<T>>();
77 const std::size_t bufferLen = d.size() *
sizeof(
T);
79 data.resize(bufferLen);
80 memcpy(
data.data(), d.data(), bufferLen);
85 std::vector<int>& shape,
86 std::string& typeAsString,
87 std::vector<unsigned char>&
data,
90 shape =
input.at(
"dims").get<std::vector<int>>();
92 typeAsString =
input.at(
"type").get<std::string>();
95 <<
"Invalid element `" << typeAsString <<
"`. Valid elements are "
104 case type::matrix::UINT8:
107 case type::matrix::UINT16:
110 case type::matrix::UINT32:
113 case type::matrix::INT8:
116 case type::matrix::INT16:
119 case type::matrix::INT32:
122 case type::matrix::INT64:
125 case type::matrix::FLOAT32:
128 case type::matrix::FLOAT64: