Klamp't  0.8.1
urdf_world.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, 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 the 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: John Hsu */
36 
37 /* encapsulates components in a world
38  see http://ros.org/wiki/usdf/XML/urdf_world and
39  for details
40 */
41 /* example world XML
42 
43 <world name="pr2_with_table">
44  <!-- include the models by including
45  either the complete urdf or
46  referencing the file name. -->
47  <model name="pr2">
48  ...
49  </model>
50  <include filename="table.urdf" model_name="table_model"/>
51 
52  <!-- models in the world -->
53  <entity model="pr2" name="prj">
54  <origin xyz="0 1 0" rpy="0 0 0"/>
55  <twist linear="0 0 0" angular="0 0 0"/>
56  </entity>
57  <entity model="pr2" name="prk">
58  <origin xyz="0 2 0" rpy="0 0 0"/>
59  <twist linear="0 0 0" angular="0 0 0"/>
60  </entity>
61  <entity model="table_model">
62  <origin xyz="0 3 0" rpy="0 0 0"/>
63  <twist linear="0 0 0" angular="0 0 0"/>
64  </entity>
65 
66 </world>
67 
68 */
69 
70 #ifndef USDF_STATE_H
71 #define USDF_STATE_H
72 
73 #include <string>
74 #include <vector>
75 #include <map>
76 #include <tinyxml.h>
77 #include <memory>
78 
79 #include "urdf_model.h"
80 #include "urdf_pose.h"
81 #include "urdf_twist.h"
82 
83 namespace urdf{
84 
85 class Entity
86 {
87 public:
88  std::shared_ptr<ModelInterface> model;
89  Pose origin;
90  Twist twist;
91 };
92 
93 class World
94 {
95 public:
96  World() { this->clear(); };
97 
99  std::string name;
100 
101  std::vector<Entity> objectModels;
102  std::vector<Entity> robotModels;
103 
104  void initXml(TiXmlElement* config);
105 
106  void clear()
107  {
108  this->name.clear();
109  };
110 };
111 }
112 
113 #endif
114 
Definition: urdf_world.h:85
Definition: urdf_world.h:93
std::string name
world name must be unique
Definition: urdf_world.h:96
Definition: urdf_color.h:46
Definition: urdf_pose.h:239
Definition: urdf_twist.h:49