NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSineStringControl.h
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 TG_SINE_STRING_CONTRL_H
20 #define TG_SINE_STRING_CONTRL_H
21 
23 
24 // Forward declarations
25 class btRigidBody;
27 
28 class tgSineStringControl : public tgObserver<tgSpringCableActuator>
29 {
30 public:
31 
32  tgSineStringControl(const double controlStep,
33  tgImpedanceController* p_ipc,
34  const double amplitude,
35  const double frequency,
36  const double phase,
37  const double offset,
38  const double length);
39 
40  virtual ~tgSineStringControl();
41 
42  virtual void onStep(tgSpringCableActuator& subject, double dt);
43 
44 
45 
46  const double getCommandedTension() const
47  {
48  return m_commandedTension;
49  }
50 
51 private:
56  double m_controlTime;
57  double m_totalTime;
62  const double m_controlStep;
63 
64  double m_commandedTension;
65 
69  const double cpgAmplitude;
70  const double cpgFrequency;
71  const double phaseOffset;
72  const double offsetSpeed;
83  double cycle;
84  double target;
85 
89  const double m_controlLength;
90 
91  tgImpedanceController* m_pMotorControl;
92 };
93 
94 
95 #endif
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
virtual void onStep(tgSpringCableActuator &subject, double dt)
tgSineStringControl(const double controlStep, tgImpedanceController *p_ipc, const double amplitude, const double frequency, const double phase, const double offset, const double length)