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