NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBasicActuator.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_BASIC_ACTUATOR_H
20 #define SRC_CORE_TG_BASIC_ACTUATOR_H
21 
30 // This application
31 #include "tgModel.h"
32 #include "tgSpringCableActuator.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:
43 
53  const tgTags& tags,
55 
59  virtual ~tgBasicActuator();
60 
65  virtual void setup(tgWorld& world);
66 
70  virtual void teardown();
71 
78  virtual void step(double dt);
79 
86  virtual void onVisit(const tgModelVisitor& r) const;
87 
88 
95  virtual void setControlInput(double input);
96 
103  virtual void setControlInput(double input, double dt);
104 
109  virtual void moveMotors(double dt);
110 
111 
112 private:
113 
117  void constructorAux();
118 
123  void logHistory();
124 
126  bool invariant() const;
127 
131  double prevVel;
132 
136  double m_preferredLength;
137 
138 };
139 
140 
141 #endif
tgBasicActuator(tgBulletSpringCable *muscle, const tgTags &tags, tgSpringCableActuator::Config &config)
virtual void moveMotors(double dt)
virtual void setControlInput(double input)
virtual void step(double dt)
virtual void setup(tgWorld &world)
Contains the definition of class tgModel.
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
virtual ~tgBasicActuator()
virtual void teardown()
virtual void onVisit(const tgModelVisitor &r) const
Definition: tgTags.h:44