00001 #ifndef JOYSTICK_H 00002 #define JOYSTICK_H 00003 00004 #include <QThread> 00005 #include <QWidget> 00006 #include "ArmWidget.h" 00007 #include "Ros.h" 00008 #include "WristWidget.h" 00009 00010 class Joystick : public QThread { 00011 00012 private: 00013 double normalizeAxis(int value);//normalize the joystick axis 00014 QWidget *p; 00015 bool driveEnabled; 00016 ArmWidget *arm; 00017 Ros *ros; 00018 WristWidget *wrist; 00019 00020 public: 00021 void run(); 00022 Joystick(QWidget *parent = 0); 00023 void JoystickAxisChange(double x, double y);//computes the new speed of the robot 00024 void DriveEnableChange(const int value);//if value is true, the robot can moves thanks to the joystick 00025 void setArmWidget(ArmWidget * arm_);//gives pointer to the arm widget 00026 void setRos(Ros * ros_);//gives pointer to the ros thread 00027 void setWristWidget(WristWidget *wrist_);//gives pointer to the wrist widget 00028 00029 }; 00030 00031 #endif // JOYSTICK_H