DARTModel.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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_DARTMODEL_HH_
19 #define _GAZEBO_DARTMODEL_HH_
20 
21 #include <string>
22 
25 #include "gazebo/physics/Model.hh"
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace physics
31  {
33  class DARTModelPrivate;
34 
39 
42  class GZ_PHYSICS_VISIBLE DARTModel : public Model
43  {
46  public: explicit DARTModel(BasePtr _parent);
47 
49  public: virtual ~DARTModel();
50 
51  // Documentation inherited.
52  public: virtual void Load(sdf::ElementPtr _sdf);
53 
54  // Documentation inherited.
55  public: virtual void Init();
56 
57  // Documentation inherited.
58  public: virtual void Update();
59 
60  // Documentation inherited.
61  public: virtual void Fini();
62 
63  // Documentation inherited.
64  public: virtual JointPtr CreateJoint(
65  const std::string &_name, const std::string &_type,
66  physics::LinkPtr _parent, physics::LinkPtr _child);
67 
68  // Documentation inherited.
69  public: virtual JointPtr CreateJoint(sdf::ElementPtr _sdf);
70 
71  // DART-specific joint construction used by both versions of CreateJoint.
72  private: JointPtr CreateJointHelper(JointPtr _joint);
73 
74  // Documentation inherited.
75  public: virtual bool RemoveJoint(const std::string &_name);
76 
78  public: void BackupState();
79 
81  public: void RestoreState();
82 
85  public: dart::dynamics::SkeletonPtr DARTSkeleton();
86 
89  public: DARTPhysicsPtr GetDARTPhysics(void) const;
90 
93  public: dart::simulation::WorldPtr DARTWorld(void) const;
94 
97  private: DARTModelPrivate *dataPtr;
98  };
100  }
101 }
102 #endif
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:89
Forward declarations for the common classes.
Definition: Animation.hh:26
DART model class.
Definition: DARTModel.hh:42
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:117
A model is a collection of links, joints, and plugins.
Definition: Model.hh:59
DART wrapper forward declarations and typedefs.
boost::shared_ptr< DARTPhysics > DARTPhysicsPtr
Definition: DARTTypes.hh:43
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77