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