34 std::ifstream file(fullFilePath);
37 throw std::runtime_error(
"Could not open config file: " + fullFilePath.string());
41 while (std::getline(file, line))
43 auto commentPos = line.find(
'#');
44 if (commentPos != std::string::npos)
45 line = line.substr(0, commentPos);
50 if (!std::isspace(
static_cast<unsigned char>(
c)))
59 std::istringstream iss(line);
61 if (!std::getline(iss, key,
'='))
65 size_t end = key.find_last_not_of(
" \t\r\n");
66 if (end != std::string::npos)
67 key = key.substr(0, end + 1);
75 if (!std::getline(iss, value))
79 size_t start = value.find_first_not_of(
" \t\r\n");
80 if (start != std::string::npos)
82 size_t end = value.find_last_not_of(
" \t\r\n");
83 value = value.substr(start, end - start + 1);
93 if (key ==
"clearance")
95 else if (key ==
"minClearance")
97 else if (key ==
"obsMaxDistance")
99 else if (key ==
"allowDegradedInput")
101 else if (key ==
"useTrackingClearanceAdaptive")
103 else if (key ==
"trackingFadeStartClearance")
105 else if (key ==
"trackingFadeEndClearance")
107 else if (key ==
"useObstacleFreeze")
109 else if (key ==
"obstacleFreezeThreshold")
111 else if (key ==
"segmentObstacleSamples")
113 else if (key ==
"segmentSampleSpacing")
115 else if (key ==
"maxSegmentObstacleSamples")
117 else if (key ==
"pass1WeightObstacle")
119 else if (key ==
"pass1WeightPoseSmooth")
121 else if (key ==
"pass1WeightSpacing")
123 else if (key ==
"pass1WeightTracking")
125 else if (key ==
"pass1WeightSafeTracking")
127 else if (key ==
"pass2WeightObstacle")
129 else if (key ==
"pass2WeightPoseSmooth")
131 else if (key ==
"pass2WeightSpacing")
133 else if (key ==
"pass2WeightTracking")
135 else if (key ==
"pass2WeightSafeTracking")
137 else if (key ==
"pass3WeightObstacle")
139 else if (key ==
"pass3WeightPoseSmooth")
141 else if (key ==
"pass3WeightSpacing")
143 else if (key ==
"pass3WeightTracking")
145 else if (key ==
"pass3WeightSafeTracking")
147 else if (key ==
"repairWeightObstacle")
149 else if (key ==
"repairWeightPoseSmooth")
151 else if (key ==
"repairWeightSpacing")
153 else if (key ==
"repairWeightTracking")
155 else if (key ==
"repairWeightSafeTracking")
157 else if (key ==
"repairMaxIterations")
159 else if (key ==
"trackingDeadzone")
161 else if (key ==
"trackingMaxDeviation")
163 else if (key ==
"weightTrackingInBounds")
165 else if (key ==
"weightTrackingHard")
167 else if (key ==
"maxIterations")
169 else if (key ==
"numThreads")
171 else if (key ==
"initialTrustRegionRadius")
173 else if (key ==
"maxTrustRegionRadius")
175 else if (key ==
"minTrustRegionRadius")
178 catch (
const std::invalid_argument&)
180 throw std::runtime_error(
"Invalid value for key " + key +
": " + value);
static std::filesystem::path toSystemPath(const data::PackagePath &pp)
This file is part of ArmarX.
SmoothingParams loadSmoothingParams(const std::string &filePath)
double pass2_w_safe_tracking
double repair_w_pose_smooth
double min_clearance
Distance to obstacles [mm] below which a path is actually refused.
double tracking_fade_end_clearance
Clearance [mm] beyond which tracking is off entirely.
double pass3_w_safe_tracking
bool use_obstacle_freeze
Hold interior waypoints below obstacle_freeze_threshold fixed during the solve.
double clearance
Distance to obstacles [mm] the optimizer aims for.
double repair_w_safe_tracking
double max_trust_region_radius
double tracking_fade_start_clearance
Clearance [mm] at which the leash starts to relax.
bool use_tracking_clearance_adaptive
Scale the tracking weight by the clearance at each waypoint's reference position.
double segment_sample_spacing
Spacing [mm] of the obstacle samples along a segment.
double w_tracking_in_bounds
bool allow_degraded_input
Judge a path against what it was given, when the input is already inside the limit.
double obstacle_freeze_threshold
Clearance [mm] at or below which an interior waypoint is pinned.
double initial_trust_region_radius
double pass1_w_pose_smooth
double min_trust_region_radius
double pass2_w_pose_smooth
int max_segment_obstacle_samples
Upper bound, so a long segment cannot make the problem huge.
int repair_max_iterations
double pass1_w_safe_tracking
double pass3_w_pose_smooth
double tracking_max_deviation
int segment_obstacle_samples
Lower bound on the samples per segment, so a short segment is still evaluated.