PathPlanner.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 
25 #include <VirtualRobot/Robot.h>
26 #include <VirtualRobot/SceneObject.h>
27 
29 
31 
32 #include <RobotComponents/interface/components/PathPlanner.h>
33 
35 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
36 
37 //include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
38 
39 namespace armarx
40 {
41  /**
42  * @brief Holds properties for PathPlanner.
43  * @see PathPlanner
44  */
46  {
47  public:
49  {
50  defineOptionalProperty<std::string>(
51  "WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory component");
52  // defineOptionalProperty<std::string>("DebugDrawerName", "DebugDrawerUpdates", "Name of the DebugDrawer component");
53  }
54  };
55 
56  /**
57  * @defgroup Component-PathPlanner PathPlanner
58  * @ingroup RobotComponents-Components
59  * @brief Abstract base class for path planners.
60  * This class offers basic methods for planning paths in the plane.
61  * A path consists of a sequence of 3D vectors containing position (mm) and orientation around the z axis (rad).
62  * In addition object and agent management is implemented here.
63  *
64  * A reference implementation of the A* path planner can be found here: \ref armarx::AStarPathPlanner
65  */
66 
67  /**
68  * @ingroup Component-PathPlanner
69  * @brief The PathPlanner class
70  */
71  class PathPlanner : virtual public Component, virtual public PathPlannerBase
72  {
73  public:
74  PathPlanner();
75 
76  /**
77  * @see PropertyUser::createPropertyDefinitions()
78  */
81  {
84  }
85 
86  /**
87  * @see armarx::ManagedIceObject::onInitComponent()
88  */
89  void onInitComponent() override;
90 
91  /**
92  * @see armarx::ManagedIceObject::onConnectComponent()
93  */
94  void onConnectComponent() override;
95 
96  //from slice interface PathPlannerBase
97  void setCollisionObjects(const ::armarx::ObjectPositionBaseList& list,
98  const ::Ice::Current& = Ice::emptyCurrent) override;
99  void addCollisionObjects(const ::armarx::ObjectPositionBaseList& list,
100  const ::Ice::Current& = Ice::emptyCurrent) override;
101  void clearCollisionObjects(const ::Ice::Current& = Ice::emptyCurrent) override;
102  void setAgent(const ::memoryx::AgentInstanceBasePtr& newAgent,
103  const std::string& agentColModelName,
104  const ::Ice::Current& = Ice::emptyCurrent) override;
105  void setSafetyMargin(::Ice::Float margin,
106  const ::Ice::Current& = Ice::emptyCurrent) override;
107 
108 
109  ::armarx::Vector3BaseList
110  getPath(const ::armarx::Vector3BasePtr&,
111  const ::armarx::Vector3BasePtr&,
112  const ::Ice::Current& = Ice::emptyCurrent) const override = 0;
113 
114  bool isPositionValid(armarx::Vector3 position) const;
115 
116  protected:
118  VirtualRobot::CollisionModelPtr agentCollisionModel;
119  float agentZCoord;
120 
122 
123  memoryx::WorkingMemoryInterfacePrx workingMemoryPrx;
124  memoryx::CommonStorageInterfacePrx commonStoragePrx;
126 
128  {
129  memoryx::ObjectClassBasePtr object;
130  VirtualRobot::CollisionModelPtr colModel;
131  };
132 
133  std::vector<CollisionObjectData> objects;
134 
135  // armarx::DebugDrawerInterfacePrx debugDrawer;
136  };
137 
139 
140 } // namespace armarx
armarx::PathPlanner::agent
VirtualRobot::RobotPtr agent
Definition: PathPlanner.h:117
armarx::PathPlanner::isPositionValid
bool isPositionValid(armarx::Vector3 position) const
Definition: PathPlanner.cpp:209
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::PathPlanner::onConnectComponent
void onConnectComponent() override
Definition: PathPlanner.cpp:48
armarx::PathPlanner::fileManager
memoryx::GridFileManagerPtr fileManager
Definition: PathPlanner.h:125
armarx::PathPlanner::clearCollisionObjects
void clearCollisionObjects(const ::Ice::Current &=Ice::emptyCurrent) override
Definition: PathPlanner.cpp:135
armarx::PathPlanner::CollisionObjectData::colModel
VirtualRobot::CollisionModelPtr colModel
Definition: PathPlanner.h:130
list
list(APPEND SOURCES ${QT_RESOURCES}) set(COMPONENT_LIBS ArmarXGui ArmarXCoreObservers ArmarXCoreEigen3Variants PlotterController $
Definition: CMakeLists.txt:49
Pose.h
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::PathPlanner::onInitComponent
void onInitComponent() override
Definition: PathPlanner.cpp:41
armarx::PathPlanner::safetyMargin
float safetyMargin
Definition: PathPlanner.h:121
armarx::PathPlanner::commonStoragePrx
memoryx::CommonStorageInterfacePrx commonStoragePrx
Definition: PathPlanner.h:124
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::PathPlanner::agentZCoord
float agentZCoord
Definition: PathPlanner.h:119
armarx::PathPlanner::setSafetyMargin
void setSafetyMargin(::Ice::Float margin, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: PathPlanner.cpp:195
armarx::PathPlannerPropertyDefinitions
Holds properties for PathPlanner.
Definition: PathPlanner.h:45
armarx::PathPlanner::CollisionObjectData::object
memoryx::ObjectClassBasePtr object
Definition: PathPlanner.h:129
armarx::Vector3
The Vector3 class.
Definition: Pose.h:112
AbstractEntityWrapper.h
armarx::PathPlanner::PathPlanner
PathPlanner()
Definition: PathPlanner.cpp:36
armarx::PathPlannerPropertyDefinitions::PathPlannerPropertyDefinitions
PathPlannerPropertyDefinitions(std::string prefix)
Definition: PathPlanner.h:48
armarx::PathPlanner::objects
std::vector< CollisionObjectData > objects
Definition: PathPlanner.h:133
armarx::PathPlanner::setCollisionObjects
void setCollisionObjects(const ::armarx::ObjectPositionBaseList &list, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: PathPlanner.cpp:59
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
armarx::PathPlanner::getPath
::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr &, const ::armarx::Vector3BasePtr &, const ::Ice::Current &=Ice::emptyCurrent) const override=0
armarx::PathPlanner::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PathPlanner.h:80
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
armarx::PathPlanner
The PathPlanner class.
Definition: PathPlanner.h:71
memoryx::GridFileManagerPtr
std::shared_ptr< GridFileManager > GridFileManagerPtr
Definition: AbstractEntityWrapper.h:33
armarx::PathPlanner::CollisionObjectData
Definition: PathPlanner.h:127
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::PathPlanner::addCollisionObjects
void addCollisionObjects(const ::armarx::ObjectPositionBaseList &list, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: PathPlanner.cpp:67
armarx::PathPlanner::setAgent
void setAgent(const ::memoryx::AgentInstanceBasePtr &newAgent, const std::string &agentColModelName, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: PathPlanner.cpp:142
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::PathPlanner::workingMemoryPrx
memoryx::WorkingMemoryInterfacePrx workingMemoryPrx
Definition: PathPlanner.h:123
armarx::PathPlanner::agentCollisionModel
VirtualRobot::CollisionModelPtr agentCollisionModel
Definition: PathPlanner.h:118
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19