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