7 #include <Eigen/Geometry>
9 #include <VirtualRobot/RobotNodeSet.h>
10 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
26 #include <armarx/navigation/global_planning/aron/AStarParams.aron.generated.h>
46 arondto::AStarParams dto;
61 arondto::AStarParams dto;
132 std::vector<Eigen::Vector2f>
139 const auto p = approx.approximatedChain();
149 std::optional<GlobalPlannerResult>
153 return plan(start, goal);
156 std::optional<GlobalPlannerResult>
164 const Eigen::Vector2f goalPos =
conv::to2D(goal.translation());
166 const auto timeStart = IceUtil::Time::now();
168 std::vector<Eigen::Vector2f>
plan;
175 ARMARX_INFO <<
"Could not plan collision-free path from"
176 <<
"(" << start.translation().x() <<
"," << start.translation().y() <<
")"
178 <<
"(" << goal.translation().x() <<
"," << goal.translation().y() <<
")"
183 const auto timeEnd = IceUtil::Time::now();
185 ARMARX_IMPORTANT <<
"A* planning took " << (timeEnd - timeStart).toMilliSeconds() <<
" ms";
190 ARMARX_INFO <<
"Could not plan collision-free path from"
191 <<
"(" << start.translation().x() <<
"," << start.translation().y() <<
")"
193 <<
"(" << goal.translation().x() <<
"," << goal.translation().y() <<
")";
197 ARMARX_DEBUG <<
"The plan consists of the following positions:";
198 for (
const auto& position :
plan)
217 std::vector<core::Position> wpts;
218 for (
size_t i = 1; i < (plan3d.size() - 1); i++)
220 wpts.push_back(plan3d.at(i));
230 ARMARX_IMPORTANT <<
"Smooth path contains " << smoothPlan.size() <<
" points";
234 smoothPlan.erase(smoothPlan.begin());
235 smoothPlan.pop_back();
244 std::optional<core::GlobalTrajectory> resampledTrajectory;
248 resampledTrajectory = trajectory;
258 ARMARX_INFO <<
"Caught exception during resampling: "
261 resampledTrajectory = trajectory;
265 ARMARX_VERBOSE <<
"Resampled trajectory contains " << resampledTrajectory->points().size()
273 if (resampledTrajectory->points().size() == 2)
275 ARMARX_INFO <<
"Only start and goal provided. Not optimizing orientation";
282 const auto result = optimizer.
optimize();