Klamp't  0.8.1
RobotPoseGUI.h
1 #ifndef INTERFACE_ROBOTPOSEGUI_H
2 #define INTERFACE_ROBOTPOSEGUI_H
3 
4 #include "ResourceGUI.h"
5 #include "View/RobotPoseWidget.h"
6 #include "View/ObjectPoseWidget.h"
7 #include "Sensing/Sensor.h"
8 #include <KrisLibrary/utils/apputils.h>
9 #include <fstream>
10 
11 using namespace Math3D;
12 using namespace GLDraw;
13 
14 #define GLUT_LEFT_BUTTON 0
15 #define GLUT_MIDDLE_BUTTON 1
16 #define GLUT_RIGHT_BUTTON 2
17 
68 {
69  public:
70  AppUtils::ProgramSettings settings;
71  Robot* robot;
72  int cur_link,cur_driver;
73  vector<bool> self_colliding, env_colliding;
74 
75  int pose_objects;
76  vector<RobotPoseWidget> robotWidgets;
77  vector<RigidObjectPoseWidget> objectWidgets;
78  WidgetSet allWidgets;
79  GLDraw::Widget* lastActiveWidget;
80  int draw_geom,draw_poser,draw_bbs,draw_com,draw_frame,draw_sensors;
81  //temp: sensors storage
82  RobotSensors robotSensors;
83 
84  RobotPoseBackend(RobotWorld* world,ResourceManager* library);
85  virtual void Start();
86  void UpdateConfig();
87  virtual void RenderWorld();
88  virtual bool OnButtonPress(const string& button);
89  virtual bool OnButtonToggle(const string& button,int checked);
90  virtual bool OnCommand(const string& cmd,const string& args);
91  virtual void DoPassiveMouseMove(int x, int y);
92  virtual void BeginDrag(int x,int y,int button,int modifiers);
93  virtual void EndDrag(int x,int y,int button,int modifiers);
94  virtual void DoFreeDrag(int dx,int dy,int button);
95  void SetDrawExpanded(int value);
96 
97  Stance GetFlatStance(Real tolerance=0);
98  Stance GetNearbyStance(Real tolerance=0);
99  void CleanContacts(Hold&,Real xtol=0,Real ntol=0);
100  ResourcePtr PoserToResource(const string& type);
101 };
102 
103 
104 
105 #endif //INTERFACE_ROBOTPOSEGUI_H
A single contact between the robot and the environment.
Definition: Hold.h:26
The main robot type used in RobotSim.
Definition: Robot.h:79
A backend for resource browsing. Natively supports configs, paths, transforms, ik goals...
Definition: ResourceGUI.h:41
A collection of holds.
Definition: Stance.h:19
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:20
Common robot posing routines.
A set of sensors for the robot.
Definition: Sensor.h:106
Contains the functionality for the RobotPose program.
Definition: RobotPoseGUI.h:67
void GetFlatStance(RobotWithGeometry &robot, Real tol, Stance &s, Real kFriction=0)
Produces a stance as though the robot were standing on a plane.