NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
NestedStructureSineWaves.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 NESTED_STRUCTURE_SINE_WAVES_H
20 #define NESTED_STRUCTURE_SINE_WAVES_H
21 
30 // NTRTSim
31 #include "core/tgObserver.h"
32 
33 // The C++ Standard Library
34 #include <vector>
35 
36 // Forward Declarations
38 class tgBasicActuator;
40 
45 class NestedStructureSineWaves : public tgObserver<NestedStructureTestModel>
46 {
47 public:
48 
55 
60 
68  void applyImpedanceControlInside(const std::vector<tgBasicActuator*> stringList,
69  double dt);
79  void applyImpedanceControlOutside(const std::vector<tgBasicActuator*> stringList,
80  double dt,
81  std::size_t phase);
82 
90  virtual void onStep(NestedStructureTestModel& subject, double dt);
91 
92 private:
96  tgImpedanceController* in_controller;
97  tgImpedanceController* out_controller;
98 
99  std::size_t segments;
100 
105  const double insideLength;
106  const double outsideLength;
107 
111  const double offsetSpeed;
112  const double cpgAmplitude;
113  const double cpgFrequency;
114  const double bodyWaves;
115 
122  std::vector<double> phaseOffsets;
123 
129  double simTime;
130  double cycle;
131  double target;
132 };
133 
134 #endif // MY_MODEL_CONTROLLER_H
Definition of tgObserver class.
void applyImpedanceControlOutside(const std::vector< tgBasicActuator * > stringList, double dt, std::size_t phase)
void applyImpedanceControlInside(const std::vector< tgBasicActuator * > stringList, double dt)
virtual void onStep(NestedStructureTestModel &subject, double dt)