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  */
52  virtual public PathPlanner,
53  virtual public AStarPathPlannerBase
54  {
55  public:
57 
58  /**
59  * @see armarx::ManagedIceObject::getDefaultName()
60  */
61  std::string getDefaultName() const override
62  {
63  return "AStarPathPlanner";
64  }
65  //slice impl from PathPlannerBase
66  ::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr& from, const ::armarx::Vector3BasePtr& to, const ::Ice::Current& = Ice::emptyCurrent) const override;
67 
68  //slice impl from PathPlannerBase
69  void setTranslationtStepSize(::Ice::Float step, const ::Ice::Current& = Ice::emptyCurrent) override;
70  void setRotationStepSize(::Ice::Float step, const ::Ice::Current& = Ice::emptyCurrent) override;
71 
72  void setBoundingXRange(const ::armarx::FloatRange& range, const ::Ice::Current& = Ice::emptyCurrent) override;
73 
74  void setBoundingYRange(const ::armarx::FloatRange& range, const ::Ice::Current& = Ice::emptyCurrent) override;
75 
76  void setNeighbourSteps(const ::armarx::Vector3IBaseList& neighbours, const ::Ice::Current& = Ice::emptyCurrent) override;
77 
78  void setRotationFactorForHeuristic(::Ice::Float factor, const ::Ice::Current& = Ice::emptyCurrent) override;
79 
80  void setDistanceFactorForHeuristic(::Ice::Float factor, const ::Ice::Current& = Ice::emptyCurrent) override;
81 
82  /**
83  * @brief The heuristic used for A*.
84  * @param from From
85  * @param to To
86  * @return distanceFactorForHeuristic * distanceDelta + rotationFactorForHeuristic * rotationDelta
87  */
88  float heuristic(const armarx::Vector3& from, const armarx::Vector3& to) const;
89 
90  float heuristic(const armarx::Vector3IBase& from, const armarx::Vector3IBase& to) const;
91 
92  protected:
93  /**
94  * @brief The step size in degree.
95  */
97  };
98 
100 }
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
armarx::AStarPathPlanner::setDistanceFactorForHeuristic
void setDistanceFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:120
armarx::AStarPathPlanner::stepSizeDeg
int stepSizeDeg
The step size in degree.
Definition: AStarPathPlanner.h:96
armarx::AStarPathPlanner::setRotationStepSize
void setRotationStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:75
armarx::AStarPathPlanner::getPath
::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr &from, const ::armarx::Vector3BasePtr &to, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: AStarPathPlanner.cpp:137
IceInternal::Handle
Definition: forward_declarations.h:8
PathPlanner.h
armarx::AStarPathPlanner::getDefaultName
std::string getDefaultName() const override
Definition: AStarPathPlanner.h:61
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:110
armarx::PathPlanner
The PathPlanner class.
Definition: PathPlanner.h:73
armarx::AStarPathPlanner::setRotationFactorForHeuristic
void setRotationFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:115
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:125
armarx::AStarPathPlanner::setBoundingXRange
void setBoundingXRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:84
armarx::AStarPathPlanner::setTranslationtStepSize
void setTranslationtStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:62
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::AStarPathPlanner::setBoundingYRange
void setBoundingYRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: AStarPathPlanner.cpp:97