GlobalPlanner.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 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @author Christian R. G. Dreher ( c dot dreher at kit dot edu )
18 * @date 2021
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <map>
26#include <memory>
27#include <optional>
28#include <string>
29
32
38
40{
41
43 {
45
46 /**
47 * Optional helper trajectory that can be used for visualization or debugging purposes.
48 * It is not meant to be executed by the robot.
49 * This can be helpful when using some indermediate trajectory representations for the planning that should also be visualized.
50 */
51 std::optional<core::GlobalTrajectory> helperTrajectory;
52
53 /**
54 * Wall-clock duration [s] of each stage of the planning pipeline, keyed by stage name.
55 * Empty for planners that are not instrumented.
56 */
57 std::map<std::string, float> timings{};
58
59 /**
60 * The raw path as it came out of the grid search, before resampling, smoothing and
61 * orientation optimization. Cell centres, so it is a staircase. For visualization and
62 * debugging only; empty for planners that do not search a grid.
63 */
65
66 /**
67 * Whether the position smoothing stage ran *and* its result was adopted. False when the
68 * stage was disabled, or when it produced a trajectory that still had collisions and the
69 * unsmoothed path was kept instead — which is not otherwise visible in the result.
70 */
72 };
73
74 /**
75 * @brief Parameters for GlobalPlanner
76 *
77 */
79 {
80 bool foo;
81
82 virtual ~GlobalPlannerParams() = default;
83
84 virtual Algorithms algorithm() const = 0;
85 virtual aron::data::DictPtr toAron() const = 0;
86 };
87
88 /**
89 * @class GlobalPlanner
90 * @ingroup Library-GlobalPlanner
91 *
92 * Base class of all global planners
93 */
95 {
96 public:
98 virtual ~GlobalPlanner() = default;
99
100 virtual std::optional<GlobalPlannerResult> plan(const core::Pose& goal) = 0;
101 virtual std::optional<GlobalPlannerResult> plan(const core::Pose& start,
102 const core::Pose& goal) = 0;
103
104 virtual void
106 const std::string& vizLayerNamePrefix = "global_planner_debug") {
107 // Default: Do nothing
108 };
109
110 protected:
113
114 private:
115 };
116
117 using GlobalPlannerPtr = std::shared_ptr<GlobalPlanner>;
118} // namespace armarx::navigation::global_planning
GlobalPlanner(const core::GeneralConfig &generalConfig, const core::Scene &scene)
virtual std::optional< GlobalPlannerResult > plan(const core::Pose &goal)=0
virtual void visualizeDebugInfo(viz::Client &vizClient, const std::string &vizLayerNamePrefix="global_planner_debug")
virtual std::optional< GlobalPlannerResult > plan(const core::Pose &start, const core::Pose &goal)=0
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
std::vector< Position > Positions
Definition basic_types.h:37
Eigen::Isometry3f Pose
Definition basic_types.h:31
This file is part of ArmarX.
Definition fwd.h:30
std::shared_ptr< GlobalPlanner > GlobalPlannerPtr
Definition fwd.h:32
virtual aron::data::DictPtr toAron() const =0
bool positionSmoothingApplied
Whether the position smoothing stage ran and its result was adopted.
std::map< std::string, float > timings
Wall-clock duration [s] of each stage of the planning pipeline, keyed by stage name.
core::Positions gridPath
The raw path as it came out of the grid search, before resampling, smoothing and orientation optimiza...
std::optional< core::GlobalTrajectory > helperTrajectory
Optional helper trajectory that can be used for visualization or debugging purposes.