23 std::ifstream myfileN(
"resources/data/egm96_to360.ascii");
24 std::ifstream myfile(
"resources/data/egm96_to360.ascii");
29 uint32_t nmbrOfLines =
static_cast<uint32_t
>(std::count(std::istreambuf_iterator<char>(myfileN), std::istreambuf_iterator<char>(),
'\n'));
31 LOG_DATA(
"Number of lines in 'egm96_to360.ascii':_{}", nmbrOfLines);
35 Eigen::MatrixXd coeffs(nmbrOfLines, 6);
39 while (getline(myfile, line))
41 while ((pos = line.find(delimiter)) != std::string::npos)
43 if (line.substr(0, 1) ==
" ")
49 token = line.substr(0, pos);
50 coeffs(i, j) = std::strtod(token.c_str(),
nullptr);
52 line.erase(0, pos + 1);
60 coeffs(i, 5) = std::strtod(line.c_str(),
nullptr);
62 if (
static_cast<uint32_t
>(i + 1) < nmbrOfLines)
70 LOG_CRITICAL(
"Unable to open file 'egm96_to360.ascii' --> gravity vector compensation not trustworthy");
71 coeffs = Eigen::MatrixXd::Zero(1, 6);