control_ui
jointform.h
Go to the documentation of this file.
1 #ifndef JOINTFORM_H
2 #define JOINTFORM_H
3 
4 #include <QWidget>
5 #include <base/JointLimitRange.hpp>
6 #include <urdf_model/model.h>
7 
8 #define SLIDER_POS_SCALE_FACTOR 100.
9 #define SLIDER_VEL_SCALE_FACTOR 100.
10 #define SLIDER_EFF_SCALE_FACTOR 100.
11 
12 namespace Ui {
13 class JointForm;
14 }
15 
16 class JointForm : public QWidget
17 {
18  Q_OBJECT
19 
20 public:
21  struct Config{
22  inline Config():
23  override_vel_limit(0), positive_vel_only(false),
24  no_effort(false), no_velocity(false), command_noise_std_dev(0.0){}
25 
28  bool no_effort;
31  };
32 
33  explicit JointForm(QWidget *parent = 0, Config=Config());
34  void initFromJointRange(const base::JointLimitRange& rng, std::string name);
35  void initFromJointLimits(const urdf::JointLimits& limits, std::string name);
36  base::JointState getJointState();
37  ~JointForm();
38 
39 public slots:
40  void setJointState(const base::JointState& state);
41  void activate(bool active);
42  void getJointState(base::JointState& state);
43  void setName(std::string name);
44  void handleValueChange();
45 
46 protected slots:
47  void handlePosSliderChange(int);
48  void handleVelSliderChange(int val);
49  void handleEffSliderChange(int val);
50 
51  void handlePosBoxChange(double val);
52  void handleVelBoxChange(double val);
53  void handleEffBoxChange(double val);
54  void setJointLimit(double min, double max);
55 
56 signals:
57  void valueChanged(std::string name, base::JointState state);
58 
59 private:
60  Ui::JointForm *ui;
61  Config config;
62 };
63 
64 #endif // JOINTFORM_H
Definition: jointform.h:21
bool no_velocity
Definition: jointform.h:29
bool positive_vel_only
Definition: jointform.h:27
Definition: jointform.h:12
double command_noise_std_dev
Definition: jointform.h:30
double override_vel_limit
Definition: jointform.h:26
Config()
Definition: jointform.h:22
bool no_effort
Definition: jointform.h:28
Definition: jointform.h:16