28 #include <SimoxUtility/algorithm/get_map_keys_values.h>
36 #include <RobotAPI/interface/aron/Aron.h>
40 #include "../../json/Data.h"
53 std::vector<nlohmann::json>& elements,
56 elements =
input.get<std::vector<nlohmann::json>>();
61 std::map<std::string, nlohmann::json>& elements,
64 elements =
input.get<std::map<std::string, nlohmann::json>>();
69 {
"unsigned char", ::armarx::aron::type::matrix::UINT8},
70 {
"unsigned short", ::armarx::aron::type::matrix::UINT16},
71 {
"unsigned int", ::armarx::aron::type::matrix::UINT32},
72 {
"char", ::armarx::aron::type::matrix::INT8},
73 {
"short", ::armarx::aron::type::matrix::INT16},
74 {
"int", ::armarx::aron::type::matrix::INT32},
75 {
"long", ::armarx::aron::type::matrix::INT64},
76 {
"float", ::armarx::aron::type::matrix::FLOAT32},
77 {
"double", ::armarx::aron::type::matrix::FLOAT64}};
83 const std::vector<T> d =
input.at(
"data").get<std::vector<T>>();
85 const std::size_t bufferLen = d.size() *
sizeof(
T);
87 data.resize(bufferLen);
88 memcpy(
data.data(), d.data(), bufferLen);
93 std::vector<int>& shape,
94 std::string& typeAsString,
95 std::vector<unsigned char>&
data,
98 shape =
input.at(
"dims").get<std::vector<int>>();
100 typeAsString =
input.at(
"type").get<std::string>();
103 <<
"Invalid element `" << typeAsString <<
"`. Valid elements are "
112 case type::matrix::UINT8:
115 case type::matrix::UINT16:
118 case type::matrix::UINT32:
121 case type::matrix::INT8:
124 case type::matrix::INT16:
127 case type::matrix::INT32:
130 case type::matrix::INT64:
133 case type::matrix::FLOAT32:
136 case type::matrix::FLOAT64: