robot_model_loader.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 #pragma once
38 
43 
45 {
46 MOVEIT_CLASS_FORWARD(RobotModelLoader); // Defines RobotModelLoaderPtr, ConstPtr, WeakPtr... etc
47 
49 class RobotModelLoader
50 {
51 public:
53  struct Options
54  {
55  Options(const std::string& robot_description = "robot_description")
56  : robot_description_(robot_description), load_kinematics_solvers_(true)
57  {
58  }
59 
60  Options(const std::string& urdf_string, const std::string& srdf_string)
61  : urdf_string_(urdf_string), srdf_string_(srdf_string), load_kinematics_solvers_(true)
62  {
63  }
64 
68  std::string robot_description_;
69 
72  std::string urdf_string_, srdf_string_;
73 
77  };
78 
80  RobotModelLoader(const Options& opt = Options());
81 
82  RobotModelLoader(const std::string& robot_description, bool load_kinematics_solvers = true);
83 
85 
87  const moveit::core::RobotModelPtr& getModel() const
88  {
89  return model_;
90  }
91 
93  const std::string& getRobotDescription() const
94  {
95  return rdf_loader_->getRobotDescription();
96  }
97 
99  const urdf::ModelInterfaceSharedPtr& getURDF() const
100  {
101  return rdf_loader_->getURDF();
102  }
103 
105  const srdf::ModelSharedPtr& getSRDF() const
106  {
107  return rdf_loader_->getSRDF();
108  }
109 
111  const rdf_loader::RDFLoaderPtr& getRDFLoader() const
112  {
113  return rdf_loader_;
114  }
115 
118  const kinematics_plugin_loader::KinematicsPluginLoaderPtr& getKinematicsPluginLoader() const
119  {
120  return kinematics_loader_;
121  }
122 
125  void loadKinematicsSolvers(const kinematics_plugin_loader::KinematicsPluginLoaderPtr& kloader =
126  kinematics_plugin_loader::KinematicsPluginLoaderPtr());
127 
128 private:
129  void configure(const Options& opt);
130 
131  moveit::core::RobotModelPtr model_;
132  rdf_loader::RDFLoaderPtr rdf_loader_;
133  kinematics_plugin_loader::KinematicsPluginLoaderPtr kinematics_loader_;
134 };
135 } // namespace robot_model_loader
robot_model.h
robot_model_loader::RobotModelLoader::model_
moveit::core::RobotModelPtr model_
Definition: robot_model_loader.h:163
robot_model_loader::RobotModelLoader::getRobotDescription
const std::string & getRobotDescription() const
Get the resolved parameter name for the robot description.
Definition: robot_model_loader.h:125
robot_model_loader::RobotModelLoader::getSRDF
const srdf::ModelSharedPtr & getSRDF() const
Get the parsed SRDF model.
Definition: robot_model_loader.h:137
robot_model_loader
Definition: robot_model_loader.h:44
robot_model_loader::RobotModelLoader::rdf_loader_
rdf_loader::RDFLoaderPtr rdf_loader_
Definition: robot_model_loader.h:164
robot_model_loader::RobotModelLoader::getKinematicsPluginLoader
const kinematics_plugin_loader::KinematicsPluginLoaderPtr & getKinematicsPluginLoader() const
Get the kinematics solvers plugin loader.
Definition: robot_model_loader.h:150
srdf::ModelSharedPtr
std::shared_ptr< Model > ModelSharedPtr
robot_model_loader::RobotModelLoader
Definition: robot_model_loader.h:81
robot_model_loader::RobotModelLoader::Options::urdf_string_
std::string urdf_string_
The string content of the URDF and SRDF documents. Loading from string is attempted only if loading f...
Definition: robot_model_loader.h:104
robot_model_loader::RobotModelLoader::Options::load_kinematics_solvers_
bool load_kinematics_solvers_
Flag indicating whether the kinematics solvers should be loaded as well, using specified ROS paramete...
Definition: robot_model_loader.h:108
robot_model_loader::RobotModelLoader::configure
void configure(const Options &opt)
Definition: robot_model_loader.cpp:120
robot_model_loader::RobotModelLoader::Options
Structure that encodes the options to be passed to the RobotModelLoader constructor.
Definition: robot_model_loader.h:85
robot_model_loader::RobotModelLoader::RobotModelLoader
RobotModelLoader(const Options &opt=Options())
Default constructor.
Definition: robot_model_loader.cpp:85
robot_model_loader::RobotModelLoader::getRDFLoader
const rdf_loader::RDFLoaderPtr & getRDFLoader() const
Get the instance of rdf_loader::RDFLoader that was used to load the robot description.
Definition: robot_model_loader.h:143
robot_model_loader::RobotModelLoader::~RobotModelLoader
~RobotModelLoader()
Definition: robot_model_loader.cpp:90
class_forward.h
robot_model_loader::RobotModelLoader::Options::robot_description_
std::string robot_description_
The string name corresponding to the ROS param where the URDF is loaded; Using the same parameter nam...
Definition: robot_model_loader.h:100
kinematics_plugin_loader.h
robot_model_loader::RobotModelLoader::Options::srdf_string_
std::string srdf_string_
Definition: robot_model_loader.h:104
robot_model_loader::RobotModelLoader::loadKinematicsSolvers
void loadKinematicsSolvers(const kinematics_plugin_loader::KinematicsPluginLoaderPtr &kloader=kinematics_plugin_loader::KinematicsPluginLoaderPtr())
Load the kinematics solvers into the kinematic model. This is done by default, unless disabled explic...
Definition: robot_model_loader.cpp:201
robot_model_loader::MOVEIT_CLASS_FORWARD
MOVEIT_CLASS_FORWARD(RobotModelLoader)
robot_model_loader::RobotModelLoader::kinematics_loader_
kinematics_plugin_loader::KinematicsPluginLoaderPtr kinematics_loader_
Definition: robot_model_loader.h:165
robot_model_loader::RobotModelLoader::Options::Options
Options(const std::string &robot_description="robot_description")
Definition: robot_model_loader.h:87
rdf_loader.h
robot_model_loader::RobotModelLoader::getURDF
const urdf::ModelInterfaceSharedPtr & getURDF() const
Get the parsed URDF model.
Definition: robot_model_loader.h:131
robot_model_loader::RobotModelLoader::getModel
const moveit::core::RobotModelPtr & getModel() const
Get the constructed planning_models::RobotModel.
Definition: robot_model_loader.h:119


planning
Author(s): Ioan Sucan , Sachin Chitta
autogenerated on Wed Sep 15 2021 02:23:57