NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgUnidirComprSprActuator.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_UNIDIR_COMPR_SPR_ACTUATOR_H
20 #define SRC_CORE_TG_UNIDIR_COMPR_SPR_ACTUATOR_H
21 
33 // This application
34 #include "tgModel.h"
35 #include "tgControllable.h"
36 #include "tgSubject.h"
37 
38 // The Bullet Physics library
39 #include "LinearMath/btVector3.h"
40 
41 // This class inherits from tgCompressionSpringActuator
43 
44 // for history logging
45 #include <deque>
46 
47 // Forward declarations
49 class tgModelVisitor;
50 class tgWorld;
51 
62 // This class needs to be a child model of a tgModel, but that's
63 // taken care of by inheriting from tgCompressionSpringActuator
65 {
66 public:
67 
78  {
79  public:
80 
86  Config(
87  bool iFEA = false,
88  double s = 1000.0,
89  double d = 10.0,
90  double rL = 0.0,
91  bool moveCPA = true,
92  bool moveCPB = true,
93  btVector3 * dir = (new btVector3(0, 1, 0)) );
94 
109  btVector3 * direction;
110  };
111 
123  tgBulletUnidirComprSpr* compressionSpring,
124  const tgTags& tags,
126 
130  virtual ~tgUnidirComprSprActuator();
131 
136  virtual void setup(tgWorld& world);
137 
141  virtual void teardown();
142 
149  virtual void step(double dt);
150 
157  virtual void onVisit(const tgModelVisitor& r) const;
158 
171  //virtual const double getStartDistance() const;
172 
180  //virtual const double getCurrentDistance() const;
181 
185  //virtual const double getRestLength() const;
186 
194  //virtual const double getSpringForce() const;
195 
196 
197 protected:
198 
205 
206 private:
207 
219  void constructorAux();
220 
222  bool invariant() const;
223 
224 };
225 
226 
227 #endif
Contains the definition of class tgCompressionSpringActuator. This class assumes a linear spring...
Definition of tgSubject class.
virtual void onVisit(const tgModelVisitor &r) const
Contains the definition of class tgModel.
Definition of the tgControllable abstract base class.
Config(bool iFEA=false, double s=1000.0, double d=10.0, double rL=0.0, bool moveCPA=true, bool moveCPB=true, btVector3 *dir=(new btVector3(0, 1, 0)))
tgUnidirComprSprActuator(tgBulletUnidirComprSpr *compressionSpring, const tgTags &tags, tgUnidirComprSprActuator::Config &config)
virtual void setup(tgWorld &world)
Definition: tgTags.h:44
tgUnidirComprSprActuator::Config m_config