se2ez
jointpanel.h
Go to the documentation of this file.
1 /* Author: Constantinos Chamzas, Zachary Kingston */
2 
3 #ifndef SE2EZ_GUI_JOINTPANEL_
4 #define SE2EZ_GUI_JOINTPANEL_
5 
6 #include <mutex>
7 #include <set>
8 
9 #include <QWidget>
10 #include <QPainter>
11 
13 
14 #include <se2ez/gui/panel.h>
15 
16 namespace Ui
17 {
18  class JointPanel;
19 }
20 
21 namespace se2ez
22 {
23  /** \cond IGNORE */
24  SE2EZ_CLASS_FORWARD(Robot)
25  SE2EZ_CLASS_FORWARD(State)
26  SE2EZ_CLASS_FORWARD(TreeIK)
27  SE2EZ_CLASS_FORWARD(CollisionManager)
28  /** \endcond */
29 
30  namespace gui
31  {
32  /** \cond IGNORE */
33  SE2EZ_CLASS_FORWARD(RenderArea)
34  SE2EZ_CLASS_FORWARD(JointWidget)
35  /** \endcond */
36 
37  /** \cond IGNORE */
38  SE2EZ_CLASS_FORWARD(JointPanel)
39  /** \endcond */
40 
41  class JointPanel : public Panel
42  {
43  Q_OBJECT
44 
45  friend class JointWidget;
46 
47  public:
48  JointPanel(RobotPtr robot, std::string name, QWidget *parent = 0);
49  ~JointPanel();
50 
51  void draw(QPainter &painter, RenderArea *canvas) override;
52  bool click(QMouseEvent *event, double x, double y, int sx, int sy) override;
53  void update(boost::posix_time::ptime last, boost::posix_time::ptime current) override;
54 
55  void setState(const StatePtr &state);
56  void getState(StatePtr state);
57  const RobotPtr &getRobot();
58  const StatePtr &getState();
59 
60  const std::string &getEE();
61  std::string getSignature();
62 
63  public slots:
64  void updateState();
65  void reset();
66  void random();
67  void randomCollisionFree();
68  void updateIK();
69 
70  signals:
71  void stateChanged();
72 
73  private:
74  Ui::JointPanel *ui_;
75 
76  RobotPtr robot_{nullptr};
77  StatePtr jstate_{nullptr};
78 
80  TreeIKPtr ik_{nullptr};
81  CollisionManagerPtr cm_{nullptr};
85 
87  };
88  } // namespace gui
89 } // namespace se2ez
90 
91 #endif // JOINTPANEL_H
A shared pointer wrapper for se2ez::State.
Definition: cspacepanel.h:22
std::set< std::string > colliding_
Definition: jointpanel.h:82
A class that contains all information about the signed distance of a frame to another.
Definition: collision.h:75
A shared pointer wrapper for se2ez::TreeIK.
CollisionManager::SignedDistance minimum_
Definition: jointpanel.h:83
CollisionManager::SignedDistanceMap distances_
Definition: jointpanel.h:84
A shared pointer wrapper for se2ez::CollisionManager.
std::vector< JointWidget * > joints_
Definition: jointpanel.h:86
A shared pointer wrapper for se2ez::Robot.
Ui::JointPanel * ui_
Definition: jointpanel.h:74
The canvas widget. It contains all the drawing functions as well as all the general settings for draw...
Definition: renderarea.h:48
Main namespace.
Definition: collision.h:11
#define SE2EZ_CLASS_FORWARD(C)
Definition: class_forward.h:9