hpp-gui  4.14.0
Graphical interface for HPP
pathplayer.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) CNRS
3 // Author: Joseph Mirabel and Heidy Dallard
4 //
5 
6 #ifndef HPP_GUI_PATHPLAYER_HH
7 #define HPP_GUI_PATHPLAYER_HH
8 
9 #include <QWidget>
10 #include <gepetto/gui/fwd.hh>
11 
12 class QDoubleSpinBox;
13 class QProcess;
14 class QPushButton;
15 class QSpinBox;
16 class QSlider;
17 class QTextBrowser;
18 
19 namespace Ui {
20 class PathPlayerWidget;
21 }
22 
23 namespace hpp {
24 namespace gui {
25 class HppWidgetsPlugin;
26 
27 class PathPlayer : public QWidget {
28  Q_OBJECT
29 
30  public:
31  PathPlayer(HppWidgetsPlugin* plugin, QWidget* parent = 0);
32  ~PathPlayer();
33 
34  public slots:
36  int getCurrentPath() const;
37 
41  void displayWaypointsOfPath(const std::string jointName);
42 
46  void displayPath(const std::string jointName);
47 
49  void update();
50 
52  void setRobotVelocity(bool set);
53 
55  double lengthBetweenRefresh() const;
56 
58  void setCurrentTime(const double& param);
59 
60  protected:
64  virtual void displayPath_impl(const std::string jointName);
65  signals:
66  void displayPath_status(int progress);
67  void appliedConfigAtParam(int pid, double param);
68 
69  private slots:
70  void pathIndexChanged(int i);
71  void pathSliderChanged(int value);
72  // void timeChanged (double d);
73  void playPauseToggled(bool toggled);
74  void stopClicked();
75  void pathPulse();
76  void timerEvent(QTimerEvent* event);
77 
78  private:
79  void initSearchActions();
80  void updateConfiguration();
81  double sliderToLength(int v) const;
82  int lengthToSlider(double l) const;
83  double timeToLength(double time) const;
84  int timeBetweenRefresh() const;
85 
86  ::Ui::PathPlayerWidget* ui_;
87 
88  QDoubleSpinBox* timeSpinBox() const;
89  QSpinBox* pathIndex() const;
90  QSlider* pathSlider() const;
91  QPushButton* playPause() const;
92  QPushButton* stop() const;
93 
94  double pathLength_;
95  double currentParam_;
96  int timerId_;
97  bool velocity_;
98 
99  HppWidgetsPlugin* plugin_;
100 };
101 } // namespace gui
102 } // namespace hpp
103 
104 #endif // HPP_GUI_PATHPLAYER_HH
Definition: pathplayer.hh:27
namespace that encapsulate all the softwares of humanoid-path-planner
Definition: __init__.py:1
void setRobotVelocity(bool set)
Tells the path player to set the robot current velocity.
Definition: configurationlistwidget.hh:18
void appliedConfigAtParam(int pid, double param)
virtual void displayPath_impl(const std::string jointName)
int getCurrentPath() const
Returns the path currently selected.
void setCurrentTime(const double &param)
Set the slider position.
double lengthBetweenRefresh() const
Distance between two sampling point.
void displayPath_status(int progress)
PathPlayer(HppWidgetsPlugin *plugin, QWidget *parent=0)
void displayPath(const std::string jointName)
void update()
Get the number of paths in hpp and refresh the gui accordingly.
void displayWaypointsOfPath(const std::string jointName)
Plugin that add a lot of features to work with hpp.
Definition: hppwidgetsplugin.hh:30