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
39namespace armarx
40{
41 /**
42 * @brief Holds properties for PathPlanner.
43 * @see PathPlanner
44 */
46 {
47 public:
49 {
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:
75
76 /**
77 * @see PropertyUser::createPropertyDefinitions()
78 */
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;
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
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
Definition Component.cpp:66
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Holds properties for PathPlanner.
Definition PathPlanner.h:46
PathPlannerPropertyDefinitions(std::string prefix)
Definition PathPlanner.h:48
void onInitComponent() override
memoryx::CommonStorageInterfacePrx commonStoragePrx
VirtualRobot::CollisionModelPtr agentCollisionModel
void setAgent(const ::memoryx::AgentInstanceBasePtr &newAgent, const std::string &agentColModelName, const ::Ice::Current &=Ice::emptyCurrent) override
memoryx::WorkingMemoryInterfacePrx workingMemoryPrx
void addCollisionObjects(const ::armarx::ObjectPositionBaseList &list, const ::Ice::Current &=Ice::emptyCurrent) override
bool isPositionValid(armarx::Vector3 position) const
void setCollisionObjects(const ::armarx::ObjectPositionBaseList &list, const ::Ice::Current &=Ice::emptyCurrent) override
memoryx::GridFileManagerPtr fileManager
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition PathPlanner.h:80
::armarx::Vector3BaseList getPath(const ::armarx::Vector3BasePtr &, const ::armarx::Vector3BasePtr &, const ::Ice::Current &=Ice::emptyCurrent) const override=0
void setSafetyMargin(::Ice::Float margin, const ::Ice::Current &=Ice::emptyCurrent) override
void onConnectComponent() override
void clearCollisionObjects(const ::Ice::Current &=Ice::emptyCurrent) override
std::vector< CollisionObjectData > objects
VirtualRobot::RobotPtr agent
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
The Vector3 class.
Definition Pose.h:113
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::Handle<::armarx::PathPlanner > PathPlannerPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::shared_ptr< GridFileManager > GridFileManagerPtr
memoryx::ObjectClassBasePtr object
VirtualRobot::CollisionModelPtr colModel