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
26namespace 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
71 void setTranslationtStepSize(::Ice::Float step,
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
85 void setRotationFactorForHeuristic(::Ice::Float factor,
86 const ::Ice::Current& = Ice::emptyCurrent) override;
87
88 void setDistanceFactorForHeuristic(::Ice::Float factor,
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
void setNeighbourSteps(const ::armarx::Vector3IBaseList &neighbours, const ::Ice::Current &=Ice::emptyCurrent) override
float heuristic(const armarx::Vector3 &from, const armarx::Vector3 &to) const
The heuristic used for A*.
void setBoundingYRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
void setRotationFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
void setDistanceFactorForHeuristic(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
void setBoundingXRange(const ::armarx::FloatRange &range, const ::Ice::Current &=Ice::emptyCurrent) override
void setTranslationtStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
void setRotationStepSize(::Ice::Float step, const ::Ice::Current &=Ice::emptyCurrent) override
int stepSizeDeg
The step size in degree.
std::string getDefaultName() const override
::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr &from, const ::armarx::Vector3BasePtr &to, const ::Ice::Current &=Ice::emptyCurrent) const override
The Vector3 class.
Definition Pose.h:113
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::Handle<::armarx::AStarPathPlanner > AStarPathPlannerPtr