44 std::ifstream file(fullFilePath);
47 throw std::runtime_error(
"Could not open config file: " + fullFilePath.string());
50 while (std::getline(file, line))
52 std::istringstream iss(line);
54 if (std::getline(iss, key,
'='))
57 if (std::getline(iss, value))
62 if (key ==
"weightBoundary")
66 else if (key ==
"weightPoseSmooth")
70 else if (key ==
"weightPoseSmoothOrientation")
74 else if (key ==
"weightVelocitySmooth")
78 else if (key ==
"weightPoseJerk")
82 else if (key ==
"weightRobotSmooth")
86 else if (key ==
"weightObstacle")
88 params.
w_obs = std::stof(value);
90 else if (key ==
"weightTracking")
92 params.
w_track = std::stof(value);
94 else if (key ==
"weightVelocityLimit")
98 else if (key ==
"weightSpacing")
102 else if (key ==
"clearance")
106 else if (key ==
"obsCollisionResidual")
110 else if (key ==
"obsMaxDistance")
114 else if (key ==
"vmax")
116 params.
vmax = std::stof(value);
118 else if (key ==
"useTracking")
122 else if (key ==
"useRobotSmooth")
126 else if (key ==
"useJerk")
128 params.
use_jerk = (value ==
"true");
130 else if (key ==
"useObstacle")
132 params.
use_obs = (value ==
"true");
134 else if (key ==
"maxIterations")
138 else if (key ==
"numThreads")
143 catch (
const std::invalid_argument& e)
145 throw std::runtime_error(
"Invalid value for key " + key +
": " + value);