NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
AppMultiTerrain_OC.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_MULTI_TERRAIN_OC
20 #define APP_MULTI_TERRAIN_OC
21 
29 // obstacles
31 
32 // This library
33 #include "core/tgModel.h"
34 #include "core/tgSimViewGraphics.h"
35 #include "core/tgSimulation.h"
36 #include "core/tgWorld.h"
39 
40 // Boost
41 #include <boost/program_options.hpp>
42 
43 // The C++ Standard Library
44 #include <iostream>
45 #include <string>
46 
47 namespace po = boost::program_options;
48 
50 {
51 public:
52  AppMultiTerrain_OC(int argc, char** argv);
53 
55  bool setup();
57  bool run();
58 
59 private:
61  void handleOptions(int argc, char** argv);
62 
63  const tgHillyGround::Config getHillyConfig();
64 
65  const tgBoxGround::Config getBoxConfig();
66 
67  tgModel* getBlocks();
68 
70  tgWorld *createWorld();
71 
73  tgSimViewGraphics *createGraphicsView(tgWorld *world);
74 
76  tgSimView *createView(tgWorld *world);
77 
79  void simulate(tgSimulation *simulation);
80 
81 
82  // Keep these around for cleanup
83  tgWorld* world;
84  tgSimView* view;
85  tgSimulation* simulation;
86 
87  bool use_graphics;
88  bool add_controller;
89  bool add_blocks;
90  bool add_hills;
91  bool all_terrain;
92  double timestep_physics; //Seconds
93  double timestep_graphics; // Seconds, AKA render rate. Leave at 1/60 for real-time viewing
94  int nEpisodes; // Number of episodes ("trial runs")
95  int nSteps; // Number of steps in each episode, 60k is 100 seconds (timestep_physics*nSteps)
96  int nSegments; // Number of segments in the tensegrity spine
97  int nTypes; // Number of types of terrain to be used. Currently 3
98 
99  double startX;
100  double startY;
101  double startZ;
102  double startAngle;
103 
104  std::string suffix;
105 
106  bool bSetup;
107 };
108 
109 #endif // APP_DUCTT
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.