AStarPathPlanner.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 * @package RobotComponents::PathPlanner
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2015 Humanoids Group, H2T, KIT
19 * @license http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 #include "PathPlanner.h"
25 
26 namespace armarx
27 {
28  /**
29  * @defgroup Component-AStarPathPlanner AStarPathPlanner
30  * @brief The AStarPathPlanner provides path planning using the A* algorithm.
31  *
32  *
33  *
34  * With this component collision-free paths can be planned using the \ref armarx::PathPlanner interface.
35  * You can specify several parameters and the envrionment via convenient methods.
36  * The paths are encoded as sequence of 3D points consisting of X/Y positions (mm) and an orientation (rad) arounf the z axis.
37  * An exemplary path that has been planned with this component can be seen below.
38  *
39  * \image html PathPlanning_small.png "A collision-free path for Armar3."
40  *
41  *
42  *
43  *
44  * @ingroup RobotComponents-Components
45  */
46 
47  /**
48  * @ingroup Component-AStarPathPlanner
49  * @brief The AStarPathPlanner class
50  */
51  class AStarPathPlanner : virtual public PathPlanner, virtual public AStarPathPlannerBase
52  {
53  public:
55 
56  /**
57  * @see armarx::ManagedIceObject::getDefaultName()
58  */
59  std::string
60  getDefaultName() const override
61  {
62  return "AStarPathPlanner";
63  }
64 
65  //slice impl from PathPlannerBase
66  ::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr& from,
67  const ::armarx::Vector3BasePtr& to,
68  const ::Ice::Current& = Ice::emptyCurrent) const override;
69 
70  //slice impl from PathPlannerBase
72  const ::Ice::Current& = Ice::emptyCurrent) override;
73  void setRotationStepSize(::Ice::Float step,
74  const ::Ice::Current& = Ice::emptyCurrent) override;
75 
76  void setBoundingXRange(const ::armarx::FloatRange& range,
77  const ::Ice::Current& = Ice::emptyCurrent) override;
78 
79  void setBoundingYRange(const ::armarx::FloatRange& range,
80  const ::Ice::Current& = Ice::emptyCurrent) override;
81 
82  void setNeighbourSteps(const ::armarx::Vector3IBaseList& neighbours,
83  const ::Ice::Current& = Ice::emptyCurrent) override;
84 
86  const ::Ice::Current& = Ice::emptyCurrent) override;
87 
89  const ::Ice::Current& = Ice::emptyCurrent) override;
90 
91  /**
92  * @brief The heuristic used for A*.
93  * @param from From
94  * @param to To
95  * @return distanceFactorForHeuristic * distanceDelta + rotationFactorForHeuristic * rotationDelta
96  */
97  float heuristic(const armarx::Vector3& from, const armarx::Vector3& to) const;
98 
99  float heuristic(const armarx::Vector3IBase& from, const armarx::Vector3IBase& to) const;
100 
101  protected:
102  /**
103  * @brief The step size in degree.
104  */
106  };
107 
109 } // namespace armarx
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::AStarPathPlanner::setDistanceFactorForHeuristic
void setDistanceFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:127
armarx::AStarPathPlanner::stepSizeDeg
int stepSizeDeg
The step size in degree.
Definition: AStarPathPlanner.h:105
armarx::AStarPathPlanner::setRotationStepSize
void setRotationStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:73
armarx::AStarPathPlanner::getPath
::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr &from, const ::armarx::Vector3BasePtr &to, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: AStarPathPlanner.cpp:150
IceInternal::Handle
Definition: forward_declarations.h:8
PathPlanner.h
armarx::AStarPathPlanner::getDefaultName
std::string getDefaultName() const override
Definition: AStarPathPlanner.h:60
armarx::Vector3
The Vector3 class.
Definition: Pose.h:112
armarx::AStarPathPlanner::AStarPathPlanner
AStarPathPlanner()
Definition: AStarPathPlanner.cpp:34
armarx::AStarPathPlanner::setNeighbourSteps
void setNeighbourSteps(const ::armarx::Vector3IBaseList &neighbours, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:114
armarx::PathPlanner
The PathPlanner class.
Definition: PathPlanner.h:71
armarx::AStarPathPlanner::setRotationFactorForHeuristic
void setRotationFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:121
armarx::AStarPathPlanner
The AStarPathPlanner class.
Definition: AStarPathPlanner.h:51
armarx::AStarPathPlanner::heuristic
float heuristic(const armarx::Vector3 &from, const armarx::Vector3 &to) const
The heuristic used for A*.
Definition: AStarPathPlanner.cpp:133
armarx::AStarPathPlanner::setBoundingXRange
void setBoundingXRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:82
armarx::AStarPathPlanner::setTranslationtStepSize
void setTranslationtStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:59
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::AStarPathPlanner::setBoundingYRange
void setBoundingYRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:98