main_window.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2018 ROBOTIS CO., LTD.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
24 #ifndef manipulator_h_gui_MAIN_WINDOW_H
25 #define manipulator_h_gui_MAIN_WINDOW_H
26 
27 /*****************************************************************************
28 ** Includes
29 *****************************************************************************/
30 
31 #ifndef Q_MOC_RUN
32 
33 #include <ros/ros.h>
34 #include <QtGui/QMainWindow>
35 #include "ui_main_window.h"
36 #include "qnode.hpp"
37 
38 #endif
39 
40 /*****************************************************************************
41 ** Namespace
42 *****************************************************************************/
43 
44 namespace manipulator_h_gui {
45 
46 /*****************************************************************************
47 ** Interface [MainWindow]
48 *****************************************************************************/
52 class MainWindow : public QMainWindow {
53  Q_OBJECT
54 
55 public:
56  MainWindow(int argc, char** argv, QWidget *parent = 0);
57  ~MainWindow();
58 
59  void closeEvent(QCloseEvent *event); // Overloaded function
60 
61  /******************************************
62  ** Transformation
63  *******************************************/
64  Eigen::MatrixXd rotationX( double angle );
65  Eigen::MatrixXd rotationY( double angle );
66  Eigen::MatrixXd rotationZ( double angle );
67 
68  Eigen::MatrixXd rotation2rpy( Eigen::MatrixXd rotation );
69  Eigen::MatrixXd rpy2rotation( double roll, double pitch, double yaw );
70 
71  Eigen::Quaterniond rpy2quaternion( double roll, double pitch, double yaw );
72  Eigen::Quaterniond rotation2quaternion( Eigen::MatrixXd rotation );
73 
74  Eigen::MatrixXd quaternion2rpy( Eigen::Quaterniond quaternion );
75  Eigen::MatrixXd quaternion2rotation( Eigen::Quaterniond quaternion );
76 
77 public Q_SLOTS:
78  /******************************************
79  ** Auto-connections (connectSlotsByName())
80  *******************************************/
82 
84  void on_des_joint_button_clicked( bool check );
85 
86  void on_curr_pos_button_clicked( bool check );
87  void on_des_pos_button_clicked( bool check );
88 
89  void on_ini_pose_button_clicked( bool check );
90  void on_set_mode_button_clicked( bool check );
91 
92  /******************************************
93  ** Manual connections
94  *******************************************/
95  void updateLoggingView(); // no idea why this can't connect automatically
96 
97  void updateCurrJointPoseSpinbox( manipulator_h_base_module_msgs::JointPose msg );
98  void updateCurrKinematicsPoseSpinbox( manipulator_h_base_module_msgs::KinematicsPose msg );
99 
100 private:
101  Ui::MainWindowDesign ui;
103 
104  std::vector<std::string> joint_name;
105 
106  QList<QAbstractSpinBox *> joint_spinbox;
107 };
108 
109 } // namespace manipulator_h_gui
110 
111 #endif // manipulator_h_gui_MAIN_WINDOW_H
QList< QAbstractSpinBox * > joint_spinbox
Eigen::Quaterniond rotation2quaternion(Eigen::MatrixXd rotation)
ROSCPP_DECL bool check()
void on_curr_pos_button_clicked(bool check)
Eigen::MatrixXd rotation2rpy(Eigen::MatrixXd rotation)
Eigen::MatrixXd quaternion2rpy(Eigen::Quaterniond quaternion)
void closeEvent(QCloseEvent *event)
MainWindow(int argc, char **argv, QWidget *parent=0)
Definition: main_window.cpp:46
void on_des_pos_button_clicked(bool check)
void on_curr_joint_button_clicked(bool check)
Definition: main_window.cpp:99
Eigen::MatrixXd rotationX(double angle)
Qt central, all operations relating to the view part here.
Definition: main_window.hpp:52
Eigen::Quaterniond rpy2quaternion(double roll, double pitch, double yaw)
std::vector< std::string > joint_name
Ui::MainWindowDesign ui
Eigen::MatrixXd rotationZ(double angle)
void on_set_mode_button_clicked(bool check)
void updateCurrJointPoseSpinbox(manipulator_h_base_module_msgs::JointPose msg)
Eigen::MatrixXd quaternion2rotation(Eigen::Quaterniond quaternion)
void on_ini_pose_button_clicked(bool check)
void updateCurrKinematicsPoseSpinbox(manipulator_h_base_module_msgs::KinematicsPose msg)
Communications central!
void on_des_joint_button_clicked(bool check)
Eigen::MatrixXd rpy2rotation(double roll, double pitch, double yaw)
Eigen::MatrixXd rotationY(double angle)


manipulator_h_gui
Author(s): SCH
autogenerated on Mon Jun 10 2019 14:02:56