NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
VerticalSpineModelCableCollision.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 VERTICAL_SPINE_MODEL_CABLE_COLLISION_H
20 #define VERTICAL_SPINE_MODEL_CABLE_COLLISION_H
21 
28 /*
29 // This library
30 #include "core/tgModel.h"
31 #include "core/tgSubject.h"
32 */
34 
35 /*
36 // The C++ Standard Library
37 #include <map>
38 #include <set>
39 #include <string>
40 #include <vector>
41 */
42 // Forward declarations
43 /*
44 class tgSpringCableActuator;
45 class tgStructure;*/
46 class tgWorld;
47 //class tgStructureInfo;
48 
49 
51 {
52 public:
53 
54  VerticalSpineModelCableCollision(size_t segments);
56  virtual void setup(tgWorld& world);
57  virtual void teardown();
58  virtual void step(const double dt);
59 
60 };
61 
62 /* class VerticalSpineModel: public tgSubject<VerticalSpineModel>, public tgModel */
63 /* { */
64 /* public: */
65 
66 /* /\** */
67 /* * Used within this function to map segments to string keys */
68 /* *\/ */
69 /* typedef std::map<std::string, std::vector<tgSpringCableActuator*> > MuscleMap; */
70 
71 /* /\** */
72 /* * The only constructor. The model details are instantiated once */
73 /* * setup is called typically when the model is added to a simulation. */
74 /* * @param[in] segments, a positive integer dictating how many */
75 /* * rigid segments will be constructed. */
76 /* *\/ */
77 /* VerticalSpineModel(size_t segments); */
78 
79 /* /\** */
80 /* * Nothing to do. Most functions already handled by tgModel::teardown */
81 /* *\/ */
82 /* virtual ~VerticalSpineModel() */
83 /* {} */
84 
85 /* /\** */
86 /* * Create the model. Place the rods and strings into the world */
87 /* * that is passed into the simulation. This is triggered */
88 /* * automatically when the model is added to the simulation, when */
89 /* * tgModel::setup(world) is called (if this model is a child), */
90 /* * and when reset is called. Also notifies controllers of setup. */
91 /* * @param[in] world - the world we're building into */
92 /* *\/ */
93 /* virtual void setup(tgWorld& world); */
94 
95 /* /\** */
96 /* * Step the model, its children. Notifies controllers of step. */
97 /* * @param[in] dt, the timestep. Must be positive. */
98 /* *\/ */
99 /* virtual void step(const double dt); */
100 
101 /* /\** */
102 /* * Get a group of muscles according to the provided key. Groups are */
103 /* * populated during setup. */
104 /* * @param[in] key - a std:string* used as a key to a std::map from */
105 /* * a string to a vector of muscles */
106 /* * @return a std::vector of pointers to the muscles found by the key */
107 /* *\/ */
108 /* const std::vector<tgSpringCableActuator*>& getMuscles (const std::string& key) const; */
109 
110 /* const std::vector<tgSpringCableActuator*>& getAllMuscles() const; */
111 
112 /* /\** */
113 /* * Return a std::size_t indicating the number of segments in the */
114 /* * tetraSpine. */
115 /* * @return a std::size_t with the value of m_segments */
116 /* *\/ */
117 /* size_t getSegments() const */
118 /* { */
119 /* return m_segments; */
120 /* } */
121 
122 /* private: */
123 
124 /* /\** */
125 /* * A series of helper functions, used to create the model. */
126 /* *\/ */
127 
128 /* /\** */
129 /* * Generate the five nodes for a tetrahedron, inside the tgStructure */
130 /* * that's passed in. */
131 /* * @param[in] tetra: the structure to build the nodes into */
132 /* * @param[in] edge: edge length for this one tetrahedron */
133 /* * @param[in] height: height length for this one tetrahedron */
134 /* *\/ */
135 /* static void addNodes(tgStructure& tetra, double edge, double height); */
136 
137 /* /\** */
138 /* * Output debugging information for this model and structure. */
139 /* *\/ */
140 /* static void trace(const tgStructureInfo& structureInfo, tgModel& model); */
141 
142 /* /\** */
143 /* * Pair together the nodes for the first type of rod */
144 /* *\/ */
145 /* static void addPairs(tgStructure& tetra); */
146 
147 /* /\** */
148 /* * Pair together the nods for the second type of rod */
149 /* *\/ */
150 /* static void addPairsB(tgStructure& tetra); */
151 
152 /* /\** */
153 /* * Generate the full spine structure by copying and translating one tetra */
154 /* * into segmentCount number of tetras, and build that into spine. */
155 /* *\/ */
156 /* static void addSegments(tgStructure& spine, const tgStructure& tetra, double */
157 /* edge, size_t segmentCount); */
158 
159 /* /\** */
160 /* * Add the muscles that connect between the segments of the spine. */
161 /* *\/ */
162 /* static void addMuscles(tgStructure& spine); */
163 
164 /* /\** */
165 /* * Create the names for the muscles, used in the getMuscles function. */
166 /* *\/ */
167 /* static void mapMuscles(VerticalSpineModel::MuscleMap& muscleMap, tgModel& */
168 /* model, size_t segmentCount); */
169 
170 /* /\** */
171 /* * A std::vector containing all of the (tgBasicActuators:NOT ANYMORE) amongst */
172 /* * the children of this model. Populated during setup */
173 /* *\/ */
174 /* std::vector<tgSpringCableActuator*> allMuscles; */
175 
176 /* /\** */
177 /* * A typdef of std::map from std::string to tgLinearMuscle*. Contains */
178 /* * mapped muscles, populated during setup. */
179 /* *\/ */
180 /* MuscleMap muscleMap; */
181 
182 /* /\** */
183 /* * The number of segments in the spine */
184 /* *\/ */
185 /* const size_t m_segments; */
186 /* }; */
187 
188 #endif
A template base class for a tensegrity spine.