DARTPhysics.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-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_DARTPHYSICS_HH_
19 #define _GAZEBO_DARTPHYSICS_HH_
20 
21 #include <string>
22 
23 #include <boost/thread/thread.hpp>
24 #include <boost/thread/mutex.hpp>
25 
28 #include "gazebo/physics/Shape.hh"
29 
32 #include "gazebo/util/system.hh"
33 
34 namespace gazebo
35 {
36  namespace physics
37  {
41 
44  {
47  public: enum DARTParam
48  {
49  // /// \brief Solve type
50  // SOLVER_TYPE,
51 
52  // /// \brief Constraint force mixing
53  // GLOBAL_CFM,
54 
55  // /// \brief Error reduction parameter
56  // GLOBAL_ERP,
57 
58  // /// \brief Number of iterations
59  // PGS_ITERS,
60 
61  // /// \brief SOR over-relaxation parameter
62  // SOR,
63 
64  // /// \brief Surface layer depth
65  // CONTACT_SURFACE_LAYER,
66 
69 
71  MIN_STEP_SIZE
72  };
73 
75  public: DARTPhysics(WorldPtr _world);
76 
78  public: virtual ~DARTPhysics();
79 
80  // Documentation inherited
81  public: virtual void Load(sdf::ElementPtr _sdf);
82 
83  // Documentation inherited
84  public: virtual void Init();
85 
86  // Documentation inherited
87  public: virtual void Fini();
88 
89  // Documentation inherited
90  public: virtual void Reset();
91 
92  // Documentation inherited
93  public: virtual void InitForThread();
94 
95  // Documentation inherited
96  public: virtual void UpdateCollision();
97 
98  // Documentation inherited
99  public: virtual void UpdatePhysics();
100 
101  // Documentation inherited
102  public: virtual std::string GetType() const;
103 
104  // Documentation inherited
105  public: virtual void SetSeed(uint32_t _seed);
106 
107  // Documentation inherited
108  public: virtual ModelPtr CreateModel(BasePtr _parent);
109 
110  // Documentation inherited
111  public: virtual LinkPtr CreateLink(ModelPtr _parent);
112 
113  // Documentation inherited
114  public: virtual CollisionPtr CreateCollision(const std::string &_type,
115  LinkPtr _body);
116 
117  // Documentation inherited
118  public: virtual JointPtr CreateJoint(const std::string &_type,
119  ModelPtr _parent);
120 
121  // Documentation inherited
122  public: virtual ShapePtr CreateShape(const std::string &_shapeType,
123  CollisionPtr _collision);
124 
125  // Documentation inherited
126  public: virtual void SetGravity(const gazebo::math::Vector3 &_gravity);
127 
128  // Documentation inherited
129  public: virtual void DebugPrint() const;
130 
131  // Documentation inherited
132  public: virtual boost::any GetParam(const std::string &_key) const;
133 
134  // Documentation inherited
135  public: virtual bool SetParam(const std::string &_key,
136  const boost::any &_value);
137 
140  public: dart::simulation::World *GetDARTWorld();
141 
142  // Documentation inherited
143  protected: virtual void OnRequest(ConstRequestPtr &_msg);
144 
145  // Documentation inherited
146  protected: virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
147 
151  private: DARTLinkPtr FindDARTLink(
152  const dart::dynamics::BodyNode *_dtBodyNode);
153 
155  private: dart::simulation::World *dtWorld;
156  };
157 
159  }
160 }
161 #endif
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:66
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:82
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
boost::shared_ptr< Shape > ShapePtr
Definition: PhysicsTypes.hh:110
Base class for a physics engine.
Definition: PhysicsEngine.hh:40
DART physics engine.
Definition: DARTPhysics.hh:43
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:94
DART wrapper forward declarations and typedefs.
boost::shared_ptr< DARTLink > DARTLinkPtr
Definition: DARTTypes.hh:43
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:78
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:98
DARTParam
DART physics parameter types.
Definition: DARTPhysics.hh:47
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Maximum number of contacts.
Definition: DARTPhysics.hh:68
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:90