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