22 #include <SimoxUtility/json.h>
27 #include <Eigen/Geometry>
28 #include <mplib/core/types.h>
35 Eigen::VectorXf
getEigenVec(nlohmann::json& userConfig, nlohmann::json& defaultConfig,
const std::string& entryName,
int size = 0,
int value = 0);
38 void getEigenVec(nlohmann::json& userConfig, nlohmann::json& defaultConfig,
const std::string& entryName,
T& vec)
40 if (userConfig.find(entryName) != userConfig.end())
42 vec = userConfig[entryName];
46 vec = defaultConfig[entryName];
50 void getEigenMatrix(nlohmann::json& userConfig,
const std::string& entryName, Eigen::MatrixXf& mat);
52 Eigen::VectorXf
getEigenVecWithDefault(nlohmann::json& userConfig, Eigen::VectorXf defaultValue,
const std::string& entryName);
55 T getValue(nlohmann::json& userConfig, nlohmann::json& defaultConfig,
const std::string& entryName)
57 if (userConfig.find(entryName) != userConfig.end())
59 return userConfig[entryName].get<
T>();
63 return defaultConfig[entryName].get<
T>();
70 if (userConfig.find(entryName) != userConfig.end())
72 return userConfig[entryName].get<
T>();
93 void to_json(nlohmann::json& j,
const PoseBasePtr& fp);
95 void from_json(
const nlohmann::json& j, PoseBasePtr& fp);
109 std::string
dVecToString(
const mplib::core::DVec& dvec);
111 Eigen::VectorXf
vecToEigen(std::vector<float> &vec);