NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSpringCable.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_SPRING_CABLE_H_
20 #define SRC_CORE_TG_SPRING_CABLE_H_
21 
29 // The C++ Standard Library
30 #include <vector>
31 
32 // Forward references
34 
41 {
42 public:
43 
53  tgSpringCable( const std::vector<tgSpringCableAnchor*>& anchors,
54  double coefK,
55  double dampingCoefficient,
56  double pretension = 0.0);
57 
61  virtual ~tgSpringCable();
62 
68  virtual void step(double dt) = 0;
69 
73  virtual const double getRestLength() const;
74 
79  virtual void setRestLength( const double newRestLength);
80 
85  virtual const double getActualLength() const = 0;
86 
90  virtual const double getTension() const = 0;
91 
95  virtual const double getCoefK() const
96  {
97  return m_coefK;
98  }
99 
103  virtual const double getCoefD() const
104  {
105  return m_dampingCoefficient;
106  }
107 
111  virtual const double getVelocity() const
112  {
113  return m_velocity;
114  }
115 
119  virtual const double getDamping() const
120  {
121  return m_damping;
122  }
123 
128  virtual const std::vector<const tgSpringCableAnchor*> getAnchors() const = 0;
129 
130 protected:
131 
136  double m_damping;
137 
142  double m_velocity;
143 
149  const double m_coefK;
150 
156  const double m_dampingCoefficient;
157 
158 
162  double m_restLength;
163 
168  double m_prevLength;
169 
170 };
171 
172 #endif // SRC_CORE_TG_SPRING_CABLE_H_
virtual const double getCoefD() const
virtual void setRestLength(const double newRestLength)
virtual const double getVelocity() const
const double m_dampingCoefficient
virtual const double getRestLength() const
virtual ~tgSpringCable()
virtual const double getCoefK() const
Definition: tgSpringCable.h:95
tgSpringCable(const std::vector< tgSpringCableAnchor * > &anchors, double coefK, double dampingCoefficient, double pretension=0.0)
double m_restLength
virtual const std::vector< const tgSpringCableAnchor * > getAnchors() const =0
virtual const double getTension() const =0
virtual const double getDamping() const
virtual const double getActualLength() const =0
double m_prevLength
virtual void step(double dt)=0
const double m_coefK