se2ez
jointwidget.h
Go to the documentation of this file.
1 /* Author: Constantinos Chamzas, Zachary Kingston */
2 
3 #ifndef SE2EZ_GUI_JOINTWIDGET_
4 #define SE2EZ_GUI_JOINTWIDGET_
5 
6 #include <QWidget>
7 #include <QSlider>
8 #include <QDoubleSpinBox>
9 
10 #include <Eigen/Core>
11 
13 
14 namespace Ui
15 {
16  class JointWidget;
17 }
18 
19 namespace se2ez
20 {
21  /** \cond IGNORE */
22  SE2EZ_CLASS_FORWARD(Robot)
23  SE2EZ_CLASS_FORWARD(State)
24  /** \endcond */
25 
26  namespace gui
27  {
28  /** \cond IGNORE */
29  SE2EZ_CLASS_FORWARD(Panel)
30  /** \endcond */
31 
32  class JointWidget : public QWidget
33  {
34  Q_OBJECT;
35 
36  public:
37  JointWidget(Panel *parent, std::string name, RobotPtr robot, StatePtr state);
38 
39  void updateState();
40  void fromState();
41  void reset();
42  ~JointWidget();
43 
44  signals:
45  void stateChanged();
46 
47  private slots:
48  void xChanged(int value);
49  void yChanged(int value);
50  void tChanged(int value);
51  void xBoxChanged(double value);
52  void yBoxChanged(double value);
53  void tBoxChanged(double value);
54 
55  private:
56  void keyPressEvent(QKeyEvent *event);
57  void setValue();
58  void setSlider(unsigned int index, int value, bool update);
59  void setBox(unsigned int index, double value, bool update);
60 
61  Eigen::Vector3d value_;
62  Eigen::Vector3d lower_;
63  Eigen::Vector3d upper_;
64 
65  StatePtr state_{nullptr};
66  RobotPtr robot_{nullptr};
67 
69  Ui::JointWidget *ui_;
70  QSlider *sliders[3];
71  QDoubleSpinBox *boxes[3];
72 
74  };
75  } // namespace gui
76 } // namespace se2ez
77 
78 #endif
Eigen::Vector3d lower_
Definition: jointwidget.h:62
A shared pointer wrapper for se2ez::State.
Definition: cspacepanel.h:22
Eigen::Vector3d value_
Definition: jointwidget.h:61
Eigen::Vector3d upper_
Definition: jointwidget.h:63
Ui::JointWidget * ui_
Definition: jointwidget.h:69
A shared pointer wrapper for se2ez::Robot.
Main namespace.
Definition: collision.h:11
#define SE2EZ_CLASS_FORWARD(C)
Definition: class_forward.h:9