NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
AppQuadControlSpiral.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_CONTROL_SPIRAL_H
20 #define APP_QUAD_CONTROL_SPIRAL_H
21 
29 //robot
31 
32 // controller
33 #include "dev/dhustigschultz/BP_SC_Symmetric/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  AppQuadControlSpiral(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 
94  bool use_graphics;
95  bool add_controller;
96  bool add_blocks;
97  bool add_hills;
98  bool all_terrain;
99  double timestep_physics; //Seconds
100  double timestep_graphics; // Seconds, AKA render rate. Leave at 1/60 for real-time viewing
101  int nEpisodes; // Number of episodes ("trial runs")
102  int nSteps; // Number of steps in each episode, 60k is 100 seconds (timestep_physics*nSteps)
103  int nSegments; // Number of segments in the tensegrity spine
104  int nTypes; // Number of types of terrain to be used. Currently 3
105 
106  double startX;
107  double startY;
108  double startZ;
109  double startAngle;
110  double goalAngle;
111 
112  std::string lowerPath;
113  std::string suffix;
114 
115  bool bSetup;
116 };
117 
118 #endif // APP_QUAD_CONTROL_SPIRAL_H
119 
Implementing the Flemons quadruped model (roughly), but as a subclass of Brian's BaseSpineModelLearni...
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.