Klamp't  0.9.0
RobotTestGUI.h
1 #ifndef ROBOTTESTGUI
2 #define ROBOTTESTGUI
3 
4 #include "WorldGUI.h"
5 #include "View/RobotPoseWidget.h"
6 #include "View/ObjectPoseWidget.h"
7 #include "Sensing/Sensor.h"
8 #include "GLUIGUI.h"
9 #include <fstream>
10 
11 namespace Klampt {
12  using namespace Math3D;
13  using namespace GLDraw;
14 
53 {
54 public:
55  RobotModel* robot;
56  //internal state
57  int cur_link,cur_driver;
58  vector<bool> self_colliding;
59  //temp: sensors storage
60  RobotSensors robotSensors;
61 
62  int pose_ik,pose_objects;
63  vector<RobotPoseWidget> robotWidgets;
64  vector<RigidObjectPoseWidget> objectWidgets;
65  WidgetSet allWidgets;
66  GLDraw::Widget* lastActiveWidget;
67  int draw_geom,draw_bbs,draw_com,draw_frame,draw_expanded,draw_sensors;
68  int draw_self_collision_tests;
69  int output_ros, ros_status;
70 
71  vector<GLDisplayList> originalDisplayLists,expandedDisplayLists;
72 
74  virtual void Start();
75  void UpdateConfig();
76  virtual void RenderWorld();
77  virtual bool OnQuit();
78  virtual bool OnButtonPress(const string& button);
79  virtual bool OnButtonToggle(const string& button,int checked);
80  virtual bool OnCommand(const string& cmd,const string& args);
81  virtual void DoPassiveMouseMove(int x, int y);
82  virtual void BeginDrag(int x,int y,int button,int modifiers);
83  virtual void EndDrag(int x,int y,int button,int modifiers);
84  virtual void DoFreeDrag(int dx,int dy,int button);
85  void RefreshSensors();
86  void SetDrawExpanded(int value);
87 };
88 
89 } // namespace Klampt
90 
91 #if HAVE_GLUI
92 
93 #if defined (__APPLE__) || defined (MACOSX)
94 #include <GL/glui.h>
95 #else
96 #include <GL/glui.h>
97 #endif //__APPLE__ || MACOSX
98 
99 namespace Klampt {
100 
101 class GLUIRobotTestGUI : public GLUIGUI
102 {
103  public:
104  WorldModel* world;
105  RobotModel* robot;
106  //GUI state
107  GLUI* glui;
108  GLUI_Spinner* link_spinner, *link_value_spinner;
109  GLUI_Listbox* link_listbox;
110  GLUI_StaticText* link_info;
111  GLUI_Spinner* driver_spinner, *driver_value_spinner;
112  GLUI_Listbox* driver_listbox;
113  GLUI_StaticText* driver_info;
114  int cur_link,cur_driver;
115 
116  GLUIRobotTestGUI(GenericBackendBase* backend,WorldModel* world,int w=800,int h=600);
117  virtual bool Initialize();
118  virtual void Handle_Control(int id);
119  virtual bool OnCommand(const string& cmd,const string& args);
120  void UpdateGUI();
121 };
122 
123 } // namespace Klampt
124 
125 #endif //HAVE_GLUI
126 
127 
128 #endif //ROBOTTESTGUI
A set of sensors for the robot.
Definition: Sensor.h:111
A base class for GLUI GUIs.
Definition: GLUIGUI.h:20
Common robot posing routines.
RobotTest program.
Definition: RobotTestGUI.h:52
The main robot type used in RobotSim.
Definition: Robot.h:83
Definition: GenericGUI.h:86
A generic gui with a WorldModel which allows clicking on entities and loading files.
Definition: WorldGUI.h:23
Definition: ContactDistance.h:6
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:24