NTRT Simulator  v1.1
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgKinematicActuator.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 #ifndef SRC_CORE_TG_KINEMATIC_ACTUATOR_H
20 #define SRC_CORE_TG_KINEMATIC_ACTUATOR_H
21 
30 // This application
31 #include "core/tgModel.h"
33 
34 // Forward declarations
36 class tgModelVisitor;
37 class tgWorld;
38 
39 // Should always be a child Model of a tgModel
41 {
42 public:
44  {
45  Config(double s = 1000.0,
46  double d = 10.0,
47  double p = 0.0,
48  double rad = 1.0,
49  double moFric = 0.0,
50  double moInert = 1.0,
51  bool back = false,
52  bool h = false,
53  double mf = 1000.0,
54  double tVel = 100.0,
55  double mnAL = 0.1,
56  double mnRL = 0.1,
57  double rot = 0);
58 
64  void scale (double sf);
65 
69  double radius;
70 
77  double motorFriction;
78 
83  double motorInertia;
84 
92  double maxOmega;
93  double maxTorque;
94  };
95 
105  const tgTags& tags,
107 
111  virtual ~tgKinematicActuator();
112 
117  virtual void setup(tgWorld& world);
118 
122  virtual void teardown();
123 
130  virtual void step(double dt);
131 
138  virtual void onVisit(const tgModelVisitor& r) const;
139 
151  virtual const double getVelocity() const;
152 
154 
159  virtual double getAppliedTorque(double desiredTorque) const;
160 
161 
167  virtual void setControlInput(double input);
168 
169 protected:
170 
171  virtual void integrateRestLength(double dt);
172 private:
173 
177  void constructorAux();
178 
183  void logHistory();
184 
186  bool invariant() const;
187 
191  double prevVel;
192 
196  double m_motorVel;
197 
201  double m_motorAcc;
202 
206  double m_desiredTorque;
207 
212 
213 };
214 
215 
216 #endif
virtual void setup(tgWorld &world)
virtual double getAppliedTorque(double desiredTorque) const
virtual void setControlInput(double input)
Contains the definition of class tgModel.
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
tgKinematicActuator(tgBulletSpringCable *muscle, const tgTags &tags, tgKinematicActuator::Config &config)
virtual void integrateRestLength(double dt)
virtual const double getVelocity() const
virtual void step(double dt)
virtual const tgSpringCableActuator::SpringCableActuatorHistory & getHistory() const
virtual void onVisit(const tgModelVisitor &r) const
Definition: tgTags.h:44