planning_interface.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Ioan Sucan */
36 
37 #ifndef MOVEIT_PLANNING_INTERFACE_PLANNING_INTERFACE_
38 #define MOVEIT_PLANNING_INTERFACE_PLANNING_INTERFACE_
39 
43 #include <string>
44 #include <map>
45 
46 namespace planning_scene
47 {
48 MOVEIT_CLASS_FORWARD(PlanningScene); // Defines PlanningScenePtr, ConstPtr, WeakPtr... etc
49 }
50 
53 {
60 
67 {
69  std::string group;
70 
71  /* \brief Name of the configuration.
72 
73  For a group's default configuration, this should be the same as the group name.
74  Otherwise, the form "group_name[config_name]" is expected for the name. */
75  std::string name;
76 
78  std::map<std::string, std::string> config;
79 };
80 
82 typedef std::map<std::string, PlannerConfigurationSettings> PlannerConfigurationMap;
83 
84 MOVEIT_CLASS_FORWARD(PlanningContext); // Defines PlanningContextPtr, ConstPtr, WeakPtr... etc
85 
89 {
90 public:
92  PlanningContext(const std::string& name, const std::string& group);
93 
94  virtual ~PlanningContext();
95 
97  const std::string& getGroupName() const
98  {
99  return group_;
100  }
101 
103  const std::string& getName() const
104  {
105  return name_;
106  }
107 
109  const planning_scene::PlanningSceneConstPtr& getPlanningScene() const
110  {
111  return planning_scene_;
112  }
113 
116  {
117  return request_;
118  }
119 
121  void setPlanningScene(const planning_scene::PlanningSceneConstPtr& planning_scene);
122 
124  void setMotionPlanRequest(const MotionPlanRequest& request);
125 
128  virtual bool solve(MotionPlanResponse& res) = 0;
129 
132  virtual bool solve(MotionPlanDetailedResponse& res) = 0;
133 
136  virtual bool terminate() = 0;
137 
139  virtual void clear() = 0;
140 
141 protected:
143  std::string name_;
144 
146  std::string group_;
147 
149  planning_scene::PlanningSceneConstPtr planning_scene_;
150 
153 };
154 
155 MOVEIT_CLASS_FORWARD(PlannerManager); // Defines PlannerManagerPtr, ConstPtr, WeakPtr... etc
156 
159 {
160 public:
162  {
163  }
164 
165  virtual ~PlannerManager()
166  {
167  }
168 
174  virtual bool initialize(const robot_model::RobotModelConstPtr& model, const std::string& ns);
175 
177  virtual std::string getDescription() const;
178 
181  virtual void getPlanningAlgorithms(std::vector<std::string>& algs) const;
182 
190  virtual PlanningContextPtr getPlanningContext(const planning_scene::PlanningSceneConstPtr& planning_scene,
191  const MotionPlanRequest& req,
192  moveit_msgs::MoveItErrorCodes& error_code) const = 0;
193 
195  PlanningContextPtr getPlanningContext(const planning_scene::PlanningSceneConstPtr& planning_scene,
196  const MotionPlanRequest& req) const;
197 
199  virtual bool canServiceRequest(const MotionPlanRequest& req) const = 0;
200 
202  virtual void setPlannerConfigurations(const PlannerConfigurationMap& pcs);
203 
205  const PlannerConfigurationMap& getPlannerConfigurations() const
206  {
207  return config_settings_;
208  }
209 
211  void terminate() const;
212 
213 protected:
219  PlannerConfigurationMap config_settings_;
220 };
221 
222 } // namespace planning_interface
223 
224 #endif
MOVEIT_CLASS_FORWARD(PlanningScene)
ros::NodeHandle getConfigNodeHandle(const ros::NodeHandle &nh=ros::NodeHandle("~"))
Retrieve NodeHandle/namespace defining the PlanningPipeline parameters Traditionally, these were directly defined in the private namespace of the move_group node. Since MoveIt 1.1.2 multiple pipeline configs are supported in parallel. In Melodic we support this new scheme by allowing to choose the default pipeline, specified via the parameter ~default_planning_pipeline.
ROSCONSOLE_DECL void initialize()
Specify the settings for a particular planning algorithm, for a particular group. The Planner plugin ...
std::map< std::string, PlannerConfigurationSettings > PlannerConfigurationMap
Map from PlannerConfigurationSettings.name to PlannerConfigurationSettings.
std::map< std::string, std::string > config
Key-value pairs of settings that get passed to the planning algorithm.
Representation of a particular planning context – the planning scene and the request are known...
const std::string & getGroupName() const
Get the name of the group this planning context is for.
std::string group_
The group (as in the SRDF) this planning context is for.
const PlannerConfigurationMap & getPlannerConfigurations() const
Get the settings for a specific algorithm.
planning_scene::PlanningSceneConstPtr planning_scene_
The planning scene for this context.
const std::string & getName() const
Get the name of this planning context.
This class maintains the representation of the environment as seen by a planning instance. The environment geometry, the robot geometry and state are maintained.
This namespace includes the central class for representing planning contexts.
moveit_msgs::MotionPlanRequest MotionPlanRequest
std::string group
The group (as defined in the SRDF) this configuration is meant for.
std::string name_
The name of this planning context.
This namespace includes the base class for MoveIt! planners.
const planning_scene::PlanningSceneConstPtr & getPlanningScene() const
Get the planning scene associated to this planning context.
MotionPlanRequest request_
The planning request for this context.
Base class for a MoveIt! planner.
PlannerConfigurationMap config_settings_
All the existing planning configurations. The name of the configuration is the key of the map...
const MotionPlanRequest & getMotionPlanRequest() const
Get the motion plan request associated to this planning context.


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Thu Mar 17 2022 02:51:04