NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
inversespace.h
1 // Widget to edit joints in Inverse Space
2 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
3 
4 #ifndef INVERSESPACE_H
5 #define INVERSESPACE_H
6 
7 #include <QLabel>
8 #include <QLayout>
9 #include <QGridLayout>
10 #include <QDoubleSpinBox>
11 #include <QCheckBox>
12 
13 #include <gait/util/gait_inverse_pose.h>
14 #include <Eigen/Geometry>
15 
16 #include <trajectory_editor/spaces/positionview.h>
17 #include <trajectory_editor/spaces/basicspace.h>
18 #include <motion_file/poseconverter.h>
19 
20 class InverseSpace : public BasicSpace
21 {
22 Q_OBJECT
23 public:
24  InverseSpace(const std::vector<std::string> &jointList, QWidget *parent = 0);
25  ~InverseSpace();
26 
27 public Q_SLOTS:
28  void handlePerspectiveUpdate(const joint_perspective::JointPerspective &perspective);
29  void getInverseLimits(bool &limit, double &epsilon); // Returns values from GUI
30 
31 private Q_SLOTS:
32  void handlePositionChanged(const std::string joint_name, const double prev, const double current);
33 
34 private:
35  void initViews();
36  void updateFrame();
37 
38  void updatePosition(std::string jointName, double pos);
39  void updatePositionFromUI(gait::InversePose &inverse_pose);
40  void updateRotationFromUI(gait::InversePose &inverse_pose);
41 
42  double getPos(std::string name);
43 
44  // Find joint jointName in jointList and create view for it. Put it on layout
45  // If jointName was not found, put warning on layout
46  void findAndPutView(std::string jointName, std::string label, int row
47  , PositionView::Alignment alignment, PositionView::Type type);
48 
49  void createHeaderLabels();
50 
51 private:
52  std::vector<PositionView*> m_views;
53  QVBoxLayout *m_main_layout;
54  QHBoxLayout *m_epsilon_layout;
55  QGridLayout *m_joint_layout;
56 
57  QCheckBox *m_limit_inverse; // If true, the changes in inverse space are only applied, if only one inverse dimension changes
58  QDoubleSpinBox *m_epsilon_spin;
59 
60  gait::InversePose *m_inverse_pose;
61  gait::InversePose *m_temp_inverse_pose;
62 
63  motionfile::PoseConverter p;
64 };
65 
66 #endif // INVERSESPACE_H
Data struct that encompasses the inverse representation of a robot pose.
Definition: gait_inverse_pose.h:188