Klamp't  0.9.0
SimViewProgram.h
1 #ifndef SIM_VIEW_PROGRAM
2 #define SIM_VIEW_PROGRAM
3 
4 #include "WorldViewProgram.h"
5 #include <Klampt/Simulation/Simulator.h>
6 #include <Klampt/Control/PathController.h>
7 
8 #if HAVE_GLUT || HAVE_GLUI
9 
10 namespace Klampt {
11 
12 //For a simulation set up with SimViewProgram, this retrieves the PolynomialMotionQueue for the controller
13 PolynomialMotionQueue* GetMotionQueue(RobotController* rc);
14 
22 class SimViewProgram : public WorldViewProgram
23 {
24 public:
25  SimViewProgram(WorldModel* world);
26 
28  bool LoadAndInitSim(const char* xmlFile);
29 
31  bool LoadAndInitSim(int argc,const char** argv);
32 
34  void InitSim();
35 
37  void ResetSim();
38 
40  virtual void RenderWorld();
41 
43  void DrawContacts(Real pointSize = 5.0, Real fscale = 0.01, Real nscale=0.05);
45  void DrawWrenches(Real fscale=-1);
46 
48  bool LoadMilestones(const char* fn);
49 
51  bool LoadLinearPath(const char* fn);
52 
54  bool LoadState(const char* fn);
55 
57  bool LoadMultiPath(const char* fn,bool constrainedInterpolate=true,Real interpolateTolerance=1e-2,Real durationScale=1.0);
58 
61  bool SendLinearPath(const vector<Real>& times,const vector<Config>& milestones,Real pathDelay=0.5);
62 
64  void DoLogging(const char* fn="simtest_log.csv");
65 
66  int simulate;
67  Simulator sim;
68  string initialState;
69 };
70 
71 } // namespace Klampt
72 
73 #endif //HAVE_GLUT || HAVE_GLUI
74 
75 #endif
Definition: ContactDistance.h:6