All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DARTPhysics.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2014 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 
142  public: virtual boost::any GetParam(DARTParam _param) const
143  GAZEBO_DEPRECATED(3.0);
144 
147  public: dart::simulation::World *GetDARTWorld();
148 
149  // Documentation inherited
150  protected: virtual void OnRequest(ConstRequestPtr &_msg);
151 
152  // Documentation inherited
153  protected: virtual void OnPhysicsMsg(ConstPhysicsPtr &_msg);
154 
158  private: DARTLinkPtr FindDARTLink(
159  const dart::dynamics::BodyNode *_dtBodyNode);
160 
162  private: dart::simulation::World *dtWorld;
163  };
164 
166  }
167 }
168 #endif