SPFASmoothing.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include <cstddef>
20#include <optional>
21#include <vector>
22
26
28{
30 {
31 public:
33
34 SPFASmoothing(const core::GlobalTrajectory& trajectory,
35 const algorithms::Costmap& costmap,
36 const Params& params);
37
39 {
40 std::optional<core::GlobalTrajectory> trajectory;
41 std::optional<core::GlobalTrajectory> preprocessedTrajectory;
42 bool isCollisionFree = false;
43
44 /// Whether the result is free of folds and degenerate segments. A path can be
45 /// perfectly collision-free and still double back on itself, which the cost function
46 /// cannot see and which stalls the downstream reparametrization.
47 bool isGeometryValid = true;
48
49 /// Waypoints removed to repair a fold, in terms of the trajectory handed in. Empty
50 /// when nothing needed repairing.
51 std::vector<std::size_t> repairedWaypoints;
52
53 /// Smallest clearance [mm] on the trajectory handed in.
54 float inputMinClearance = 0.F;
55
56 /// Smallest clearance [mm] on the trajectory handed back.
57 float outputMinClearance = 0.F;
58
59 /// The input was already inside the limit, so it was judged against itself.
60 bool judgedAgainstInput = false;
61 };
62
64
65 private:
66 core::GlobalTrajectory trajectory;
67 const algorithms::Costmap& costmap;
68 const Params params;
69 };
70} // namespace armarx::navigation::algorithms::spfa::smoothing
SPFASmoothing(const core::GlobalTrajectory &trajectory, const algorithms::Costmap &costmap, const Params &params)
std::vector< std::size_t > repairedWaypoints
Waypoints removed to repair a fold, in terms of the trajectory handed in.
float outputMinClearance
Smallest clearance [mm] on the trajectory handed back.
bool isGeometryValid
Whether the result is free of folds and degenerate segments.
bool judgedAgainstInput
The input was already inside the limit, so it was judged against itself.
float inputMinClearance
Smallest clearance [mm] on the trajectory handed in.