RubblePlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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_PLUGINS_RUBBLEPLUGIN_HH_
19 #define GAZEBO_PLUGINS_RUBBLEPLUGIN_HH_
20 
21 #include <string>
22 #include <vector>
23 
24 #include <ignition/math/Pose3.hh>
25 
26 #include <gazebo/common/Plugin.hh>
27 #include "gazebo/util/system.hh"
28 
29 namespace gazebo
30 {
32  {
34  public: RubblePlugin();
35 
39  public: virtual void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf);
40 
42  public: virtual void Init();
43 
44  private: void MakeBox(const std::string &_name,
45  ignition::math::Pose3d &_pose,
46  ignition::math::Vector3d &_size,
47  const double _mass);
48 
49  private: void MakeCinderBlock(const std::string &_name,
50  ignition::math::Pose3d &_pose,
51  ignition::math::Vector3d &_size,
52  const double _mass);
53 
54  // private: void MakeCylinder(const std::string &_name,
55  // ignition::math::Vector3d &_pos,
56  // ignition::math::Vector3d &_size, double _mass);
57 
58  private: class Obj
59  {
60  public: ignition::math::Pose3d pose;
61  public: ignition::math::Vector3d size;
62  public: int type;
63  };
64 
65  private: class CompoundObj
66  {
67  // center position
68  public: ignition::math::Vector3d pos;
69 
70  // Total size
71  public: ignition::math::Vector3d size;
72  public: std::vector<Obj> objects;
73  };
74 
75  // private: void MakeCompound(const std::string &_name, CompoundObj &_obj);
76  private: physics::WorldPtr world;
77  };
78 }
79 #endif
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
Forward declarations for the common classes.
Definition: Animation.hh:26
A plugin with access to physics::World.
Definition: Plugin.hh:280
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:59
Definition: RubblePlugin.hh:31