AStar.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 
26 
27 #include "GlobalPlanner.h"
28 
30 {
31 
32  /**
33  * @brief Parameters for AStar
34  *
35  */
37  {
38  float linearVelocity{500};
39  float resampleDistance{200};
40 
41  Algorithms algorithm() const override;
42  aron::data::DictPtr toAron() const override;
43 
44  static AStarParams FromAron(const aron::data::DictPtr& dict);
45  };
46 
47  /**
48  * @class AStar
49  * @ingroup Library-GlobalPlanner
50  *
51  * Implements the A* algorithm
52  */
53  class AStar : public GlobalPlanner
54  {
55  public:
57 
58  AStar(const Params& params, const core::Scene& ctx);
59  ~AStar() override = default;
60 
61  std::optional<GlobalPlannerResult> plan(const core::Pose& goal) override;
62  std::optional<GlobalPlannerResult> plan(const core::Pose& start,
63  const core::Pose& goal) override;
64 
65  protected:
66  std::vector<Eigen::Vector2f> postProcessPath(const std::vector<Eigen::Vector2f>& path);
67 
68  private:
69  Params params;
70  };
71 
72 } // namespace armarx::navigation::global_planning
armarx::navigation::global_planning::AStar::~AStar
~AStar() override=default
armarx::navigation::global_planning::AStarParams
Parameters for AStar.
Definition: AStar.h:36
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition: basic_types.h:31
armarx::navigation::global_planning::GlobalPlannerParams
Parameters for GlobalPlanner.
Definition: GlobalPlanner.h:47
armarx::navigation::global_planning::AStar::postProcessPath
std::vector< Eigen::Vector2f > postProcessPath(const std::vector< Eigen::Vector2f > &path)
Definition: AStar.cpp:133
armarx::navigation::global_planning::AStarParams::toAron
aron::data::DictPtr toAron() const override
Definition: AStar.cpp:44
armarx::navigation::global_planning::AStarParams::resampleDistance
float resampleDistance
Definition: AStar.h:39
armarx::navigation::global_planning::AStar::AStar
AStar(const Params &params, const core::Scene &ctx)
Definition: AStar.cpp:72
armarx::navigation::global_planning::AStar::plan
std::optional< GlobalPlannerResult > plan(const core::Pose &goal) override
Definition: AStar.cpp:150
armarx::navigation::global_planning::AStarParams::FromAron
static AStarParams FromAron(const aron::data::DictPtr &dict)
Definition: AStar.cpp:55
GlobalPlanner.h
armarx::navigation::global_planning::AStar
Definition: AStar.h:53
armarx::navigation::global_planning::AStarParams::algorithm
Algorithms algorithm() const override
Definition: AStar.cpp:38
armarx::navigation::core::Scene
Definition: types.h:60
armarx::navigation::global_planning::GlobalPlanner
Definition: GlobalPlanner.h:63
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::navigation::global_planning::AStarParams::linearVelocity
float linearVelocity
Definition: AStar.h:38
armarx::navigation::global_planning::Algorithms
Algorithms
Definition: core.h:38
types.h
armarx::navigation::global_planning
This file is part of ArmarX.
Definition: fwd.h:29