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
55
56 private:
57 core::GlobalTrajectory trajectory;
58 const algorithms::Costmap& costmap;
59 const Params params;
60 };
61} // 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.
bool isGeometryValid
Whether the result is free of folds and degenerate segments.