141 const Eigen::Vector2f goalPos =
conv::to2D(goal.translation());
143 const auto timeStart = IceUtil::Time::now();
145 std::vector<Eigen::Vector2f>
plan;
152 ARMARX_INFO <<
"Could not plan collision-free path from" <<
"("
153 << start.translation().x() <<
"," << start.translation().y() <<
")"
154 <<
" to " <<
"(" << goal.translation().x() <<
"," << goal.translation().y()
159 const auto timeEnd = IceUtil::Time::now();
161 ARMARX_IMPORTANT <<
"A* planning took " << (timeEnd - timeStart).toMilliSeconds() <<
" ms";
166 ARMARX_INFO <<
"Could not plan collision-free path from" <<
"("
167 << start.translation().x() <<
"," << start.translation().y() <<
")"
168 <<
" to " <<
"(" << goal.translation().x() <<
"," << goal.translation().y()
173 ARMARX_DEBUG <<
"The plan consists of the following positions:";
174 for (
const auto& position :
plan)
184 std::vector<core::Position> wpts;
185 for (
size_t i = 1; i < (plan3d.size() - 1); i++)
187 wpts.push_back(plan3d.at(i));
192 ARMARX_IMPORTANT <<
"Smooth path contains " << smoothPlan.size() <<
" points";
196 smoothPlan.erase(smoothPlan.begin());
197 smoothPlan.pop_back();
201 start,
conv::to3D(smoothPlan), goal, generalConfig_.maxVel.linear);
206 std::optional<core::GlobalTrajectory> resampledTrajectory;
208 if (params.resampleDistance < 0)
216 resampledTrajectory =
trajectory.resample(params.resampleDistance);
220 ARMARX_INFO <<
"Caught exception during resampling: "
227 ARMARX_VERBOSE <<
"Resampled trajectory contains " << resampledTrajectory->points().size()
230 resampledTrajectory->setMaxVelocity(generalConfig_.maxVel.linear);
232 if (resampledTrajectory->points().size() == 2)
234 ARMARX_INFO <<
"Only start and goal provided. Not optimizing orientation";
237 .helperTrajectory = std::nullopt};
242 const auto result = optimizer.
optimize();
259 .helperTrajectory = std::nullopt};