1 #ifndef __ROSEE_UTILS_YAML__ 2 #define __ROSEE_UTILS_YAML__ 4 #include <yaml-cpp/yaml.h> 8 namespace ROSEE {
namespace Utils {
22 std::vector<std::vector<float>> stdMat;
23 stdMat = matrixNode.as<std::vector<std::vector<float>>>();
25 Eigen::MatrixXd eigenMat(stdMat.size(), stdMat.at(0).size());
27 for (
int iRow = 0; iRow<stdMat.size(); iRow++) {
28 for (
int iCol = 0; iCol<stdMat.at(0).size(); iCol++) {
29 eigenMat(iRow, iCol) = stdMat.at(iRow).at(iCol);
41 std::vector<float> stdVect;
42 stdVect = vectorNode.as<std::vector<float>>();
44 Eigen::VectorXd eigenVec(stdVect.size());
46 for (
int i = 0; i<stdVect.size(); i++) {
47 eigenVec(i) = stdVect.at(i);
58 #endif // __ROSEE_UTILS_YAML__
static Eigen::MatrixXd yamlMatrixToEigen(const YAML::Node &matrixNode)
given a yaml node with a structure like
static Eigen::VectorXd yamlVectorToEigen(const YAML::Node &vectorNode)