srdf_writer.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: Dave Coleman */
36 
37 #ifndef _SRDFDOM_SRDF_WRITER_
38 #define _SRDFDOM_SRDF_WRITER_
39 
40 #include <boost/shared_ptr.hpp>
41 #include <srdfdom/model.h> // use their struct datastructures
42 
43 namespace srdf
44 {
45 
46 // ******************************************************************************************
47 // ******************************************************************************************
48 // Class
49 // ******************************************************************************************
50 // ******************************************************************************************
51 
53 {
54 public:
55  // ******************************************************************************************
56  // Public Functions
57  // ******************************************************************************************
61  SRDFWriter();
62 
66  ~SRDFWriter();
67 
76  bool initString( const urdf::ModelInterface &robot_model, const std::string &srdf_string );
77 
84  void initModel( const urdf::ModelInterface &robot_model, const srdf::Model &srdf_model );
85 
91  void updateSRDFModel( const urdf::ModelInterface &robot_model );
92 
99  bool writeSRDF( const std::string &file_path );
100 
106  std::string getSRDFString();
107 
113  TiXmlDocument generateSRDF();
114 
120  void createGroupsXML( TiXmlElement *root );
121 
127  void createLinkSphereApproximationsXML( TiXmlElement *root );
128 
134  void createDisabledCollisionsXML( TiXmlElement *root );
135 
141  void createGroupStatesXML( TiXmlElement *root );
142 
148  void createEndEffectorsXML( TiXmlElement *root );
149 
155  void createVirtualJointsXML( TiXmlElement *root );
156 
162  void createPassiveJointsXML( TiXmlElement *root );
163 
164  // ******************************************************************************************
165  // Group Datastructures
166  // ******************************************************************************************
167 
168  std::vector<srdf::Model::Group> groups_;
169  std::vector<srdf::Model::GroupState> group_states_;
170  std::vector<srdf::Model::VirtualJoint> virtual_joints_;
171  std::vector<srdf::Model::EndEffector> end_effectors_;
172  std::vector<srdf::Model::LinkSpheres> link_sphere_approximations_;
173  std::vector<srdf::Model::DisabledCollision> disabled_collisions_;
174  std::vector<srdf::Model::PassiveJoint> passive_joints_;
175 
176  // Store the SRDF Model for updating the kinematic_model
178 
179  // Robot name
180  std::string robot_name_;
181 
182 };
183 
184 // ******************************************************************************************
185 // Typedef
186 // ******************************************************************************************
188 
189 
190 }
191 
192 #endif
void createEndEffectorsXML(TiXmlElement *root)
void createDisabledCollisionsXML(TiXmlElement *root)
Representation of semantic information about the robot.
Definition: model.h:53
void createGroupStatesXML(TiXmlElement *root)
void updateSRDFModel(const urdf::ModelInterface &robot_model)
void initModel(const urdf::ModelInterface &robot_model, const srdf::Model &srdf_model)
Definition: srdf_writer.cpp:79
std::vector< srdf::Model::VirtualJoint > virtual_joints_
Definition: srdf_writer.h:170
void createPassiveJointsXML(TiXmlElement *root)
std::vector< srdf::Model::DisabledCollision > disabled_collisions_
Definition: srdf_writer.h:173
std::vector< srdf::Model::EndEffector > end_effectors_
Definition: srdf_writer.h:171
std::vector< srdf::Model::LinkSpheres > link_sphere_approximations_
Definition: srdf_writer.h:172
std::string robot_name_
Definition: srdf_writer.h:180
void createVirtualJointsXML(TiXmlElement *root)
boost::shared_ptr< SRDFWriter > SRDFWriterPtr
Definition: srdf_writer.h:187
srdf::ModelSharedPtr srdf_model_
Definition: srdf_writer.h:177
void createLinkSphereApproximationsXML(TiXmlElement *root)
bool writeSRDF(const std::string &file_path)
Main namespace.
Definition: model.h:49
TiXmlDocument generateSRDF()
void createGroupsXML(TiXmlElement *root)
bool initString(const urdf::ModelInterface &robot_model, const std::string &srdf_string)
Definition: srdf_writer.cpp:62
std::vector< srdf::Model::Group > groups_
Definition: srdf_writer.h:168
std::string getSRDFString()
std::vector< srdf::Model::GroupState > group_states_
Definition: srdf_writer.h:169
std::vector< srdf::Model::PassiveJoint > passive_joints_
Definition: srdf_writer.h:174


srdfdom
Author(s): Ioan Sucan , Guillaume Walck
autogenerated on Thu Jun 6 2019 19:59:13