NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
AppMixedLearning.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 APP_MIXED_LEARNING
20 #define APP_MIXED_LEARNING
21 
30 //robot
31 //#include "dev/btietz/TCContact/FlemonsSpineModelContact.h"
32 //#include "FlemonsSpineModelMixed.h"
33 #include "RibModelMixedContact.h"
34 
35 // controller
37 
38 // obstacles
40 
41 // This library
42 #include "core/tgModel.h"
43 #include "core/tgSimViewGraphics.h"
44 #include "core/tgSimulation.h"
45 #include "core/tgWorld.h"
48 
49 // Boost
50 #include <boost/program_options.hpp>
51 
52 // The C++ Standard Library
53 #include <iostream>
54 #include <string>
55 
56 namespace po = boost::program_options;
57 
59 {
60 public:
61  AppMixedLearning(int argc, char** argv);
62 
64  bool setup();
66  bool run();
67 
68 private:
70  void handleOptions(int argc, char** argv);
71 
72  const tgHillyGround::Config getHillyConfig();
73 
74  const tgBoxGround::Config getBoxConfig();
75 
76  tgModel* getBlocks();
77 
79  tgWorld *createWorld();
80 
82  tgSimViewGraphics *createGraphicsView(tgWorld *world);
83 
85  tgSimView *createView(tgWorld *world);
86 
88  void simulate(tgSimulation *simulation);
89 
90 
91  // Keep these around for cleanup
92  tgWorld* world;
93  tgSimView* view;
94  tgSimulation* simulation;
95 
96  bool use_graphics;
97  bool add_controller;
98  bool add_blocks;
99  bool add_hills;
100  bool all_terrain;
101  double timestep_physics; //Seconds
102  double timestep_graphics; // Seconds, AKA render rate. Leave at 1/60 for real-time viewing
103  int nEpisodes; // Number of episodes ("trial runs")
104  int nSteps; // Number of steps in each episode, 60k is 100 seconds (timestep_physics*nSteps)
105  int nSegments; // Number of segments in the tensegrity spine
106  int nTypes; // Number of types of terrain to be used. Currently 3
107 
108  double startX;
109  double startY;
110  double startZ;
111  double startAngle;
112  double goalAngle;
113 
114  std::string lowerPath;
115  std::string suffix;
116 
117  bool bSetup;
118 };
119 
120 #endif // APP_MIXED_LEARNING
Contains the definition of class tgHillyGround.
Contains the definition of class tgSimulation.
Contains the definition of class tgModel.
Contains the definition of class tgSimViewGraphics.
Contains the definition of class tgBlockField. A random field of blocks used to test tensegrities...
Contains the definition of class tgWorld $Id$.
Contains the definition of class tgBoxGround.
A controller for the template class BaseSpineModelLearning.
Implements a spine model with a rib cage, including contact cables and tags to facilitate different l...