RubblePlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _GAZEBO_RUBBLE_PLUGIN_HH_
19 #define _GAZEBO_RUBBLE_PLUGIN_HH_
20 
21 #include <string>
22 #include <vector>
23 
24 #include <gazebo/common/Plugin.hh>
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
30  {
32  public: RubblePlugin();
33 
37  public: virtual void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf);
38 
40  public: virtual void Init();
41 
42  private: void MakeBox(const std::string &_name, math::Pose &_pose,
43  math::Vector3 &_size, double _mass);
44 
45  private: void MakeCinderBlock(const std::string &_name, math::Pose &_pose,
46  math::Vector3 &_size, double _mass);
47 
48  // private: void MakeCylinder(const std::string &_name, math::Vector3 &_pos,
49  // math::Vector3 &_size, double _mass);
50 
51  private: class Obj
52  {
53  public: math::Pose pose;
54  public: math::Vector3 size;
55  public: int type;
56  };
57 
58  private: class CompoundObj
59  {
60  // center position
61  public: math::Vector3 pos;
62 
63  // Total size
64  public: math::Vector3 size;
65  public: std::vector<Obj> objects;
66  };
67 
68  // private: void MakeCompound(const std::string &_name, CompoundObj &_obj);
69  private: physics::WorldPtr world;
70  };
71 }
72 #endif
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
A plugin with access to physics::World.
Definition: Plugin.hh:220
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:80
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
Definition: RubblePlugin.hh:29