9 const std::string param_name,
12 std::vector<double> vals;
15 if (n.
hasParam((param_name + std::string(
"/data").c_str())))
17 n.
getParam((param_name + std::string(
"/data")).c_str(), vals);
23 << param_name <<
" has no data values (" << param_name
24 <<
"/data)! Shutting down...");
31 <<
" does not exist");
39 const std::vector<double> &vals)
41 double size_f, frac_part, discard;
44 size_f = std::sqrt(vals.size());
45 frac_part = std::modf(size_f, &discard);
50 std::stringstream errMsg;
51 errMsg <<
"MatrixParser: Tried to initialize a square matrix with a " 53 << vals.size() <<
") number of values";
54 throw std::logic_error(errMsg.str().c_str());
57 ROS_DEBUG(
"MatrixParser: filling matrix");
59 M = Eigen::MatrixXd(size, size);
61 for (
int i = 0; i < size; i++)
63 for (
int j = 0; j < size; j++)
65 M(i, j) = vals[i * size + j];
74 S << 0, -v(2), v(1), v(2), 0, -v(0), -v(1), v(0), 0;
bool getParam(const std::string &key, std::string &s) const
bool hasParam(const std::string &key) const
#define ROS_ERROR_STREAM(args)