25 const std::string& filePath =
"algorithms/astarwithorientation.cfg")
32 std::ifstream file(fullFilePath);
35 throw std::runtime_error(
"Could not open config file: " + fullFilePath.string());
38 while (std::getline(file, line))
40 std::istringstream iss(line);
42 if (std::getline(iss, key,
'='))
45 if (std::getline(iss, value))
49 if (key ==
"maxObstacleDistance")
53 else if (key ==
"obstacleDistanceWeightFactor")
57 else if (key ==
"obstacleDistanceContinuousWeightFactor")
61 else if (key ==
"orientationWeightFactor")
65 else if (key ==
"forwardWeightFactor")
69 else if (key ==
"smoothnessWeightFactor")
74 catch (
const std::invalid_argument& e)
76 throw std::runtime_error(
"Invalid value for key " + key +
": " + value);