NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
BigPuppySymmetricSpiral2.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 BIGPUPPY_SYMMETRIC_SPIRAL2_H
20 #define BIGPUPPY_SYMMETRIC_SPIRAL2_H
21 
32 
33 // This library
34 #include "core/tgModel.h"
35 #include "core/tgSubject.h"
36 // The C++ Standard Library
37 #include <map>
38 #include <set>
39 #include <string>
40 #include <vector>
41 
43 class tgWorld;
44 class tgStructure; //Do I need this, or tgStructureInfo?
45 class tgStructureInfo; //Do I need this, or just tgStructure, or both?
46 class tgBasicActuator;
47 
48 class BigPuppySymmetricSpiral2: public BaseSpineModelLearning //public tgSubject<BigPuppy>, public tgModel
49 {
50 public:
51 
52  BigPuppySymmetricSpiral2(int segments, int hips, int legs, int feet);
53 
54  virtual ~BigPuppySymmetricSpiral2();
55 
64  virtual void setup(tgWorld& world);
65 
70  virtual void teardown();
71 
76  virtual void step(double dt);
77 
78 protected:
79 
80  const std::size_t m_hips;
81  const std::size_t m_legs;
82  const std::size_t m_feet;
83 
84 private:
85 
94  void addNodesFoot(tgStructure& s, double r1, double r2);
95 
101  static void addRodsFoot(tgStructure& s);
102 
110  void addNodesLeg(tgStructure& s, double r);
111 
117  static void addRodsLeg(tgStructure& s);
118 
126  void addNodesHip(tgStructure& s, double r);
127 
133  static void addRodsHip(tgStructure& s);
134 
143  void addNodesVertebra(tgStructure& s, double r);
144 
151  static void addRodsVertebra(tgStructure& s);
152 
163  void addSegments(tgStructure& puppy, tgStructure& vertebra, tgStructure& hip, tgStructure& leg, double r);
164 
170  void addMuscles(tgStructure& puppy); //, std::size_t segments, std::size_t hips, std::size_t legs, std::size_t feet
171 
172 };
173 
174 #endif
Definition of tgSubject class.
A template base class for a tensegrity spine.
Contains the definition of class tgModel.
virtual void setup(tgWorld &world)