SpringPlugin.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 #ifndef __GAZEBO_SPRING_TEST_PLUGIN_HH__
18 #define __GAZEBO_SPRING_TEST_PLUGIN_HH__
19 
20 #include <string>
21 #pragma GCC diagnostic push
22 #pragma GCC system_header
23 
24 #include "gazebo/common/Plugin.hh"
25 #include "gazebo/physics/physics.hh"
26 #include "gazebo/util/system.hh"
27 #include <ros/ros.h>
28 
29 #pragma GCC diagnostic pop
30 
31 namespace gazebo {
32 class GAZEBO_VISIBLE SpringPlugin : public ModelPlugin {
33  public:
34  SpringPlugin();
35 
36  public:
37  virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
38 
39  public:
40  virtual void Init();
41 
42  private:
43  void ExplicitUpdate();
44 
45  private:
46  event::ConnectionPtr updateConnection_;
47 
48  private:
49  physics::ModelPtr model_;
50 
51  private:
52  common::Time prevUpdateTime_;
53 
54  private:
55  physics::JointPtr jointExplicit_;
56 
57  private:
58  std::string jointExplicitName_;
59 
61  private:
62  double kpExplicit_;
63 
65  private:
66  double kdExplicit_;
67 
69  private:
70  int axisExplicit_;
71 };
72 } // namespace gazebo
73 #endif
gazebo::SpringPlugin
Definition: SpringPlugin.hh:32
gazebo
Definition: SpringPlugin.hh:31