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