├── README.md ├── Qt_GUI ├── QtHelloWorld │ ├── main.o │ ├── QtHelloWorld │ ├── main.cpp │ └── QtHelloWorld.pro ├── QuickAppTest │ ├── QuickAppTest │ │ ├── qml.qrc │ │ ├── main.cpp │ │ ├── QuickAppTest.pro │ │ ├── deployment.pri │ │ ├── main.qml │ │ └── .gitignore │ └── build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug │ │ ├── main.o │ │ ├── qrc_qml.o │ │ ├── QuickAppTest │ │ └── qrc_qml.cpp └── QtWidgetsTest │ ├── build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug │ ├── main.o │ ├── QtWidgetsTest │ ├── mainwindow.o │ ├── moc_mainwindow.o │ ├── ui_mainwindow.h │ └── moc_mainwindow.cpp │ └── QtWidgetsTest │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── QtWidgetsTest.pro │ ├── mainwindow.ui │ └── QtWidgetsTest.pro.user ├── QtROS_GUI ├── Tutorial_updated.pdf ├── button_test │ ├── resources │ │ ├── images.qrc │ │ └── images │ │ │ └── icon.png │ ├── mainpage.dox │ ├── package.xml │ ├── src │ │ ├── main.cpp │ │ ├── qnode.cpp │ │ └── main_window.cpp │ ├── include │ │ └── button_test │ │ │ ├── qnode.hpp │ │ │ └── main_window.hpp │ ├── CMakeLists.txt │ ├── CMakeLists.txt.user.3.2-pre1 │ ├── ui │ │ └── main_window.ui │ └── CMakeLists.txt.user ├── my_qt_gui_publisher │ ├── resources │ │ ├── images.qrc │ │ └── images │ │ │ └── icon.png │ ├── mainpage.dox │ ├── package.xml │ ├── src │ │ ├── main.cpp │ │ ├── qnode.cpp │ │ └── main_window.cpp │ ├── include │ │ └── my_qt_gui_publisher │ │ │ ├── qnode.hpp │ │ │ └── main_window.hpp │ ├── CMakeLists.txt │ ├── ui │ │ └── main_window.ui │ └── CMakeLists.txt.user └── my_qt_gui_subscriber │ ├── resources │ ├── images.qrc │ └── images │ │ └── icon.png │ ├── src │ ├── src.pro │ ├── main.cpp │ ├── qnode.cpp │ └── main_window.cpp │ ├── mainpage.dox │ ├── package.xml │ ├── package.xml~ │ ├── include │ └── my_qt_gui_subscriber │ │ ├── qnode.hpp │ │ └── main_window.hpp │ ├── CMakeLists.txt │ ├── CMakeLists.txt~ │ ├── ui │ └── main_window.ui │ └── CMakeLists.txt.user ├── .catkin_workspace └── developping_log.md /README.md: -------------------------------------------------------------------------------- 1 | # ROSCppGUI 2 | 3 | This is to find a way to establish a Graphic User Interface for ROS. 4 | -------------------------------------------------------------------------------- /Qt_GUI/QtHelloWorld/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtHelloWorld/main.o -------------------------------------------------------------------------------- /QtROS_GUI/Tutorial_updated.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/QtROS_GUI/Tutorial_updated.pdf -------------------------------------------------------------------------------- /Qt_GUI/QtHelloWorld/QtHelloWorld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtHelloWorld/QtHelloWorld -------------------------------------------------------------------------------- /.catkin_workspace: -------------------------------------------------------------------------------- 1 | # This file currently only serves to mark the location of a catkin workspace for tool integration 2 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/icon.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/resources/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/QtROS_GUI/button_test/resources/images/icon.png -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/icon.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/resources/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/QtROS_GUI/my_qt_gui_publisher/resources/images/icon.png -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/icon.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/resources/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/QtROS_GUI/my_qt_gui_subscriber/resources/images/icon.png -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/main.o -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/main.o -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/qrc_qml.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/qrc_qml.o -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/QuickAppTest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/QuickAppTest -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/QtWidgetsTest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/QtWidgetsTest -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/mainwindow.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/mainwindow.o -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/moc_mainwindow.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xpharry/ros-qt-gui/HEAD/Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/moc_mainwindow.o -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QGuiApplication app(argc, argv); 7 | 8 | QQmlApplicationEngine engine; 9 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 10 | 11 | return app.exec(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/QuickAppTest.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick 4 | CONFIG += c++11 5 | 6 | SOURCES += main.cpp 7 | 8 | RESOURCES += qml.qrc 9 | 10 | # Additional import path used to resolve QML modules in Qt Creator's code model 11 | QML_IMPORT_PATH = 12 | 13 | # Default rules for deployment. 14 | include(deployment.pri) 15 | 16 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/deployment.pri: -------------------------------------------------------------------------------- 1 | unix:!android { 2 | isEmpty(target.path) { 3 | qnx { 4 | target.path = /tmp/$${TARGET}/bin 5 | } else { 6 | target.path = /opt/$${TARGET}/bin 7 | } 8 | export(target.path) 9 | } 10 | INSTALLS += target 11 | } 12 | 13 | export(INSTALLS) 14 | 15 | -------------------------------------------------------------------------------- /Qt_GUI/QtHelloWorld/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main(int argc, char *argv[ ]) 5 | { 6 | QApplication app(argc, argv); 7 | QLabel hello("
Welcome to my first WikiHow Qt program
"); 8 | hello.setWindowTitle("My First WikiHow Qt Program"); 9 | hello.resize(400, 400); 10 | hello.show(); 11 | return app.exec(); 12 | } -------------------------------------------------------------------------------- /Qt_GUI/QtHelloWorld/QtHelloWorld.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (3.0) Mon Nov 23 12:11:07 2015 3 | ###################################################################### 4 | 5 | TEMPLATE = app 6 | TARGET = QtHelloWorld 7 | QT += core gui 8 | QT += widgets 9 | INCLUDEPATH += . 10 | 11 | # Input 12 | SOURCES += main.cpp 13 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/src/src.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (3.0) Tue Dec 8 02:33:38 2015 3 | ###################################################################### 4 | 5 | TEMPLATE = app 6 | TARGET = src 7 | QT += core gui 8 | QT += widgets 9 | INCLUDEPATH += . 10 | 11 | # Input 12 | SOURCES += main.cpp main_window.cpp qnode.cpp 13 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MainWindow(QWidget *parent = 0); 16 | ~MainWindow(); 17 | 18 | private: 19 | Ui::MainWindow *ui; 20 | }; 21 | 22 | #endif // MAINWINDOW_H 23 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/QtWidgetsTest.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-11-23T14:01:44 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = QtWidgetsTest 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | mainwindow.cpp 17 | 18 | HEADERS += mainwindow.h 19 | 20 | FORMS += mainwindow.ui 21 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.3 2 | import QtQuick.Window 2.2 3 | 4 | Window { 5 | visible: true 6 | 7 | width: 640 8 | height: 480 9 | 10 | MouseArea { 11 | anchors.fill: parent 12 | onClicked: { 13 | Qt.quit(); 14 | } 15 | 16 | Item { 17 | x: 227 18 | y: 262 19 | width: 200 20 | height: 200 21 | } 22 | } 23 | 24 | Text { 25 | text: qsTr("Hello World") 26 | anchors.centerIn: parent 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | \b button_test is ... 6 | 7 | 10 | 11 | 12 | \section codeapi Code API 13 | 14 | 24 | 25 | 26 | */ 27 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | \b my_qt_gui_publisher is ... 6 | 7 | 10 | 11 | 12 | \section codeapi Code API 13 | 14 | 24 | 25 | 26 | */ 27 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | \b my_qt_gui_subscriber is ... 6 | 7 | 10 | 11 | 12 | \section codeapi Code API 13 | 14 | 24 | 25 | 26 | */ 27 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | button_test 4 | 0.1.0 5 | 6 | 7 | button_test 8 | 9 | 10 | peng 11 | peng 12 | BSD 13 | 14 | 15 | 16 | catkin 17 | qt_build 18 | roscpp 19 | libqt4-dev 20 | qt_build 21 | roscpp 22 | libqt4-dev 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | my_qt_gui_publisher 4 | 0.1.0 5 | 6 | 7 | my_qt_gui_publisher 8 | 9 | 10 | peng 11 | peng 12 | BSD 13 | 14 | 15 | 16 | catkin 17 | qt_build 18 | roscpp 19 | libqt4-dev 20 | qt_build 21 | roscpp 22 | libqt4-dev 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | my_qt_gui_subscriber 4 | 0.1.0 5 | 6 | 7 | my_qt_gui_subscriber 8 | 9 | 10 | peng 11 | peng 12 | BSD 13 | 14 | 15 | 16 | catkin 17 | qt_build 18 | roscpp 19 | 20 | libqt4-dev 21 | qt_build 22 | roscpp 23 | libqt4-dev 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/package.xml~: -------------------------------------------------------------------------------- 1 | 2 | 3 | my_qt_gui_subscriber 4 | 0.1.0 5 | 6 | 7 | my_qt_gui_subscriber 8 | 9 | 10 | peng 11 | peng 12 | BSD 13 | 14 | 15 | 16 | catkin 17 | qt_build 18 | roscpp 19 | std_msgs 20 | libqt4-dev 21 | qt_build 22 | roscpp 23 | libqt4-dev 24 | std_msgs 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main.cpp 3 | * 4 | * @brief Qt based gui. 5 | * 6 | * @date November 2010 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include "../include/button_test/main_window.hpp" 15 | 16 | /***************************************************************************** 17 | ** Main 18 | *****************************************************************************/ 19 | 20 | int main(int argc, char **argv) { 21 | 22 | /********************* 23 | ** Qt 24 | **********************/ 25 | QApplication app(argc, argv); 26 | button_test::MainWindow w(argc,argv); 27 | w.show(); 28 | app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); 29 | int result = app.exec(); 30 | 31 | return result; 32 | } 33 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main.cpp 3 | * 4 | * @brief Qt based gui. 5 | * 6 | * @date November 2010 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include "../include/my_qt_gui_publisher/main_window.hpp" 15 | 16 | /***************************************************************************** 17 | ** Main 18 | *****************************************************************************/ 19 | 20 | int main(int argc, char **argv) { 21 | 22 | /********************* 23 | ** Qt 24 | **********************/ 25 | QApplication app(argc, argv); 26 | my_qt_gui_publisher::MainWindow w(argc,argv); 27 | w.show(); 28 | app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); 29 | int result = app.exec(); 30 | 31 | return result; 32 | } 33 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main.cpp 3 | * 4 | * @brief Qt based gui. 5 | * 6 | * @date November 2010 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include "../include/my_qt_gui_subscriber/main_window.hpp" 15 | 16 | /***************************************************************************** 17 | ** Main 18 | *****************************************************************************/ 19 | 20 | int main(int argc, char **argv) { 21 | 22 | /********************* 23 | ** Qt 24 | **********************/ 25 | QApplication app(argc, argv); 26 | my_qt_gui_subscriber::MainWindow w(argc,argv); 27 | w.show(); 28 | app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); 29 | int result = app.exec(); 30 | 31 | return result; 32 | } 33 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/QuickAppTest/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | *.debug 25 | Makefile* 26 | *.prl 27 | *.app 28 | moc_*.cpp 29 | ui_*.h 30 | qrc_*.cpp 31 | Thumbs.db 32 | *.res 33 | *.rc 34 | /.qmake.cache 35 | /.qmake.stash 36 | 37 | # qtcreator generated files 38 | *.pro.user* 39 | 40 | # xemacs temporary files 41 | *.flc 42 | 43 | # Vim temporary files 44 | .*.swp 45 | 46 | # Visual Studio generated files 47 | *.ib_pdb_index 48 | *.idb 49 | *.ilk 50 | *.pdb 51 | *.sln 52 | *.suo 53 | *.vcproj 54 | *vcproj.*.*.user 55 | *.ncb 56 | *.sdf 57 | *.opensdf 58 | *.vcxproj 59 | *vcxproj.* 60 | 61 | # MinGW generated files 62 | *.Debug 63 | *.Release 64 | 65 | # Python byte code 66 | *.pyc 67 | 68 | # Binaries 69 | # -------- 70 | *.dll 71 | *.exe 72 | 73 | 74 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | TopToolBarArea 20 | 21 | 22 | false 23 | 24 | 25 | 26 | 27 | 28 | 29 | 0 30 | 0 31 | 400 32 | 25 33 | 34 | 35 | 36 | 37 | Baxter Commander 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/include/button_test/qnode.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/button_test/qnode.hpp 3 | * 4 | * @brief Communications central! 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Ifdefs 10 | *****************************************************************************/ 11 | 12 | #ifndef button_test_QNODE_HPP_ 13 | #define button_test_QNODE_HPP_ 14 | 15 | /***************************************************************************** 16 | ** Includes 17 | *****************************************************************************/ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | /***************************************************************************** 26 | ** Namespaces 27 | *****************************************************************************/ 28 | 29 | namespace button_test { 30 | 31 | /***************************************************************************** 32 | ** Class 33 | *****************************************************************************/ 34 | 35 | class QNode : public QThread { 36 | Q_OBJECT 37 | public: 38 | QNode(int argc, char** argv ); 39 | virtual ~QNode(); 40 | bool init(); 41 | bool init(const std::string &master_url, const std::string &host_url); 42 | void run(); 43 | 44 | /********************* 45 | ** Logging 46 | **********************/ 47 | enum LogLevel { 48 | Debug, 49 | Info, 50 | Warn, 51 | Error, 52 | Fatal 53 | }; 54 | 55 | QStringListModel* loggingModel() { return &logging_model; } 56 | void log( const LogLevel &level, const std::string &msg); 57 | 58 | Q_SIGNALS: 59 | void loggingUpdated(); 60 | void rosShutdown(); 61 | 62 | private: 63 | int init_argc; 64 | char** init_argv; 65 | ros::Publisher chatter_publisher; 66 | QStringListModel logging_model; 67 | }; 68 | 69 | } // namespace button_test 70 | 71 | #endif /* button_test_QNODE_HPP_ */ 72 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/include/my_qt_gui_publisher/qnode.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/my_qt_gui_publisher/qnode.hpp 3 | * 4 | * @brief Communications central! 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Ifdefs 10 | *****************************************************************************/ 11 | 12 | #ifndef my_qt_gui_publisher_QNODE_HPP_ 13 | #define my_qt_gui_publisher_QNODE_HPP_ 14 | 15 | /***************************************************************************** 16 | ** Includes 17 | *****************************************************************************/ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | /***************************************************************************** 26 | ** Namespaces 27 | *****************************************************************************/ 28 | 29 | namespace my_qt_gui_publisher { 30 | 31 | /***************************************************************************** 32 | ** Class 33 | *****************************************************************************/ 34 | 35 | class QNode : public QThread { 36 | Q_OBJECT 37 | public: 38 | QNode(int argc, char** argv ); 39 | virtual ~QNode(); 40 | bool init(); 41 | bool init(const std::string &master_url, const std::string &host_url); 42 | void run(); 43 | 44 | /********************* 45 | ** Logging 46 | **********************/ 47 | enum LogLevel { 48 | Debug, 49 | Info, 50 | Warn, 51 | Error, 52 | Fatal 53 | }; 54 | 55 | QStringListModel* loggingModel() { return &logging_model; } 56 | void log( const LogLevel &level, const std::string &msg); 57 | 58 | Q_SIGNALS: 59 | void loggingUpdated(); 60 | void rosShutdown(); 61 | 62 | private: 63 | int init_argc; 64 | char** init_argv; 65 | ros::Publisher chatter_publisher; 66 | QStringListModel logging_model; 67 | }; 68 | 69 | } // namespace my_qt_gui_publisher 70 | 71 | #endif /* my_qt_gui_publisher_QNODE_HPP_ */ 72 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/include/my_qt_gui_subscriber/qnode.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/my_qt_gui_subscriber/qnode.hpp 3 | * 4 | * @brief Communications central! 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Ifdefs 10 | *****************************************************************************/ 11 | 12 | #ifndef my_qt_gui_subscriber_QNODE_HPP_ 13 | #define my_qt_gui_subscriber_QNODE_HPP_ 14 | 15 | /***************************************************************************** 16 | ** Includes 17 | *****************************************************************************/ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | /***************************************************************************** 27 | ** Namespaces 28 | *****************************************************************************/ 29 | 30 | namespace my_qt_gui_subscriber { 31 | 32 | /***************************************************************************** 33 | ** Class 34 | *****************************************************************************/ 35 | 36 | class QNode : public QThread { 37 | Q_OBJECT 38 | public: 39 | QNode(int argc, char** argv ); 40 | virtual ~QNode(); 41 | bool init(); 42 | bool init(const std::string &master_url, const std::string &host_url); 43 | void run(); 44 | void myCallback(const std_msgs::Float64& message_holder); 45 | 46 | /********************* 47 | ** Logging 48 | **********************/ 49 | enum LogLevel { 50 | Debug, 51 | Info, 52 | Warn, 53 | Error, 54 | Fatal 55 | }; 56 | 57 | QStringListModel* loggingModel() { return &logging_model; } 58 | void log( const LogLevel &level, const std_msgs::Float64 &msg); 59 | 60 | Q_SIGNALS: 61 | void loggingUpdated(); 62 | void rosShutdown(); 63 | 64 | private: 65 | int init_argc; 66 | char** init_argv; 67 | ros::Subscriber chatter_subscriber; 68 | QStringListModel logging_model; 69 | }; 70 | 71 | } // namespace my_qt_gui_subscriber 72 | 73 | #endif /* my_qt_gui_subscriber_QNODE_HPP_ */ 74 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/include/my_qt_gui_publisher/main_window.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/my_qt_gui_publisher/main_window.hpp 3 | * 4 | * @brief Qt based gui for my_qt_gui_publisher. 5 | * 6 | * @date November 2010 7 | **/ 8 | #ifndef my_qt_gui_publisher_MAIN_WINDOW_H 9 | #define my_qt_gui_publisher_MAIN_WINDOW_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | 15 | #include 16 | #include "ui_main_window.h" 17 | #include "qnode.hpp" 18 | 19 | /***************************************************************************** 20 | ** Namespace 21 | *****************************************************************************/ 22 | 23 | namespace my_qt_gui_publisher { 24 | 25 | /***************************************************************************** 26 | ** Interface [MainWindow] 27 | *****************************************************************************/ 28 | /** 29 | * @brief Qt central, all operations relating to the view part here. 30 | */ 31 | class MainWindow : public QMainWindow { 32 | Q_OBJECT 33 | 34 | public: 35 | MainWindow(int argc, char** argv, QWidget *parent = 0); 36 | ~MainWindow(); 37 | 38 | void ReadSettings(); // Load up qt program settings at startup 39 | void WriteSettings(); // Save qt program settings when closing 40 | 41 | void closeEvent(QCloseEvent *event); // Overloaded function 42 | void showNoMasterMessage(); 43 | 44 | public Q_SLOTS: 45 | /****************************************** 46 | ** Auto-connections (connectSlotsByName()) 47 | *******************************************/ 48 | void on_actionAbout_triggered(); 49 | void on_button_connect_clicked(bool check ); 50 | void on_checkbox_use_environment_stateChanged(int state); 51 | 52 | /****************************************** 53 | ** Manual connections 54 | *******************************************/ 55 | void updateLoggingView(); // no idea why this can't connect automatically 56 | 57 | private: 58 | Ui::MainWindowDesign ui; 59 | QNode qnode; 60 | }; 61 | 62 | } // namespace my_qt_gui_publisher 63 | 64 | #endif // my_qt_gui_publisher_MAIN_WINDOW_H 65 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/include/my_qt_gui_subscriber/main_window.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/my_qt_gui_subscriber/main_window.hpp 3 | * 4 | * @brief Qt based gui for my_qt_gui_subscriber. 5 | * 6 | * @date November 2010 7 | **/ 8 | #ifndef my_qt_gui_subscriber_MAIN_WINDOW_H 9 | #define my_qt_gui_subscriber_MAIN_WINDOW_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | 15 | #include 16 | #include "ui_main_window.h" 17 | #include "qnode.hpp" 18 | 19 | /***************************************************************************** 20 | ** Namespace 21 | *****************************************************************************/ 22 | 23 | namespace my_qt_gui_subscriber { 24 | 25 | /***************************************************************************** 26 | ** Interface [MainWindow] 27 | *****************************************************************************/ 28 | /** 29 | * @brief Qt central, all operations relating to the view part here. 30 | */ 31 | class MainWindow : public QMainWindow { 32 | Q_OBJECT 33 | 34 | public: 35 | MainWindow(int argc, char** argv, QWidget *parent = 0); 36 | ~MainWindow(); 37 | 38 | void ReadSettings(); // Load up qt program settings at startup 39 | void WriteSettings(); // Save qt program settings when closing 40 | 41 | void closeEvent(QCloseEvent *event); // Overloaded function 42 | void showNoMasterMessage(); 43 | 44 | public Q_SLOTS: 45 | /****************************************** 46 | ** Auto-connections (connectSlotsByName()) 47 | *******************************************/ 48 | void on_actionAbout_triggered(); 49 | void on_button_connect_clicked(bool check ); 50 | void on_checkbox_use_environment_stateChanged(int state); 51 | 52 | /****************************************** 53 | ** Manual connections 54 | *******************************************/ 55 | void updateLoggingView(); // no idea why this can't connect automatically 56 | 57 | private: 58 | Ui::MainWindowDesign ui; 59 | QNode qnode; 60 | }; 61 | 62 | } // namespace my_qt_gui_subscriber 63 | 64 | #endif // my_qt_gui_subscriber_MAIN_WINDOW_H 65 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/include/button_test/main_window.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/button_test/main_window.hpp 3 | * 4 | * @brief Qt based gui for button_test. 5 | * 6 | * @date November 2010 7 | **/ 8 | #ifndef button_test_MAIN_WINDOW_H 9 | #define button_test_MAIN_WINDOW_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include "ui_main_window.h" 19 | #include "qnode.hpp" 20 | 21 | /***************************************************************************** 22 | ** Namespace 23 | *****************************************************************************/ 24 | 25 | namespace button_test { 26 | 27 | /***************************************************************************** 28 | ** Interface [MainWindow] 29 | *****************************************************************************/ 30 | /** 31 | * @brief Qt central, all operations relating to the view part here. 32 | */ 33 | class MainWindow : public QMainWindow { 34 | Q_OBJECT 35 | 36 | public: 37 | MainWindow(int argc, char** argv, QWidget *parent = 0); 38 | ~MainWindow(); 39 | 40 | void ReadSettings(); // Load up qt program settings at startup 41 | void WriteSettings(); // Save qt program settings when closing 42 | 43 | void closeEvent(QCloseEvent *event); // Overloaded function 44 | void showNoMasterMessage(); 45 | void showButtonTestMessage(); 46 | 47 | public Q_SLOTS: 48 | /****************************************** 49 | ** Auto-connections (connectSlotsByName()) 50 | *******************************************/ 51 | void on_actionAbout_triggered(); 52 | void on_button_connect_clicked(bool check); 53 | void on_button_test_clicked(bool check); 54 | void on_checkbox_use_environment_stateChanged(int state); 55 | 56 | /****************************************** 57 | ** Manual connections 58 | *******************************************/ 59 | void updateLoggingView(); // no idea why this can't connect automatically 60 | void moveLeft(); 61 | // void moveRight(); 62 | 63 | private: 64 | Ui::MainWindowDesign ui; 65 | QNode qnode; 66 | QStringListModel* logging_model; 67 | }; 68 | 69 | } // namespace button_test 70 | 71 | #endif // button_test_MAIN_WINDOW_H 72 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/ui_mainwindow.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'mainwindow.ui' 3 | ** 4 | ** Created by: Qt User Interface Compiler version 5.5.1 5 | ** 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 7 | ********************************************************************************/ 8 | 9 | #ifndef UI_MAINWINDOW_H 10 | #define UI_MAINWINDOW_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | QT_BEGIN_NAMESPACE 24 | 25 | class Ui_MainWindow 26 | { 27 | public: 28 | QMenuBar *menuBar; 29 | QToolBar *mainToolBar; 30 | QWidget *centralWidget; 31 | QStatusBar *statusBar; 32 | 33 | void setupUi(QMainWindow *MainWindow) 34 | { 35 | if (MainWindow->objectName().isEmpty()) 36 | MainWindow->setObjectName(QStringLiteral("MainWindow")); 37 | MainWindow->resize(400, 300); 38 | menuBar = new QMenuBar(MainWindow); 39 | menuBar->setObjectName(QStringLiteral("menuBar")); 40 | MainWindow->setMenuBar(menuBar); 41 | mainToolBar = new QToolBar(MainWindow); 42 | mainToolBar->setObjectName(QStringLiteral("mainToolBar")); 43 | MainWindow->addToolBar(mainToolBar); 44 | centralWidget = new QWidget(MainWindow); 45 | centralWidget->setObjectName(QStringLiteral("centralWidget")); 46 | MainWindow->setCentralWidget(centralWidget); 47 | statusBar = new QStatusBar(MainWindow); 48 | statusBar->setObjectName(QStringLiteral("statusBar")); 49 | MainWindow->setStatusBar(statusBar); 50 | 51 | retranslateUi(MainWindow); 52 | 53 | QMetaObject::connectSlotsByName(MainWindow); 54 | } // setupUi 55 | 56 | void retranslateUi(QMainWindow *MainWindow) 57 | { 58 | MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0)); 59 | } // retranslateUi 60 | 61 | }; 62 | 63 | namespace Ui { 64 | class MainWindow: public Ui_MainWindow {}; 65 | } // namespace Ui 66 | 67 | QT_END_NAMESPACE 68 | 69 | #endif // UI_MAINWINDOW_H 70 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.0) 6 | project(button_test) 7 | 8 | ############################################################################## 9 | # Catkin 10 | ############################################################################## 11 | 12 | # qt_build provides the qt cmake glue, roscpp the comms for a default talker 13 | find_package(catkin REQUIRED COMPONENTS qt_build roscpp) 14 | include_directories(${catkin_INCLUDE_DIRS}) 15 | # Use this to define what the package will export (e.g. libs, headers). 16 | # Since the default here is to produce only a binary, we don't worry about 17 | # exporting anything. 18 | catkin_package() 19 | 20 | ############################################################################## 21 | # Qt Environment 22 | ############################################################################## 23 | 24 | # this comes from qt_build's qt-ros.cmake which is automatically 25 | # included via the dependency call in package.xml 26 | rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here 27 | 28 | ############################################################################## 29 | # Sections 30 | ############################################################################## 31 | 32 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 33 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 34 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/button_test/*.hpp) 35 | 36 | QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 37 | QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS}) 38 | QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}) 39 | 40 | ############################################################################## 41 | # Sources 42 | ############################################################################## 43 | 44 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 45 | 46 | ############################################################################## 47 | # Binaries 48 | ############################################################################## 49 | 50 | add_executable(button_test ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) 51 | target_link_libraries(button_test ${QT_LIBRARIES} ${catkin_LIBRARIES}) 52 | install(TARGETS button_test RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 53 | 54 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.0) 6 | project(my_qt_gui_publisher) 7 | 8 | ############################################################################## 9 | # Catkin 10 | ############################################################################## 11 | 12 | # qt_build provides the qt cmake glue, roscpp the comms for a default talker 13 | find_package(catkin REQUIRED COMPONENTS qt_build roscpp) 14 | include_directories(${catkin_INCLUDE_DIRS}) 15 | # Use this to define what the package will export (e.g. libs, headers). 16 | # Since the default here is to produce only a binary, we don't worry about 17 | # exporting anything. 18 | catkin_package() 19 | 20 | ############################################################################## 21 | # Qt Environment 22 | ############################################################################## 23 | 24 | # this comes from qt_build's qt-ros.cmake which is automatically 25 | # included via the dependency call in package.xml 26 | rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here 27 | 28 | ############################################################################## 29 | # Sections 30 | ############################################################################## 31 | 32 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 33 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 34 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/my_qt_gui_publisher/*.hpp) 35 | 36 | QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 37 | QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS}) 38 | QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}) 39 | 40 | ############################################################################## 41 | # Sources 42 | ############################################################################## 43 | 44 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 45 | 46 | ############################################################################## 47 | # Binaries 48 | ############################################################################## 49 | 50 | add_executable(my_qt_gui_publisher ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) 51 | target_link_libraries(my_qt_gui_publisher ${QT_LIBRARIES} ${catkin_LIBRARIES}) 52 | install(TARGETS my_qt_gui_publisher RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 53 | 54 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.0) 6 | project(my_qt_gui_subscriber) 7 | 8 | ############################################################################## 9 | # Catkin 10 | ############################################################################## 11 | 12 | # qt_build provides the qt cmake glue, roscpp the comms for a default talker 13 | find_package(catkin REQUIRED COMPONENTS qt_build roscpp) 14 | include_directories(${catkin_INCLUDE_DIRS}) 15 | # Use this to define what the package will export (e.g. libs, headers). 16 | # Since the default here is to produce only a binary, we don't worry about 17 | # exporting anything. 18 | catkin_package() 19 | 20 | ############################################################################## 21 | # Qt Environment 22 | ############################################################################## 23 | 24 | # this comes from qt_build's qt-ros.cmake which is automatically 25 | # included via the dependency call in package.xml 26 | rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here 27 | 28 | ############################################################################## 29 | # Sections 30 | ############################################################################## 31 | 32 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 33 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 34 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/my_qt_gui_subscriber/*.hpp) 35 | 36 | QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 37 | QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS}) 38 | QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}) 39 | 40 | ############################################################################## 41 | # Sources 42 | ############################################################################## 43 | 44 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 45 | 46 | ############################################################################## 47 | # Binaries 48 | ############################################################################## 49 | 50 | add_executable(my_qt_gui_subscriber ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) 51 | target_link_libraries(my_qt_gui_subscriber ${QT_LIBRARIES} ${catkin_LIBRARIES}) 52 | install(TARGETS my_qt_gui_subscriber RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 53 | 54 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/CMakeLists.txt~: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.0) 6 | project(my_qt_gui_subscriber) 7 | 8 | ############################################################################## 9 | # Catkin 10 | ############################################################################## 11 | 12 | # qt_build provides the qt cmake glue, roscpp the comms for a default talker 13 | find_package(catkin REQUIRED COMPONENTS qt_build roscpp std_msgs) 14 | include_directories(${catkin_INCLUDE_DIRS}) 15 | # Use this to define what the package will export (e.g. libs, headers). 16 | # Since the default here is to produce only a binary, we don't worry about 17 | # exporting anything. 18 | catkin_package() 19 | 20 | ############################################################################## 21 | # Qt Environment 22 | ############################################################################## 23 | 24 | # this comes from qt_build's qt-ros.cmake which is automatically 25 | # included via the dependency call in package.xml 26 | rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here 27 | 28 | ############################################################################## 29 | # Sections 30 | ############################################################################## 31 | 32 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 33 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 34 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/my_qt_gui_subscriber/*.hpp) 35 | 36 | QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 37 | QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS}) 38 | QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}) 39 | 40 | ############################################################################## 41 | # Sources 42 | ############################################################################## 43 | 44 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 45 | 46 | ############################################################################## 47 | # Binaries 48 | ############################################################################## 49 | 50 | add_executable(my_qt_gui_subscriber ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) 51 | target_link_libraries(my_qt_gui_subscriber ${QT_LIBRARIES} ${catkin_LIBRARIES}) 52 | install(TARGETS my_qt_gui_subscriber RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 53 | 54 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/moc_mainwindow.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'mainwindow.h' 3 | ** 4 | ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.5.1) 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | #include "../QtWidgetsTest/mainwindow.h" 10 | #include 11 | #include 12 | #if !defined(Q_MOC_OUTPUT_REVISION) 13 | #error "The header file 'mainwindow.h' doesn't include ." 14 | #elif Q_MOC_OUTPUT_REVISION != 67 15 | #error "This file was generated using the moc from 5.5.1. It" 16 | #error "cannot be used with the include files from this version of Qt." 17 | #error "(The moc has changed too much.)" 18 | #endif 19 | 20 | QT_BEGIN_MOC_NAMESPACE 21 | struct qt_meta_stringdata_MainWindow_t { 22 | QByteArrayData data[1]; 23 | char stringdata0[11]; 24 | }; 25 | #define QT_MOC_LITERAL(idx, ofs, len) \ 26 | Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ 27 | qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \ 28 | - idx * sizeof(QByteArrayData)) \ 29 | ) 30 | static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = { 31 | { 32 | QT_MOC_LITERAL(0, 0, 10) // "MainWindow" 33 | 34 | }, 35 | "MainWindow" 36 | }; 37 | #undef QT_MOC_LITERAL 38 | 39 | static const uint qt_meta_data_MainWindow[] = { 40 | 41 | // content: 42 | 7, // revision 43 | 0, // classname 44 | 0, 0, // classinfo 45 | 0, 0, // methods 46 | 0, 0, // properties 47 | 0, 0, // enums/sets 48 | 0, 0, // constructors 49 | 0, // flags 50 | 0, // signalCount 51 | 52 | 0 // eod 53 | }; 54 | 55 | void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) 56 | { 57 | Q_UNUSED(_o); 58 | Q_UNUSED(_id); 59 | Q_UNUSED(_c); 60 | Q_UNUSED(_a); 61 | } 62 | 63 | const QMetaObject MainWindow::staticMetaObject = { 64 | { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data, 65 | qt_meta_data_MainWindow, qt_static_metacall, Q_NULLPTR, Q_NULLPTR} 66 | }; 67 | 68 | 69 | const QMetaObject *MainWindow::metaObject() const 70 | { 71 | return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; 72 | } 73 | 74 | void *MainWindow::qt_metacast(const char *_clname) 75 | { 76 | if (!_clname) return Q_NULLPTR; 77 | if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0)) 78 | return static_cast(const_cast< MainWindow*>(this)); 79 | return QMainWindow::qt_metacast(_clname); 80 | } 81 | 82 | int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 83 | { 84 | _id = QMainWindow::qt_metacall(_c, _id, _a); 85 | if (_id < 0) 86 | return _id; 87 | return _id; 88 | } 89 | QT_END_MOC_NAMESPACE 90 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/src/qnode.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/qnode.cpp 3 | * 4 | * @brief Ros communication central! 5 | * 6 | * @date February 2011 7 | **/ 8 | 9 | /***************************************************************************** 10 | ** Includes 11 | *****************************************************************************/ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "../include/my_qt_gui_subscriber/qnode.hpp" 19 | 20 | using namespace std; 21 | 22 | /***************************************************************************** 23 | ** Namespaces 24 | *****************************************************************************/ 25 | 26 | namespace my_qt_gui_subscriber { 27 | 28 | /***************************************************************************** 29 | ** Implementation 30 | *****************************************************************************/ 31 | 32 | QNode::QNode(int argc, char** argv ) : 33 | init_argc(argc), 34 | init_argv(argv) 35 | {} 36 | 37 | QNode::~QNode() { 38 | if(ros::isStarted()) { 39 | ros::shutdown(); // explicitly needed since we use ros::start(); 40 | ros::waitForShutdown(); 41 | } 42 | wait(); 43 | } 44 | 45 | bool QNode::init() { 46 | ros::init(init_argc,init_argv,"my_qt_gui_subscriber"); 47 | if ( ! ros::master::check() ) { 48 | return false; 49 | } 50 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 51 | ros::NodeHandle n; 52 | // Add your ros communications here. 53 | chatter_subscriber = n.subscribe("chatter", 1000, &QNode::myCallback, this); 54 | start(); 55 | return true; 56 | } 57 | 58 | bool QNode::init(const std::string &master_url, const std::string &host_url) { 59 | std::map remappings; 60 | remappings["__master"] = master_url; 61 | remappings["__hostname"] = host_url; 62 | ros::init(remappings,"my_qt_gui_subscriber"); 63 | if ( ! ros::master::check() ) { 64 | return false; 65 | } 66 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 67 | ros::NodeHandle n; 68 | // Add your ros communications here. 69 | chatter_subscriber = n.subscribe("chatter", 1000, &QNode::myCallback, this); 70 | start(); 71 | return true; 72 | } 73 | 74 | void QNode::run() { 75 | ros::NodeHandle n; 76 | chatter_subscriber = n.subscribe("chatter", 1000, &QNode::myCallback, this); 77 | ros::spin(); 78 | 79 | std::cout << "Ros shutdown, proceeding to close the gui." << std::endl; 80 | Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch) 81 | } 82 | 83 | 84 | void QNode::myCallback(const std_msgs::Float64& message_holder) 85 | { 86 | //std::stringstream ss; 87 | //ss << message_holder.data; 88 | log(Info, message_holder); 89 | ROS_INFO("=============received value is: %f===========",message_holder.data); 90 | //really could do something interesting here with the received data...but all we do is print it 91 | } 92 | 93 | 94 | void QNode::log( const LogLevel &level, const std_msgs::Float64 &msg) { 95 | logging_model.insertRows(logging_model.rowCount(),1); 96 | std::stringstream logging_model_msg; 97 | switch ( level ) { 98 | case(Debug) : { 99 | ROS_DEBUG_STREAM(msg); 100 | logging_model_msg << "[DEBUG] [" << ros::Time::now() << "]: " << "received value is: " << msg.data; 101 | break; 102 | } 103 | case(Info) : { 104 | ROS_INFO_STREAM(msg); 105 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << "received value is: " << msg.data; 106 | break; 107 | } 108 | case(Warn) : { 109 | ROS_WARN_STREAM(msg); 110 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << "received value is: " << msg.data; 111 | break; 112 | } 113 | case(Error) : { 114 | ROS_ERROR_STREAM(msg); 115 | logging_model_msg << "[ERROR] [" << ros::Time::now() << "]: " << "received value is: " << msg.data; 116 | break; 117 | } 118 | case(Fatal) : { 119 | ROS_FATAL_STREAM(msg); 120 | logging_model_msg << "[FATAL] [" << ros::Time::now() << "]: " << "received value is: " << msg.data; 121 | break; 122 | } 123 | } 124 | QVariant new_row(QString(logging_model_msg.str().c_str())); 125 | logging_model.setData(logging_model.index(logging_model.rowCount()-1),new_row); 126 | Q_EMIT loggingUpdated(); // used to readjust the scrollbar 127 | } 128 | 129 | } // namespace my_qt_gui_subscriber 130 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/src/qnode.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/qnode.cpp 3 | * 4 | * @brief Ros communication central! 5 | * 6 | * @date February 2011 7 | **/ 8 | 9 | /***************************************************************************** 10 | ** Includes 11 | *****************************************************************************/ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "../include/button_test/qnode.hpp" 19 | 20 | /***************************************************************************** 21 | ** Namespaces 22 | *****************************************************************************/ 23 | 24 | namespace button_test { 25 | 26 | /***************************************************************************** 27 | ** Implementation 28 | *****************************************************************************/ 29 | 30 | QNode::QNode(int argc, char** argv ) : 31 | init_argc(argc), 32 | init_argv(argv) 33 | {} 34 | 35 | QNode::~QNode() { 36 | if(ros::isStarted()) { 37 | ros::shutdown(); // explicitly needed since we use ros::start(); 38 | ros::waitForShutdown(); 39 | } 40 | wait(); 41 | } 42 | 43 | bool QNode::init() { 44 | ros::init(init_argc,init_argv,"button_test"); 45 | if ( ! ros::master::check() ) { 46 | return false; 47 | } 48 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 49 | ros::NodeHandle n; 50 | // Add your ros communications here. 51 | chatter_publisher = n.advertise("chatter", 1000); 52 | start(); 53 | return true; 54 | } 55 | 56 | bool QNode::init(const std::string &master_url, const std::string &host_url) { 57 | std::map remappings; 58 | remappings["__master"] = master_url; 59 | remappings["__hostname"] = host_url; 60 | ros::init(remappings,"button_test"); 61 | if ( ! ros::master::check() ) { 62 | return false; 63 | } 64 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 65 | ros::NodeHandle n; 66 | // Add your ros communications here. 67 | chatter_publisher = n.advertise("chatter", 1000); 68 | start(); 69 | return true; 70 | } 71 | 72 | void QNode::run() { 73 | ros::Rate loop_rate(1); 74 | int count = 0; 75 | while ( ros::ok() ) { 76 | std_msgs::String msg; 77 | std::stringstream ss; 78 | ss << "hello world " << count; 79 | msg.data = ss.str(); 80 | chatter_publisher.publish(msg); 81 | log(Info,std::string("I sent: ")+msg.data); 82 | ros::spinOnce(); 83 | loop_rate.sleep(); 84 | ++count; 85 | } 86 | std::cout << "Ros shutdown, proceeding to close the gui." << std::endl; 87 | Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch) 88 | } 89 | 90 | 91 | void QNode::log( const LogLevel &level, const std::string &msg) { 92 | logging_model.insertRows(logging_model.rowCount(),1); 93 | std::stringstream logging_model_msg; 94 | switch ( level ) { 95 | case(Debug) : { 96 | ROS_DEBUG_STREAM(msg); 97 | logging_model_msg << "[DEBUG] [" << ros::Time::now() << "]: " << msg; 98 | break; 99 | } 100 | case(Info) : { 101 | ROS_INFO_STREAM(msg); 102 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 103 | break; 104 | } 105 | case(Warn) : { 106 | ROS_WARN_STREAM(msg); 107 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 108 | break; 109 | } 110 | case(Error) : { 111 | ROS_ERROR_STREAM(msg); 112 | logging_model_msg << "[ERROR] [" << ros::Time::now() << "]: " << msg; 113 | break; 114 | } 115 | case(Fatal) : { 116 | ROS_FATAL_STREAM(msg); 117 | logging_model_msg << "[FATAL] [" << ros::Time::now() << "]: " << msg; 118 | break; 119 | } 120 | } 121 | QVariant new_row(QString(logging_model_msg.str().c_str())); 122 | logging_model.setData(logging_model.index(logging_model.rowCount()-1),new_row); 123 | //Q_EMIT loggingUpdated(); // used to readjust the scrollbar 124 | } 125 | 126 | } // namespace button_test 127 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/src/qnode.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/qnode.cpp 3 | * 4 | * @brief Ros communication central! 5 | * 6 | * @date February 2011 7 | **/ 8 | 9 | /***************************************************************************** 10 | ** Includes 11 | *****************************************************************************/ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include "../include/my_qt_gui_publisher/qnode.hpp" 20 | 21 | /***************************************************************************** 22 | ** Global variable 23 | *****************************************************************************/ 24 | 25 | double PI = 3.1415926; 26 | 27 | /***************************************************************************** 28 | ** Namespaces 29 | *****************************************************************************/ 30 | 31 | namespace my_qt_gui_publisher { 32 | 33 | /***************************************************************************** 34 | ** Implementation 35 | *****************************************************************************/ 36 | 37 | QNode::QNode(int argc, char** argv ) : 38 | init_argc(argc), 39 | init_argv(argv) 40 | {} 41 | 42 | QNode::~QNode() { 43 | if(ros::isStarted()) { 44 | ros::shutdown(); // explicitly needed since we use ros::start(); 45 | ros::waitForShutdown(); 46 | } 47 | wait(); 48 | } 49 | 50 | bool QNode::init() { 51 | ros::init(init_argc,init_argv,"my_qt_gui_publisher"); 52 | if ( ! ros::master::check() ) { 53 | return false; 54 | } 55 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 56 | ros::NodeHandle n; 57 | // Add your ros communications here. 58 | chatter_publisher = n.advertise("chatter", 1000); 59 | start(); 60 | return true; 61 | } 62 | 63 | bool QNode::init(const std::string &master_url, const std::string &host_url) { 64 | std::map remappings; 65 | remappings["__master"] = master_url; 66 | remappings["__hostname"] = host_url; 67 | ros::init(remappings,"my_qt_gui_publisher"); 68 | if ( ! ros::master::check() ) { 69 | return false; 70 | } 71 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 72 | ros::NodeHandle n; 73 | // Add your ros communications here. 74 | chatter_publisher = n.advertise("chatter", 1000); 75 | start(); 76 | return true; 77 | } 78 | 79 | void QNode::run() { 80 | ros::Rate loop_rate(10); 81 | std_msgs::Float64 velocity; //create a variable of type "Float64", 82 | 83 | double amplitude = 1.0; 84 | double frequency = 5.0; 85 | int dt = 0; 86 | 87 | while ( ros::ok() ) { 88 | velocity.data = amplitude*sin(frequency*PI/180*dt); //phase increment by frequency*PI/180 radius each iteration 89 | dt++; 90 | ROS_INFO("Sending data %f", velocity.data); 91 | chatter_publisher.publish(velocity); // publish the value--of type Float64-- 92 | 93 | std::stringstream ss; 94 | ss << "velocity = " << velocity.data; 95 | chatter_publisher.publish(velocity); 96 | std::string s(ss.str()); 97 | log(Info,std::string("I sent: ")+s); 98 | ros::spinOnce(); 99 | loop_rate.sleep(); 100 | } 101 | std::cout << "Ros shutdown, proceeding to close the gui." << std::endl; 102 | Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch) 103 | } 104 | 105 | 106 | void QNode::log( const LogLevel &level, const std::string &msg) { 107 | logging_model.insertRows(logging_model.rowCount(),1); 108 | std::stringstream logging_model_msg; 109 | switch ( level ) { 110 | case(Debug) : { 111 | ROS_DEBUG_STREAM(msg); 112 | logging_model_msg << "[DEBUG] [" << ros::Time::now() << "]: " << msg; 113 | break; 114 | } 115 | case(Info) : { 116 | ROS_INFO_STREAM(msg); 117 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 118 | break; 119 | } 120 | case(Warn) : { 121 | ROS_WARN_STREAM(msg); 122 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 123 | break; 124 | } 125 | case(Error) : { 126 | ROS_ERROR_STREAM(msg); 127 | logging_model_msg << "[ERROR] [" << ros::Time::now() << "]: " << msg; 128 | break; 129 | } 130 | case(Fatal) : { 131 | ROS_FATAL_STREAM(msg); 132 | logging_model_msg << "[FATAL] [" << ros::Time::now() << "]: " << msg; 133 | break; 134 | } 135 | } 136 | QVariant new_row(QString(logging_model_msg.str().c_str())); 137 | logging_model.setData(logging_model.index(logging_model.rowCount()-1),new_row); 138 | Q_EMIT loggingUpdated(); // used to readjust the scrollbar 139 | } 140 | 141 | } // namespace my_qt_gui_publisher 142 | -------------------------------------------------------------------------------- /Qt_GUI/QuickAppTest/build-QuickAppTest-Desktop_Qt_5_5_1_GCC_64bit-Debug/qrc_qml.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Resource object code 3 | ** 4 | ** Created by: The Resource Compiler for Qt version 5.5.1 5 | ** 6 | ** WARNING! All changes made in this file will be lost! 7 | *****************************************************************************/ 8 | 9 | static const unsigned char qt_resource_data[] = { 10 | // /home/peng/ROSCppGUI/QuickAppTest/QuickAppTest/main.qml 11 | 0x0,0x0,0x1,0xb9, 12 | 0x69, 13 | 0x6d,0x70,0x6f,0x72,0x74,0x20,0x51,0x74,0x51,0x75,0x69,0x63,0x6b,0x20,0x32,0x2e, 14 | 0x33,0xa,0x69,0x6d,0x70,0x6f,0x72,0x74,0x20,0x51,0x74,0x51,0x75,0x69,0x63,0x6b, 15 | 0x2e,0x57,0x69,0x6e,0x64,0x6f,0x77,0x20,0x32,0x2e,0x32,0xa,0xa,0x57,0x69,0x6e, 16 | 0x64,0x6f,0x77,0x20,0x7b,0xa,0x20,0x20,0x20,0x20,0x76,0x69,0x73,0x69,0x62,0x6c, 17 | 0x65,0x3a,0x20,0x74,0x72,0x75,0x65,0xa,0xa,0x20,0x20,0x20,0x20,0x77,0x69,0x64, 18 | 0x74,0x68,0x3a,0x20,0x36,0x34,0x30,0xa,0x20,0x20,0x20,0x20,0x68,0x65,0x69,0x67, 19 | 0x68,0x74,0x3a,0x20,0x34,0x38,0x30,0xa,0xa,0x20,0x20,0x20,0x20,0x4d,0x6f,0x75, 20 | 0x73,0x65,0x41,0x72,0x65,0x61,0x20,0x7b,0xa,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 21 | 0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x73,0x2e,0x66,0x69,0x6c,0x6c,0x3a,0x20,0x70, 22 | 0x61,0x72,0x65,0x6e,0x74,0xa,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x6e, 23 | 0x43,0x6c,0x69,0x63,0x6b,0x65,0x64,0x3a,0x20,0x7b,0xa,0x20,0x20,0x20,0x20,0x20, 24 | 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x51,0x74,0x2e,0x71,0x75,0x69,0x74,0x28,0x29, 25 | 0x3b,0xa,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0xa,0x20,0x20,0x20,0x20, 26 | 0x7d,0xa,0xa,0x20,0x20,0x20,0x20,0x54,0x65,0x78,0x74,0x20,0x7b,0xa,0x20,0x20, 27 | 0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x74,0x3a,0x20,0x71,0x73,0x54,0x72, 28 | 0x28,0x22,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x22,0x29,0xa, 29 | 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x73,0x2e, 30 | 0x63,0x65,0x6e,0x74,0x65,0x72,0x49,0x6e,0x3a,0x20,0x70,0x61,0x72,0x65,0x6e,0x74, 31 | 0xa,0x20,0x20,0x20,0x20,0x7d,0xa,0xa,0x20,0x20,0x20,0x20,0x70,0x72,0x6f,0x70, 32 | 0x65,0x72,0x74,0x79,0x20,0x61,0x6c,0x69,0x61,0x73,0x20,0x62,0x75,0x74,0x74,0x6f, 33 | 0x6e,0x3a,0x20,0x62,0x75,0x74,0x74,0x6f,0x6e,0xa,0xa,0x20,0x20,0x20,0x20,0x42, 34 | 0x75,0x74,0x74,0x6f,0x6e,0x20,0x7b,0xa,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 35 | 0x20,0x61,0x6e,0x63,0x68,0x6f,0x72,0x73,0x2e,0x63,0x65,0x6e,0x74,0x65,0x72,0x49, 36 | 0x6e,0x3a,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0xa,0x20,0x20,0x20,0x20,0x20,0x20, 37 | 0x20,0x20,0x20,0x69,0x64,0x3a,0x20,0x62,0x75,0x74,0x74,0x6f,0x6e,0xa,0x20,0x20, 38 | 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x74,0x3a,0x20,0x71,0x73,0x54, 39 | 0x72,0x28,0x22,0x50,0x72,0x65,0x73,0x73,0x20,0x4d,0x65,0x22,0x29,0xa,0x20,0x20, 40 | 0x20,0x20,0x20,0x7d,0xa,0x7d,0xa,0xa, 41 | 42 | }; 43 | 44 | static const unsigned char qt_resource_name[] = { 45 | // main.qml 46 | 0x0,0x8, 47 | 0x8,0x1,0x5a,0x5c, 48 | 0x0,0x6d, 49 | 0x0,0x61,0x0,0x69,0x0,0x6e,0x0,0x2e,0x0,0x71,0x0,0x6d,0x0,0x6c, 50 | 51 | }; 52 | 53 | static const unsigned char qt_resource_struct[] = { 54 | // : 55 | 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, 56 | // :/main.qml 57 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, 58 | 59 | }; 60 | 61 | #ifdef QT_NAMESPACE 62 | # define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name 63 | # define QT_RCC_MANGLE_NAMESPACE0(x) x 64 | # define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b 65 | # define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) 66 | # define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ 67 | QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) 68 | #else 69 | # define QT_RCC_PREPEND_NAMESPACE(name) name 70 | # define QT_RCC_MANGLE_NAMESPACE(name) name 71 | #endif 72 | 73 | #ifdef QT_NAMESPACE 74 | namespace QT_NAMESPACE { 75 | #endif 76 | 77 | bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); 78 | 79 | bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); 80 | 81 | #ifdef QT_NAMESPACE 82 | } 83 | #endif 84 | 85 | int QT_RCC_MANGLE_NAMESPACE(qInitResources_qml)(); 86 | int QT_RCC_MANGLE_NAMESPACE(qInitResources_qml)() 87 | { 88 | QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) 89 | (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); 90 | return 1; 91 | } 92 | 93 | int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_qml)(); 94 | int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_qml)() 95 | { 96 | QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) 97 | (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); 98 | return 1; 99 | } 100 | 101 | namespace { 102 | struct initializer { 103 | initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_qml)(); } 104 | ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_qml)(); } 105 | } dummy; 106 | } 107 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/src/main_window.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main_window.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "../include/my_qt_gui_publisher/main_window.hpp" 16 | 17 | /***************************************************************************** 18 | ** Namespaces 19 | *****************************************************************************/ 20 | 21 | namespace my_qt_gui_publisher { 22 | 23 | using namespace Qt; 24 | 25 | /***************************************************************************** 26 | ** Implementation [MainWindow] 27 | *****************************************************************************/ 28 | 29 | MainWindow::MainWindow(int argc, char** argv, QWidget *parent) 30 | : QMainWindow(parent) 31 | , qnode(argc,argv) 32 | { 33 | ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class. 34 | QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application 35 | 36 | ReadSettings(); 37 | setWindowIcon(QIcon(":/images/icon.png")); 38 | ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?). 39 | QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close())); 40 | 41 | /********************* 42 | ** Logging 43 | **********************/ 44 | ui.view_logging->setModel(qnode.loggingModel()); 45 | QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView())); 46 | 47 | /********************* 48 | ** Auto Start 49 | **********************/ 50 | if ( ui.checkbox_remember_settings->isChecked() ) { 51 | on_button_connect_clicked(true); 52 | } 53 | } 54 | 55 | MainWindow::~MainWindow() {} 56 | 57 | /***************************************************************************** 58 | ** Implementation [Slots] 59 | *****************************************************************************/ 60 | 61 | void MainWindow::showNoMasterMessage() { 62 | QMessageBox msgBox; 63 | msgBox.setText("Couldn't find the ros master."); 64 | msgBox.exec(); 65 | close(); 66 | } 67 | 68 | /* 69 | * These triggers whenever the button is clicked, regardless of whether it 70 | * is already checked or not. 71 | */ 72 | 73 | void MainWindow::on_button_connect_clicked(bool check ) { 74 | if ( ui.checkbox_use_environment->isChecked() ) { 75 | if ( !qnode.init() ) { 76 | showNoMasterMessage(); 77 | } else { 78 | ui.button_connect->setEnabled(false); 79 | } 80 | } else { 81 | if ( ! qnode.init(ui.line_edit_master->text().toStdString(), 82 | ui.line_edit_host->text().toStdString()) ) { 83 | showNoMasterMessage(); 84 | } else { 85 | ui.button_connect->setEnabled(false); 86 | ui.line_edit_master->setReadOnly(true); 87 | ui.line_edit_host->setReadOnly(true); 88 | ui.line_edit_topic->setReadOnly(true); 89 | } 90 | } 91 | } 92 | 93 | 94 | void MainWindow::on_checkbox_use_environment_stateChanged(int state) { 95 | bool enabled; 96 | if ( state == 0 ) { 97 | enabled = true; 98 | } else { 99 | enabled = false; 100 | } 101 | ui.line_edit_master->setEnabled(enabled); 102 | ui.line_edit_host->setEnabled(enabled); 103 | //ui.line_edit_topic->setEnabled(enabled); 104 | } 105 | 106 | /***************************************************************************** 107 | ** Implemenation [Slots][manually connected] 108 | *****************************************************************************/ 109 | 110 | /** 111 | * This function is signalled by the underlying model. When the model changes, 112 | * this will drop the cursor down to the last line in the QListview to ensure 113 | * the user can always see the latest log message. 114 | */ 115 | void MainWindow::updateLoggingView() { 116 | ui.view_logging->scrollToBottom(); 117 | } 118 | 119 | /***************************************************************************** 120 | ** Implementation [Menu] 121 | *****************************************************************************/ 122 | 123 | void MainWindow::on_actionAbout_triggered() { 124 | QMessageBox::about(this, tr("About ..."),tr("

PACKAGE_NAME Test Program 0.10

Copyright Yujin Robot

This package needs an about description.

")); 125 | } 126 | 127 | /***************************************************************************** 128 | ** Implementation [Configuration] 129 | *****************************************************************************/ 130 | 131 | void MainWindow::ReadSettings() { 132 | QSettings settings("Qt-Ros Package", "my_qt_gui_publisher"); 133 | restoreGeometry(settings.value("geometry").toByteArray()); 134 | restoreState(settings.value("windowState").toByteArray()); 135 | QString master_url = settings.value("master_url",QString("http://192.168.1.2:11311/")).toString(); 136 | QString host_url = settings.value("host_url", QString("192.168.1.3")).toString(); 137 | //QString topic_name = settings.value("topic_name", QString("/chatter")).toString(); 138 | ui.line_edit_master->setText(master_url); 139 | ui.line_edit_host->setText(host_url); 140 | //ui.line_edit_topic->setText(topic_name); 141 | bool remember = settings.value("remember_settings", false).toBool(); 142 | ui.checkbox_remember_settings->setChecked(remember); 143 | bool checked = settings.value("use_environment_variables", false).toBool(); 144 | ui.checkbox_use_environment->setChecked(checked); 145 | if ( checked ) { 146 | ui.line_edit_master->setEnabled(false); 147 | ui.line_edit_host->setEnabled(false); 148 | //ui.line_edit_topic->setEnabled(false); 149 | } 150 | } 151 | 152 | void MainWindow::WriteSettings() { 153 | QSettings settings("Qt-Ros Package", "my_qt_gui_publisher"); 154 | settings.setValue("master_url",ui.line_edit_master->text()); 155 | settings.setValue("host_url",ui.line_edit_host->text()); 156 | //settings.setValue("topic_name",ui.line_edit_topic->text()); 157 | settings.setValue("use_environment_variables",QVariant(ui.checkbox_use_environment->isChecked())); 158 | settings.setValue("geometry", saveGeometry()); 159 | settings.setValue("windowState", saveState()); 160 | settings.setValue("remember_settings",QVariant(ui.checkbox_remember_settings->isChecked())); 161 | 162 | } 163 | 164 | void MainWindow::closeEvent(QCloseEvent *event) 165 | { 166 | WriteSettings(); 167 | QMainWindow::closeEvent(event); 168 | } 169 | 170 | } // namespace my_qt_gui_publisher 171 | 172 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/src/main_window.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main_window.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "../include/my_qt_gui_subscriber/main_window.hpp" 16 | 17 | /***************************************************************************** 18 | ** Namespaces 19 | *****************************************************************************/ 20 | 21 | namespace my_qt_gui_subscriber { 22 | 23 | using namespace Qt; 24 | 25 | /***************************************************************************** 26 | ** Implementation [MainWindow] 27 | *****************************************************************************/ 28 | 29 | MainWindow::MainWindow(int argc, char** argv, QWidget *parent) 30 | : QMainWindow(parent) 31 | , qnode(argc,argv) 32 | { 33 | ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class. 34 | QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application 35 | 36 | ReadSettings(); 37 | setWindowIcon(QIcon(":/images/icon.png")); 38 | ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?). 39 | QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close())); 40 | 41 | /********************* 42 | ** Logging 43 | **********************/ 44 | ui.view_logging->setModel(qnode.loggingModel()); 45 | QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView())); 46 | 47 | /********************* 48 | ** Auto Start 49 | **********************/ 50 | if ( ui.checkbox_remember_settings->isChecked() ) { 51 | on_button_connect_clicked(true); 52 | } 53 | } 54 | 55 | MainWindow::~MainWindow() {} 56 | 57 | /***************************************************************************** 58 | ** Implementation [Slots] 59 | *****************************************************************************/ 60 | 61 | void MainWindow::showNoMasterMessage() { 62 | QMessageBox msgBox; 63 | msgBox.setText("Couldn't find the ros master."); 64 | msgBox.exec(); 65 | close(); 66 | } 67 | 68 | /* 69 | * These triggers whenever the button is clicked, regardless of whether it 70 | * is already checked or not. 71 | */ 72 | 73 | void MainWindow::on_button_connect_clicked(bool check ) { 74 | if ( ui.checkbox_use_environment->isChecked() ) { 75 | if ( !qnode.init() ) { 76 | showNoMasterMessage(); 77 | } else { 78 | ui.button_connect->setEnabled(false); 79 | } 80 | } else { 81 | if ( ! qnode.init(ui.line_edit_master->text().toStdString(), 82 | ui.line_edit_host->text().toStdString()) ) { 83 | showNoMasterMessage(); 84 | } else { 85 | ui.button_connect->setEnabled(false); 86 | ui.line_edit_master->setReadOnly(true); 87 | ui.line_edit_host->setReadOnly(true); 88 | ui.line_edit_topic->setReadOnly(true); 89 | } 90 | } 91 | } 92 | 93 | 94 | void MainWindow::on_checkbox_use_environment_stateChanged(int state) { 95 | bool enabled; 96 | if ( state == 0 ) { 97 | enabled = true; 98 | } else { 99 | enabled = false; 100 | } 101 | ui.line_edit_master->setEnabled(enabled); 102 | ui.line_edit_host->setEnabled(enabled); 103 | //ui.line_edit_topic->setEnabled(enabled); 104 | } 105 | 106 | /***************************************************************************** 107 | ** Implemenation [Slots][manually connected] 108 | *****************************************************************************/ 109 | 110 | /** 111 | * This function is signalled by the underlying model. When the model changes, 112 | * this will drop the cursor down to the last line in the QListview to ensure 113 | * the user can always see the latest log message. 114 | */ 115 | void MainWindow::updateLoggingView() { 116 | ui.view_logging->scrollToBottom(); 117 | } 118 | 119 | /***************************************************************************** 120 | ** Implementation [Menu] 121 | *****************************************************************************/ 122 | 123 | void MainWindow::on_actionAbout_triggered() { 124 | QMessageBox::about(this, tr("About ..."),tr("

PACKAGE_NAME Test Program 0.10

Copyright Yujin Robot

This package needs an about description.

")); 125 | } 126 | 127 | /***************************************************************************** 128 | ** Implementation [Configuration] 129 | *****************************************************************************/ 130 | 131 | void MainWindow::ReadSettings() { 132 | QSettings settings("Qt-Ros Package", "my_qt_gui_subscriber"); 133 | restoreGeometry(settings.value("geometry").toByteArray()); 134 | restoreState(settings.value("windowState").toByteArray()); 135 | QString master_url = settings.value("master_url",QString("http://192.168.1.2:11311/")).toString(); 136 | QString host_url = settings.value("host_url", QString("192.168.1.3")).toString(); 137 | //QString topic_name = settings.value("topic_name", QString("/chatter")).toString(); 138 | ui.line_edit_master->setText(master_url); 139 | ui.line_edit_host->setText(host_url); 140 | //ui.line_edit_topic->setText(topic_name); 141 | bool remember = settings.value("remember_settings", false).toBool(); 142 | ui.checkbox_remember_settings->setChecked(remember); 143 | bool checked = settings.value("use_environment_variables", false).toBool(); 144 | ui.checkbox_use_environment->setChecked(checked); 145 | if ( checked ) { 146 | ui.line_edit_master->setEnabled(false); 147 | ui.line_edit_host->setEnabled(false); 148 | //ui.line_edit_topic->setEnabled(false); 149 | } 150 | } 151 | 152 | void MainWindow::WriteSettings() { 153 | QSettings settings("Qt-Ros Package", "my_qt_gui_subscriber"); 154 | settings.setValue("master_url",ui.line_edit_master->text()); 155 | settings.setValue("host_url",ui.line_edit_host->text()); 156 | //settings.setValue("topic_name",ui.line_edit_topic->text()); 157 | settings.setValue("use_environment_variables",QVariant(ui.checkbox_use_environment->isChecked())); 158 | settings.setValue("geometry", saveGeometry()); 159 | settings.setValue("windowState", saveState()); 160 | settings.setValue("remember_settings",QVariant(ui.checkbox_remember_settings->isChecked())); 161 | 162 | } 163 | 164 | void MainWindow::closeEvent(QCloseEvent *event) 165 | { 166 | WriteSettings(); 167 | QMainWindow::closeEvent(event); 168 | } 169 | 170 | } // namespace my_qt_gui_subscriber 171 | 172 | -------------------------------------------------------------------------------- /developping_log.md: -------------------------------------------------------------------------------- 1 | # Developping Log 2 | 3 | ## 1. QT SDK 5.0 Installation 4 | 5 | http://www.wikihow.com/Install-Qt-SDK-on-Ubuntu-Linux 6 | 7 | *First Qt program* 8 | 9 | http://www.wikihow.com/Create-Your-First-Qt-Program-on-Ubuntu-Linux 10 | 11 | # 2. Qtcreator installation in terminal 12 | 13 | ``` 14 | $ sudo apt-get install ros-indigo-qt-create 15 | $ sudo apt-get install ros-indigo-qt-build 16 | $ sudo apt-get install qtcreator 17 | ``` 18 | 19 | ## 3. Prepare the ros environment 20 | 21 | ``` 22 | $ mkdir -p ~/ros_ws/src 23 | $ cd ~/ros_ws/src 24 | $ catkin_init_workspace 25 | $ cd ~/ros_ws/ 26 | $ catkin_make 27 | $ echo "source ~/ros_ws/devel/setup.bash" >> ~/.bashrc 28 | ``` 29 | 30 | ## 4. Create qt_ros template 31 | 32 | ``` 33 | $ cd ~/ros_ws/src 34 | $ catkin_create_qt_pkg qdude 35 | ``` 36 | 37 | ## 5. Start qtcreator in terminal 38 | 39 | ``` 40 | $ qtcreator 41 | ``` 42 | 43 | ## 6. How to open a ros project in qtcreator? 44 | 45 | http://xiaoyatec.com/2015/10/13/ros%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%B9%8Bqt-creator%E4%BA%8C/ 46 | 47 | http://wiki.ros.org/IDEs#QtCreator 48 | 49 | #### NOTE: 50 | 51 | 1) rosbuild 52 | 53 | To open a rosbuild ROS package code as a project, use "Open File or Project" and select the CMakeLists.txt of your ROS package. Take care to select the "[package_name]/build" directory as the build directory, which is the ROS default. On the next screen click 'Run Cmake' and then Finish. This may not show all the folders such as launch and include in the project tree. If you want to choose the files manually, goto File->New File or Project->Import Project->Import Existing Project and selected to choose all files/folders included in the project. 54 | 55 | 2) catkin_make 56 | 57 | To open a catkin code as a project, use "Open File or Project" and select the top level CMakeLists.txt of the catkin workspace (e.g. "src/CMakeLists.txt"). Select the catkin build folder as the build directory and 'Run CMake' (in order to enable debugging add following line into arguments edit box: -DCMAKE_BUILD_TYPE=Debug). 58 | 59 | Recently this has started to fail, because the main CMakeLists is a symlink to a non writtable location. The workaround is to make a copy to toplevel.cmake instead of using a symlink. And if you want the project to be named something else than "Project" then add a line at the top with "project(MyProjectName)" 60 | 61 | To be able to modify all the files in the workspace add those lines in "src/CMakeLists.txt" : 62 | 63 | **Add all files in subdirectories of the project in a dummy_target so qtcreator have access to all files** 64 | 65 | ``` 66 | FILE(GLOB children ${CMAKE_SOURCE_DIR}/*) 67 | FOREACH(child ${children}) 68 | IF(IS_DIRECTORY ${child}) 69 | file(GLOB_RECURSE dir_files "${child}/*") 70 | LIST(APPEND extra_files ${dir_files}) 71 | ENDIF() 72 | ENDFOREACH() 73 | add_custom_target(dummy_${PROJECT_NAME} SOURCES ${extra_files}) 74 | ``` 75 | 76 | You may specify the correct catkin devel and install spaces at Projects->Build Settings by providing the following CMake arguments: `-DCATKIN_DEVEL_PREFIX=../devel -DCMAKE_INSTALL_PREFIX=../install` 77 | 78 | 3) catkin tools 79 | 80 | With the new catkin_tools, there is no longer a top level make file for the whole workspace. Instead, open each package as an individual project in QtCreator. The trick is to set the build folder to ws/build/your_package instead of ws/build as before. 81 | 82 | ============================================================================================= 83 | 84 | **create rqt plugin pkg** 85 | 86 | http://wiki.ros.org/rqt/Tutorials/Create%20your%20new%20rqt%20plugin 87 | 88 | catkin_create_pkg rqt_mypkg roscpp rqt_gui rqt_gui_cpp 89 | 90 | **Writing a C++ Plugin** 91 | 92 | http://wiki.ros.org/rqt/Tutorials/Writing%20a%20C%2B%2B%20Plugin 93 | 94 | **Using .ui file in rqt plugin** 95 | 96 | http://wiki.ros.org/rqt/Tutorials/Using%20.ui%20file%20in%20rqt%20plugin 97 | 98 | **Add a new ROS publisher node to a QTcreator project which already contains a ROS subscriber node** 99 | 100 | http://answers.ros.org/question/212459/add-a-new-ros-publisher-node-to-a-qtcreator-project-which-already-contains-a-ros-subscriber-node/ 101 | 102 | 103 | ============================================================================================= 104 | 105 | #### useful resources in github: 106 | 107 | https://github.com/ros-visualization 108 | 109 | https://github.com/ros-visualization/rqt_common_plugins.git 110 | 111 | https://github.com/ros-visualization/rqt_robot_plugins.git 112 | 113 | http://docs.ros.org/electric/api/qt_tutorials/html/index.html 114 | 115 | ============================================================================================= 116 | 117 | #### Possible errors: 118 | 119 | 1. CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package): 120 | 121 | ``` 122 | Could not find a package configuration file provided by "qt_build" with any of the following names: 123 | 124 | qt_buildConfig.cmake 125 | qt_build-config.cmake 126 | 127 | Add the installation prefix of "qt_build" to CMAKE_PREFIX_PATH or set "qt_build_DIR" to a directory containing one of the above files. If "qt_build" provides a separate development package or SDK, be sure it has been installed. 128 | ``` 129 | 130 | **Solve:** 131 | 132 | ``` 133 | sudo apt-get install ros-indigo-qt-build 134 | ``` 135 | 136 | Referring to: 137 | 138 | http://answers.ros.org/question/172056/failed-to-include-qt-ros-from-qt_build/ 139 | 140 | 2. catkin_make: command not found 141 | 142 | ``` 143 | $ source /opt/ros/indigo/setup.bash 144 | ``` 145 | 146 | to add to your ~/.bashrc: 147 | 148 | ``` 149 | echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc 150 | source ~/.bashrc 151 | ``` 152 | 153 | 3. CMake Error: The source "/home/peng/ros_ws/src/qtros/CMakeLists.txt" does not match the source "/home/peng/ros_ws/src/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory. 154 | 155 | **Search:** 156 | 157 | CMake Error: The source .. does not match the source .. used to generate cache. Re-run cmake with a different source directory. 158 | 159 | **Solve:** 160 | 161 | Delete CMakeCache.txt in the folder you executing cmake. 162 | 163 | 4. If roscd says similar to roscd: No such package/stack 'beginner_tutorials' , you will need to source the environment setup file like you did at the end of the create_a_workspace tutorial: 164 | 165 | ``` 166 | $ source devel/setup.bash 167 | ``` 168 | 169 | 5. source ... No such dir and file... 170 | 171 | **Solve:** 172 | 173 | To set your workspace permanently, open your .bashrc file in a text editor. 174 | 175 | for example -- gedit ~/.bashrc -- and add 176 | 177 | export ROS_PACKAGE_PATH=/your/path/to/workspace:$ROS_PACKAGE_PATH 178 | 179 | 6. http://stackoverflow.com/questions/2752352/how-to-add-include-path-in-qt-creator 180 | 181 | =============================================================================================== 182 | 183 | ## Other links that may useful: 184 | 185 | 1. rqt plugin 186 | 187 | http://wiki.ros.org/rqt/Tutorials/Writing%20a%20C%2B%2B%20Plugin 188 | 189 | 2. ros ide built by QT Creator & Communication Example 190 | 191 | http://my.phirobot.com/blog/2013-12-ros_ide_qtcreator.htmlc 192 | 193 | 3. project set 194 | 195 | http://blog.csdn.net/zyh821351004/article/details/43672887 196 | 197 | 198 | =================== 199 | 200 | https://aur.archlinux.org/packages/ros-indigo-qt-gui/ 201 | 202 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/src/main_window.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main_window.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date February 2011 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "../include/button_test/main_window.hpp" 16 | 17 | /***************************************************************************** 18 | ** Namespaces 19 | *****************************************************************************/ 20 | 21 | namespace button_test { 22 | 23 | using namespace Qt; 24 | 25 | /***************************************************************************** 26 | ** Implementation [MainWindow] 27 | *****************************************************************************/ 28 | 29 | MainWindow::MainWindow(int argc, char** argv, QWidget *parent) 30 | : QMainWindow(parent) 31 | , qnode(argc,argv) { 32 | ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class. 33 | QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application 34 | 35 | ReadSettings(); 36 | setWindowIcon(QIcon(":/images/icon.png")); 37 | ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?). 38 | QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close())); 39 | 40 | /********************* 41 | ** Logging 42 | **********************/ 43 | ui.view_logging->setModel(qnode.loggingModel()); 44 | QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView())); 45 | 46 | /********************* 47 | ** Auto Start 48 | **********************/ 49 | if ( ui.checkbox_remember_settings->isChecked() ) { 50 | on_button_connect_clicked(true); 51 | } 52 | 53 | /******************************* 54 | ** Button test - explicit way 55 | ********************************/ 56 | QObject::connect(ui.button_left, SIGNAL(clicked()), this, SLOT(moveLeft())); 57 | } 58 | 59 | MainWindow::~MainWindow() {} 60 | 61 | /***************************************************************************** 62 | ** Implementation [Slots] 63 | *****************************************************************************/ 64 | 65 | void MainWindow::showNoMasterMessage() { 66 | QMessageBox msgBox; 67 | msgBox.setText("Couldn't find the ros master."); 68 | msgBox.exec(); 69 | close(); 70 | } 71 | 72 | void MainWindow::showButtonTestMessage() { 73 | QMessageBox msgBox; 74 | msgBox.setText("Button test ..."); 75 | msgBox.exec(); 76 | //close(); 77 | } 78 | 79 | /* 80 | * These triggers whenever the button is clicked, regardless of whether it 81 | * is already checked or not. 82 | */ 83 | 84 | void MainWindow::on_button_connect_clicked(bool check ) { 85 | if ( ui.checkbox_use_environment->isChecked() ) { 86 | if ( !qnode.init() ) { 87 | showNoMasterMessage(); 88 | } else { 89 | ui.button_connect->setEnabled(false); 90 | } 91 | } else { 92 | if ( ! qnode.init(ui.line_edit_master->text().toStdString(), 93 | ui.line_edit_host->text().toStdString()) ) { 94 | showNoMasterMessage(); 95 | } else { 96 | ui.button_connect->setEnabled(false); 97 | ui.line_edit_master->setReadOnly(true); 98 | ui.line_edit_host->setReadOnly(true); 99 | ui.line_edit_topic->setReadOnly(true); 100 | } 101 | } 102 | } 103 | 104 | void MainWindow::on_button_test_clicked(bool check ) { 105 | showButtonTestMessage(); 106 | } 107 | 108 | void MainWindow::on_checkbox_use_environment_stateChanged(int state) { 109 | bool enabled; 110 | if ( state == 0 ) { 111 | enabled = true; 112 | } else { 113 | enabled = false; 114 | } 115 | ui.line_edit_master->setEnabled(enabled); 116 | ui.line_edit_host->setEnabled(enabled); 117 | //ui.line_edit_topic->setEnabled(enabled); 118 | } 119 | 120 | /***************************************************************************** 121 | ** Implemenation [Slots][manually connected] 122 | *****************************************************************************/ 123 | 124 | /** 125 | * This function is signalled by the underlying model. When the model changes, 126 | * this will drop the cursor down to the last line in the QListview to ensure 127 | * the user can always see the latest log message. 128 | */ 129 | void MainWindow::updateLoggingView() { 130 | ui.view_logging->scrollToBottom(); 131 | } 132 | 133 | void MainWindow::moveLeft() { 134 | logging_model = qnode.loggingModel(); 135 | logging_model->insertRows(logging_model->rowCount(), 1); 136 | std::stringstream logging_model_msg; 137 | logging_model_msg << "move to left ..."; 138 | QVariant new_row(QString(logging_model_msg.str().c_str())); 139 | logging_model->setData(logging_model->index(logging_model->rowCount()-1), new_row); 140 | 141 | std::cout << logging_model->rowCount() << std::endl; 142 | std::cout << logging_model_msg.str().c_str() << std::endl; 143 | } 144 | 145 | /***************************************************************************** 146 | ** Implementation [Menu] 147 | *****************************************************************************/ 148 | 149 | void MainWindow::on_actionAbout_triggered() { 150 | QMessageBox::about(this, tr("About ..."),tr("

PACKAGE_NAME Test Program 0.10

Copyright Yujin Robot

This package needs an about description.

")); 151 | } 152 | 153 | /***************************************************************************** 154 | ** Implementation [Configuration] 155 | *****************************************************************************/ 156 | 157 | void MainWindow::ReadSettings() { 158 | QSettings settings("Qt-Ros Package", "button_test"); 159 | restoreGeometry(settings.value("geometry").toByteArray()); 160 | restoreState(settings.value("windowState").toByteArray()); 161 | QString master_url = settings.value("master_url",QString("http://192.168.1.2:11311/")).toString(); 162 | QString host_url = settings.value("host_url", QString("192.168.1.3")).toString(); 163 | //QString topic_name = settings.value("topic_name", QString("/chatter")).toString(); 164 | ui.line_edit_master->setText(master_url); 165 | ui.line_edit_host->setText(host_url); 166 | //ui.line_edit_topic->setText(topic_name); 167 | bool remember = settings.value("remember_settings", false).toBool(); 168 | ui.checkbox_remember_settings->setChecked(remember); 169 | bool checked = settings.value("use_environment_variables", false).toBool(); 170 | ui.checkbox_use_environment->setChecked(checked); 171 | if ( checked ) { 172 | ui.line_edit_master->setEnabled(false); 173 | ui.line_edit_host->setEnabled(false); 174 | //ui.line_edit_topic->setEnabled(false); 175 | } 176 | } 177 | 178 | void MainWindow::WriteSettings() { 179 | QSettings settings("Qt-Ros Package", "button_test"); 180 | settings.setValue("master_url",ui.line_edit_master->text()); 181 | settings.setValue("host_url",ui.line_edit_host->text()); 182 | //settings.setValue("topic_name",ui.line_edit_topic->text()); 183 | settings.setValue("use_environment_variables",QVariant(ui.checkbox_use_environment->isChecked())); 184 | settings.setValue("geometry", saveGeometry()); 185 | settings.setValue("windowState", saveState()); 186 | settings.setValue("remember_settings",QVariant(ui.checkbox_remember_settings->isChecked())); 187 | } 188 | 189 | void MainWindow::closeEvent(QCloseEvent *event) { 190 | WriteSettings(); 191 | QMainWindow::closeEvent(event); 192 | } 193 | 194 | } // namespace button_test 195 | 196 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/ui/main_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindowDesign 4 | 5 | 6 | 7 | 0 8 | 0 9 | 944 10 | 704 11 | 12 | 13 | 14 | QRosApp 15 | 16 | 17 | 18 | :/images/icon.png:/images/icon.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 100 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 41 | Ros Communications 42 | 43 | 44 | 45 | 46 | 47 | 48 | 0 49 | 0 50 | 51 | 52 | 53 | Logging 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 0 72 | 0 73 | 944 74 | 21 75 | 76 | 77 | 78 | 79 | &App 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 0 95 | 0 96 | 97 | 98 | 99 | 100 | 325 101 | 368 102 | 103 | 104 | 105 | Qt::RightDockWidgetArea 106 | 107 | 108 | Command Panel 109 | 110 | 111 | 2 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 0 120 | 0 121 | 122 | 123 | 124 | QFrame::StyledPanel 125 | 126 | 127 | QFrame::Raised 128 | 129 | 130 | 131 | 132 | 133 | Ros Master 134 | 135 | 136 | 137 | 138 | 139 | QFrame::StyledPanel 140 | 141 | 142 | QFrame::Raised 143 | 144 | 145 | Ros Master Url 146 | 147 | 148 | 149 | 150 | 151 | 152 | http://192.168.1.2:11311/ 153 | 154 | 155 | 156 | 157 | 158 | 159 | QFrame::StyledPanel 160 | 161 | 162 | QFrame::Raised 163 | 164 | 165 | Ros IP 166 | 167 | 168 | 169 | 170 | 171 | 172 | 192.168.1.67 173 | 174 | 175 | 176 | 177 | 178 | 179 | QFrame::StyledPanel 180 | 181 | 182 | QFrame::Raised 183 | 184 | 185 | Ros Hostname 186 | 187 | 188 | 189 | 190 | 191 | 192 | false 193 | 194 | 195 | unused 196 | 197 | 198 | 199 | 200 | 201 | 202 | Qt::RightToLeft 203 | 204 | 205 | Use environment variables 206 | 207 | 208 | 209 | 210 | 211 | 212 | Qt::RightToLeft 213 | 214 | 215 | Remember settings on startup 216 | 217 | 218 | 219 | 220 | 221 | 222 | Qt::Horizontal 223 | 224 | 225 | 226 | 170 227 | 21 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | true 236 | 237 | 238 | 239 | 0 240 | 0 241 | 242 | 243 | 244 | Set the target to the current joint trajectory state. 245 | 246 | 247 | Clear all waypoints and set the target to the current joint trajectory state. 248 | 249 | 250 | Connect 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | Qt::Vertical 261 | 262 | 263 | 264 | 20 265 | 233 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 0 278 | 0 279 | 280 | 281 | 282 | Quit 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | &Quit 292 | 293 | 294 | Ctrl+Q 295 | 296 | 297 | Qt::ApplicationShortcut 298 | 299 | 300 | 301 | 302 | &Preferences 303 | 304 | 305 | 306 | 307 | &About 308 | 309 | 310 | 311 | 312 | About &Qt 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | action_Quit 322 | triggered() 323 | MainWindowDesign 324 | close() 325 | 326 | 327 | -1 328 | -1 329 | 330 | 331 | 399 332 | 299 333 | 334 | 335 | 336 | 337 | quit_button 338 | clicked() 339 | MainWindowDesign 340 | close() 341 | 342 | 343 | 859 344 | 552 345 | 346 | 347 | 469 348 | 299 349 | 350 | 351 | 352 | 353 | 354 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/ui/main_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindowDesign 4 | 5 | 6 | 7 | 0 8 | 0 9 | 944 10 | 704 11 | 12 | 13 | 14 | QRosApp 15 | 16 | 17 | 18 | :/images/icon.png:/images/icon.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 100 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 41 | Ros Communications 42 | 43 | 44 | 45 | 46 | 47 | 48 | 0 49 | 0 50 | 51 | 52 | 53 | Logging 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 0 72 | 0 73 | 944 74 | 21 75 | 76 | 77 | 78 | 79 | &App 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 0 95 | 0 96 | 97 | 98 | 99 | 100 | 325 101 | 368 102 | 103 | 104 | 105 | Qt::RightDockWidgetArea 106 | 107 | 108 | Command Panel 109 | 110 | 111 | 2 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 0 120 | 0 121 | 122 | 123 | 124 | QFrame::StyledPanel 125 | 126 | 127 | QFrame::Raised 128 | 129 | 130 | 131 | 132 | 133 | Ros Master 134 | 135 | 136 | 137 | 138 | 139 | QFrame::StyledPanel 140 | 141 | 142 | QFrame::Raised 143 | 144 | 145 | Ros Master Url 146 | 147 | 148 | 149 | 150 | 151 | 152 | http://192.168.1.2:11311/ 153 | 154 | 155 | 156 | 157 | 158 | 159 | QFrame::StyledPanel 160 | 161 | 162 | QFrame::Raised 163 | 164 | 165 | Ros IP 166 | 167 | 168 | 169 | 170 | 171 | 172 | 192.168.1.67 173 | 174 | 175 | 176 | 177 | 178 | 179 | QFrame::StyledPanel 180 | 181 | 182 | QFrame::Raised 183 | 184 | 185 | Ros Hostname 186 | 187 | 188 | 189 | 190 | 191 | 192 | false 193 | 194 | 195 | unused 196 | 197 | 198 | 199 | 200 | 201 | 202 | Qt::RightToLeft 203 | 204 | 205 | Use environment variables 206 | 207 | 208 | 209 | 210 | 211 | 212 | Qt::RightToLeft 213 | 214 | 215 | Remember settings on startup 216 | 217 | 218 | 219 | 220 | 221 | 222 | Qt::Horizontal 223 | 224 | 225 | 226 | 170 227 | 21 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | true 236 | 237 | 238 | 239 | 0 240 | 0 241 | 242 | 243 | 244 | Set the target to the current joint trajectory state. 245 | 246 | 247 | Clear all waypoints and set the target to the current joint trajectory state. 248 | 249 | 250 | Connect 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | Qt::Vertical 261 | 262 | 263 | 264 | 20 265 | 233 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 0 278 | 0 279 | 280 | 281 | 282 | Quit 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | &Quit 292 | 293 | 294 | Ctrl+Q 295 | 296 | 297 | Qt::ApplicationShortcut 298 | 299 | 300 | 301 | 302 | &Preferences 303 | 304 | 305 | 306 | 307 | &About 308 | 309 | 310 | 311 | 312 | About &Qt 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | action_Quit 322 | triggered() 323 | MainWindowDesign 324 | close() 325 | 326 | 327 | -1 328 | -1 329 | 330 | 331 | 399 332 | 299 333 | 334 | 335 | 336 | 337 | quit_button 338 | clicked() 339 | MainWindowDesign 340 | close() 341 | 342 | 343 | 859 344 | 552 345 | 346 | 347 | 469 348 | 299 349 | 350 | 351 | 352 | 353 | 354 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_publisher/CMakeLists.txt.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ProjectExplorer.Project.ActiveTarget 7 | 0 8 | 9 | 10 | ProjectExplorer.Project.EditorSettings 11 | 12 | true 13 | false 14 | true 15 | 16 | Cpp 17 | 18 | CppGlobal 19 | 20 | 21 | 22 | QmlJS 23 | 24 | QmlJSGlobal 25 | 26 | 27 | 2 28 | UTF-8 29 | false 30 | 4 31 | false 32 | true 33 | 1 34 | true 35 | 0 36 | true 37 | 0 38 | 8 39 | true 40 | 1 41 | true 42 | true 43 | true 44 | false 45 | 46 | 47 | 48 | ProjectExplorer.Project.PluginSettings 49 | 50 | 51 | 52 | ProjectExplorer.Project.Target.0 53 | 54 | Qt 5.5.1 (gcc_64) 55 | Qt 5.5.1 (gcc_64) 56 | {af6bc52b-1e37-4682-8c70-c1471fde4890} 57 | 0 58 | 0 59 | 0 60 | 61 | false 62 | /home/peng/ros_ws/src/gui_project/build-my_qt_gui_publisher 63 | 64 | 65 | 66 | 67 | false 68 | false 69 | true 70 | Make 71 | 72 | CMakeProjectManager.MakeStep 73 | 74 | 1 75 | Build 76 | 77 | ProjectExplorer.BuildSteps.Build 78 | 79 | 80 | 81 | clean 82 | 83 | true 84 | false 85 | true 86 | Make 87 | 88 | CMakeProjectManager.MakeStep 89 | 90 | 1 91 | Clean 92 | 93 | ProjectExplorer.BuildSteps.Clean 94 | 95 | 2 96 | false 97 | 98 | Default 99 | Default 100 | CMakeProjectManager.CMakeBuildConfiguration 101 | 102 | 1 103 | 104 | 105 | 0 106 | Deploy 107 | 108 | ProjectExplorer.BuildSteps.Deploy 109 | 110 | 1 111 | Deploy locally 112 | 113 | ProjectExplorer.DefaultDeployConfiguration 114 | 115 | 1 116 | 117 | 118 | 119 | false 120 | false 121 | false 122 | false 123 | true 124 | 0.01 125 | 10 126 | true 127 | 1 128 | 25 129 | 130 | 1 131 | true 132 | false 133 | true 134 | valgrind 135 | 136 | 0 137 | 1 138 | 2 139 | 3 140 | 4 141 | 5 142 | 6 143 | 7 144 | 8 145 | 9 146 | 10 147 | 11 148 | 12 149 | 13 150 | 14 151 | 152 | my_qt_gui_publisher 153 | 154 | false 155 | 156 | 2 157 | 158 | my_qt_gui_publisher 159 | 160 | CMakeProjectManager.CMakeRunConfiguration.my_qt_gui_publisher 161 | 3768 162 | true 163 | false 164 | false 165 | false 166 | true 167 | 168 | 1 169 | 170 | 171 | 172 | ProjectExplorer.Project.TargetCount 173 | 1 174 | 175 | 176 | ProjectExplorer.Project.Updater.EnvironmentId 177 | {2ec80e12-3826-466b-a6dd-497976731f3d} 178 | 179 | 180 | ProjectExplorer.Project.Updater.FileVersion 181 | 15 182 | 183 | 184 | -------------------------------------------------------------------------------- /QtROS_GUI/my_qt_gui_subscriber/CMakeLists.txt.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ProjectExplorer.Project.ActiveTarget 7 | 0 8 | 9 | 10 | ProjectExplorer.Project.EditorSettings 11 | 12 | true 13 | false 14 | true 15 | 16 | Cpp 17 | 18 | CppGlobal 19 | 20 | 21 | 22 | QmlJS 23 | 24 | QmlJSGlobal 25 | 26 | 27 | 2 28 | UTF-8 29 | false 30 | 4 31 | false 32 | true 33 | 1 34 | true 35 | 0 36 | true 37 | 0 38 | 8 39 | true 40 | 1 41 | true 42 | true 43 | true 44 | false 45 | 46 | 47 | 48 | ProjectExplorer.Project.PluginSettings 49 | 50 | 51 | 52 | ProjectExplorer.Project.Target.0 53 | 54 | Qt 5.5.1 (gcc_64) 55 | Qt 5.5.1 (gcc_64) 56 | {af6bc52b-1e37-4682-8c70-c1471fde4890} 57 | 0 58 | 0 59 | 0 60 | 61 | false 62 | /home/peng/ros_ws/src/gui_project/build-my_qt_gui_subscriber 63 | 64 | 65 | 66 | 67 | false 68 | false 69 | true 70 | Make 71 | 72 | CMakeProjectManager.MakeStep 73 | 74 | 1 75 | Build 76 | 77 | ProjectExplorer.BuildSteps.Build 78 | 79 | 80 | 81 | clean 82 | 83 | true 84 | false 85 | true 86 | Make 87 | 88 | CMakeProjectManager.MakeStep 89 | 90 | 1 91 | Clean 92 | 93 | ProjectExplorer.BuildSteps.Clean 94 | 95 | 2 96 | false 97 | 98 | Default 99 | Default 100 | CMakeProjectManager.CMakeBuildConfiguration 101 | 102 | 1 103 | 104 | 105 | 0 106 | Deploy 107 | 108 | ProjectExplorer.BuildSteps.Deploy 109 | 110 | 1 111 | Deploy locally 112 | 113 | ProjectExplorer.DefaultDeployConfiguration 114 | 115 | 1 116 | 117 | 118 | 119 | false 120 | false 121 | false 122 | false 123 | true 124 | 0.01 125 | 10 126 | true 127 | 1 128 | 25 129 | 130 | 1 131 | true 132 | false 133 | true 134 | valgrind 135 | 136 | 0 137 | 1 138 | 2 139 | 3 140 | 4 141 | 5 142 | 6 143 | 7 144 | 8 145 | 9 146 | 10 147 | 11 148 | 12 149 | 13 150 | 14 151 | 152 | my_qt_gui_subscriber 153 | 154 | false 155 | 156 | 2 157 | 158 | my_qt_gui_subscriber 159 | 160 | CMakeProjectManager.CMakeRunConfiguration.my_qt_gui_subscriber 161 | 3768 162 | true 163 | false 164 | false 165 | false 166 | true 167 | 168 | 1 169 | 170 | 171 | 172 | ProjectExplorer.Project.TargetCount 173 | 1 174 | 175 | 176 | ProjectExplorer.Project.Updater.EnvironmentId 177 | {2ec80e12-3826-466b-a6dd-497976731f3d} 178 | 179 | 180 | ProjectExplorer.Project.Updater.FileVersion 181 | 15 182 | 183 | 184 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/CMakeLists.txt.user.3.2-pre1: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ProjectExplorer.Project.ActiveTarget 7 | 0 8 | 9 | 10 | ProjectExplorer.Project.EditorSettings 11 | 12 | true 13 | false 14 | true 15 | 16 | Cpp 17 | 18 | CppGlobal 19 | 20 | 21 | 22 | QmlJS 23 | 24 | QmlJSGlobal 25 | 26 | 27 | 2 28 | UTF-8 29 | false 30 | 4 31 | false 32 | true 33 | 1 34 | true 35 | 0 36 | true 37 | 0 38 | 8 39 | true 40 | 1 41 | true 42 | true 43 | true 44 | false 45 | 46 | 47 | 48 | ProjectExplorer.Project.PluginSettings 49 | 50 | 51 | 52 | ProjectExplorer.Project.Target.0 53 | 54 | Qt 5.5.1 (gcc_64) 55 | Qt 5.5.1 (gcc_64) 56 | {af6bc52b-1e37-4682-8c70-c1471fde4890} 57 | 0 58 | 0 59 | 0 60 | 61 | false 62 | /home/peng/ros_ws/src/gui_project/build-button_test 63 | 64 | 65 | 66 | 67 | false 68 | false 69 | true 70 | Make 71 | 72 | CMakeProjectManager.MakeStep 73 | 74 | 1 75 | Build 76 | 77 | ProjectExplorer.BuildSteps.Build 78 | 79 | 80 | 81 | clean 82 | 83 | true 84 | false 85 | true 86 | Make 87 | 88 | CMakeProjectManager.MakeStep 89 | 90 | 1 91 | Clean 92 | 93 | ProjectExplorer.BuildSteps.Clean 94 | 95 | 2 96 | false 97 | 98 | Default 99 | Default 100 | CMakeProjectManager.CMakeBuildConfiguration 101 | 102 | 1 103 | 104 | 105 | 0 106 | Deploy 107 | 108 | ProjectExplorer.BuildSteps.Deploy 109 | 110 | 1 111 | Deploy locally 112 | 113 | ProjectExplorer.DefaultDeployConfiguration 114 | 115 | 1 116 | 117 | 118 | 119 | false 120 | false 121 | false 122 | false 123 | true 124 | 0.01 125 | 10 126 | true 127 | 1 128 | 25 129 | 130 | 1 131 | true 132 | false 133 | true 134 | valgrind 135 | 136 | 0 137 | 1 138 | 2 139 | 3 140 | 4 141 | 5 142 | 6 143 | 7 144 | 8 145 | 9 146 | 10 147 | 11 148 | 12 149 | 13 150 | 14 151 | 152 | button_test 153 | 154 | false 155 | 156 | 2 157 | 158 | button_test 159 | 160 | CMakeProjectManager.CMakeRunConfiguration.button_test 161 | 3768 162 | true 163 | false 164 | false 165 | false 166 | true 167 | 168 | 1 169 | 170 | 171 | 172 | ProjectExplorer.Project.TargetCount 173 | 1 174 | 175 | 176 | ProjectExplorer.Project.Updater.EnvironmentId 177 | {2ec80e12-3826-466b-a6dd-497976731f3d} 178 | 179 | 180 | ProjectExplorer.Project.Updater.FileVersion 181 | 15 182 | 183 | 184 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/ui/main_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindowDesign 4 | 5 | 6 | 7 | 0 8 | 0 9 | 944 10 | 704 11 | 12 | 13 | 14 | QRosApp 15 | 16 | 17 | 18 | :/images/icon.png:/images/icon.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 100 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 41 | Ros Communications 42 | 43 | 44 | 45 | 46 | 47 | test 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 0 56 | 0 57 | 58 | 59 | 60 | Logging 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 0 79 | 0 80 | 944 81 | 25 82 | 83 | 84 | 85 | 86 | &App 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 0 102 | 0 103 | 104 | 105 | 106 | 107 | 325 108 | 395 109 | 110 | 111 | 112 | Qt::RightDockWidgetArea 113 | 114 | 115 | Command Panel 116 | 117 | 118 | 2 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 0 127 | 0 128 | 129 | 130 | 131 | QFrame::StyledPanel 132 | 133 | 134 | QFrame::Raised 135 | 136 | 137 | 138 | 139 | 140 | Ros Master 141 | 142 | 143 | 144 | 145 | 146 | QFrame::StyledPanel 147 | 148 | 149 | QFrame::Raised 150 | 151 | 152 | Ros Master Url 153 | 154 | 155 | 156 | 157 | 158 | 159 | http://192.168.1.2:11311/ 160 | 161 | 162 | 163 | 164 | 165 | 166 | QFrame::StyledPanel 167 | 168 | 169 | QFrame::Raised 170 | 171 | 172 | Ros IP 173 | 174 | 175 | 176 | 177 | 178 | 179 | 192.168.1.67 180 | 181 | 182 | 183 | 184 | 185 | 186 | QFrame::StyledPanel 187 | 188 | 189 | QFrame::Raised 190 | 191 | 192 | Ros Hostname 193 | 194 | 195 | 196 | 197 | 198 | 199 | false 200 | 201 | 202 | unused 203 | 204 | 205 | 206 | 207 | 208 | 209 | Qt::RightToLeft 210 | 211 | 212 | Use environment variables 213 | 214 | 215 | 216 | 217 | 218 | 219 | Qt::RightToLeft 220 | 221 | 222 | Remember settings on startup 223 | 224 | 225 | 226 | 227 | 228 | 229 | Qt::Horizontal 230 | 231 | 232 | 233 | 170 234 | 21 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | true 243 | 244 | 245 | 246 | 0 247 | 0 248 | 249 | 250 | 251 | Set the target to the current joint trajectory state. 252 | 253 | 254 | Clear all waypoints and set the target to the current joint trajectory state. 255 | 256 | 257 | Connect 258 | 259 | 260 | 261 | 262 | 263 | 264 | true 265 | 266 | 267 | 268 | 0 269 | 0 270 | 271 | 272 | 273 | Left. 274 | 275 | 276 | Move to left. 277 | 278 | 279 | Left 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | Qt::Vertical 290 | 291 | 292 | 293 | 20 294 | 233 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 0 307 | 0 308 | 309 | 310 | 311 | Quit 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | &Quit 321 | 322 | 323 | Ctrl+Q 324 | 325 | 326 | Qt::ApplicationShortcut 327 | 328 | 329 | 330 | 331 | &Preferences 332 | 333 | 334 | 335 | 336 | &About 337 | 338 | 339 | 340 | 341 | About &Qt 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | action_Quit 351 | triggered() 352 | MainWindowDesign 353 | close() 354 | 355 | 356 | -1 357 | -1 358 | 359 | 360 | 399 361 | 299 362 | 363 | 364 | 365 | 366 | quit_button 367 | clicked() 368 | MainWindowDesign 369 | close() 370 | 371 | 372 | 859 373 | 552 374 | 375 | 376 | 469 377 | 299 378 | 379 | 380 | 381 | 382 | 383 | -------------------------------------------------------------------------------- /Qt_GUI/QtWidgetsTest/QtWidgetsTest/QtWidgetsTest.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {2ec80e12-3826-466b-a6dd-497976731f3d} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | 0 45 | 8 46 | true 47 | 1 48 | true 49 | true 50 | true 51 | false 52 | 53 | 54 | 55 | ProjectExplorer.Project.PluginSettings 56 | 57 | 58 | 59 | ProjectExplorer.Project.Target.0 60 | 61 | Desktop Qt 5.5.1 GCC 64bit 62 | Desktop Qt 5.5.1 GCC 64bit 63 | qt.55.gcc_64_kit 64 | 0 65 | 0 66 | 0 67 | 68 | /home/peng/ROSCppGUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Debug 69 | 70 | 71 | true 72 | qmake 73 | 74 | QtProjectManager.QMakeBuildStep 75 | false 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | Build 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | Clean 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/peng/ROSCppGUI/QtWidgetsTest/build-QtWidgetsTest-Desktop_Qt_5_5_1_GCC_64bit-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | true 138 | 139 | false 140 | false 141 | false 142 | 143 | 144 | true 145 | Make 146 | 147 | Qt4ProjectManager.MakeStep 148 | 149 | -w 150 | -r 151 | 152 | false 153 | 154 | 155 | 156 | 2 157 | Build 158 | 159 | ProjectExplorer.BuildSteps.Build 160 | 161 | 162 | 163 | true 164 | Make 165 | 166 | Qt4ProjectManager.MakeStep 167 | 168 | -w 169 | -r 170 | 171 | true 172 | clean 173 | 174 | 175 | 1 176 | Clean 177 | 178 | ProjectExplorer.BuildSteps.Clean 179 | 180 | 2 181 | false 182 | 183 | Release 184 | 185 | Qt4ProjectManager.Qt4BuildConfiguration 186 | 0 187 | true 188 | 189 | 2 190 | 191 | 192 | 0 193 | Deploy 194 | 195 | ProjectExplorer.BuildSteps.Deploy 196 | 197 | 1 198 | Deploy locally 199 | 200 | ProjectExplorer.DefaultDeployConfiguration 201 | 202 | 1 203 | 204 | 205 | 206 | false 207 | false 208 | false 209 | false 210 | true 211 | 0.01 212 | 10 213 | true 214 | 1 215 | 25 216 | 217 | 1 218 | true 219 | false 220 | true 221 | valgrind 222 | 223 | 0 224 | 1 225 | 2 226 | 3 227 | 4 228 | 5 229 | 6 230 | 7 231 | 8 232 | 9 233 | 10 234 | 11 235 | 12 236 | 13 237 | 14 238 | 239 | -1 240 | 241 | 242 | 243 | %{buildDir} 244 | Custom Executable 245 | 246 | ProjectExplorer.CustomExecutableRunConfiguration 247 | 3768 248 | false 249 | true 250 | false 251 | false 252 | true 253 | 254 | 1 255 | 256 | 257 | 258 | ProjectExplorer.Project.TargetCount 259 | 1 260 | 261 | 262 | ProjectExplorer.Project.Updater.FileVersion 263 | 18 264 | 265 | 266 | Version 267 | 18 268 | 269 | 270 | -------------------------------------------------------------------------------- /QtROS_GUI/button_test/CMakeLists.txt.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {9ed8b67c-5b8c-4819-94d1-62d973ec8e82} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop Qt 5.7.0 GCC 64bit 63 | Desktop Qt 5.7.0 GCC 64bit 64 | qt.57.gcc_64_kit 65 | 0 66 | 0 67 | 0 68 | 69 | 70 | /home/peng/catkin_ws/src/ROSCppGUI/QtROS_GUI/build-button_test-Desktop_Qt_5_7_0_GCC_64bit-Default 71 | 72 | 73 | 74 | 75 | all 76 | 77 | true 78 | Make 79 | 80 | CMakeProjectManager.MakeStep 81 | 82 | 1 83 | Build 84 | 85 | ProjectExplorer.BuildSteps.Build 86 | 87 | 88 | 89 | 90 | 91 | clean 92 | 93 | true 94 | Make 95 | 96 | CMakeProjectManager.MakeStep 97 | 98 | 1 99 | Clean 100 | 101 | ProjectExplorer.BuildSteps.Clean 102 | 103 | 2 104 | false 105 | 106 | Default 107 | Default 108 | CMakeProjectManager.CMakeBuildConfiguration 109 | 110 | 111 | 112 | CMAKE_BUILD_TYPE:STRING=Debug 113 | 114 | /home/peng/catkin_ws/src/ROSCppGUI/QtROS_GUI/build-button_test-Desktop_Qt_5_7_0_GCC_64bit-Debug 115 | 116 | 117 | 118 | 119 | 120 | 121 | true 122 | Make 123 | 124 | CMakeProjectManager.MakeStep 125 | 126 | 1 127 | Build 128 | 129 | ProjectExplorer.BuildSteps.Build 130 | 131 | 132 | 133 | 134 | 135 | clean 136 | 137 | true 138 | Make 139 | 140 | CMakeProjectManager.MakeStep 141 | 142 | 1 143 | Clean 144 | 145 | ProjectExplorer.BuildSteps.Clean 146 | 147 | 2 148 | false 149 | 150 | Debug 151 | Debug 152 | CMakeProjectManager.CMakeBuildConfiguration 153 | 154 | 155 | 156 | CMAKE_BUILD_TYPE:STRING=Release 157 | 158 | /home/peng/catkin_ws/src/ROSCppGUI/QtROS_GUI/build-button_test-Desktop_Qt_5_7_0_GCC_64bit-Release 159 | 160 | 161 | 162 | 163 | 164 | 165 | true 166 | Make 167 | 168 | CMakeProjectManager.MakeStep 169 | 170 | 1 171 | Build 172 | 173 | ProjectExplorer.BuildSteps.Build 174 | 175 | 176 | 177 | 178 | 179 | clean 180 | 181 | true 182 | Make 183 | 184 | CMakeProjectManager.MakeStep 185 | 186 | 1 187 | Clean 188 | 189 | ProjectExplorer.BuildSteps.Clean 190 | 191 | 2 192 | false 193 | 194 | Release 195 | Release 196 | CMakeProjectManager.CMakeBuildConfiguration 197 | 198 | 199 | 200 | CMAKE_BUILD_TYPE:STRING=RelWithDebInfo 201 | 202 | /home/peng/catkin_ws/src/ROSCppGUI/QtROS_GUI/build-button_test-Desktop_Qt_5_7_0_GCC_64bit-Release with Debug Information 203 | 204 | 205 | 206 | 207 | 208 | 209 | true 210 | Make 211 | 212 | CMakeProjectManager.MakeStep 213 | 214 | 1 215 | Build 216 | 217 | ProjectExplorer.BuildSteps.Build 218 | 219 | 220 | 221 | 222 | 223 | clean 224 | 225 | true 226 | Make 227 | 228 | CMakeProjectManager.MakeStep 229 | 230 | 1 231 | Clean 232 | 233 | ProjectExplorer.BuildSteps.Clean 234 | 235 | 2 236 | false 237 | 238 | Release with Debug Information 239 | Release with Debug Information 240 | CMakeProjectManager.CMakeBuildConfiguration 241 | 242 | 243 | 244 | CMAKE_BUILD_TYPE:STRING=MinSizeRel 245 | 246 | /home/peng/catkin_ws/src/ROSCppGUI/QtROS_GUI/build-button_test-Desktop_Qt_5_7_0_GCC_64bit-Minimum Size Release 247 | 248 | 249 | 250 | 251 | 252 | 253 | true 254 | Make 255 | 256 | CMakeProjectManager.MakeStep 257 | 258 | 1 259 | Build 260 | 261 | ProjectExplorer.BuildSteps.Build 262 | 263 | 264 | 265 | 266 | 267 | clean 268 | 269 | true 270 | Make 271 | 272 | CMakeProjectManager.MakeStep 273 | 274 | 1 275 | Clean 276 | 277 | ProjectExplorer.BuildSteps.Clean 278 | 279 | 2 280 | false 281 | 282 | Minimum Size Release 283 | Minimum Size Release 284 | CMakeProjectManager.CMakeBuildConfiguration 285 | 286 | 5 287 | 288 | 289 | 0 290 | Deploy 291 | 292 | ProjectExplorer.BuildSteps.Deploy 293 | 294 | 1 295 | Deploy locally 296 | 297 | ProjectExplorer.DefaultDeployConfiguration 298 | 299 | 1 300 | 301 | 302 | false 303 | false 304 | 1000 305 | 306 | true 307 | 308 | false 309 | false 310 | false 311 | false 312 | true 313 | 0.01 314 | 10 315 | true 316 | 1 317 | 25 318 | 319 | 1 320 | true 321 | false 322 | true 323 | valgrind 324 | 325 | 0 326 | 1 327 | 2 328 | 3 329 | 4 330 | 5 331 | 6 332 | 7 333 | 8 334 | 9 335 | 10 336 | 11 337 | 12 338 | 13 339 | 14 340 | 341 | button_test 342 | 343 | 344 | /tmp/qtc-cmake-6KZtuq/devel/lib/button_test 345 | 2 346 | 347 | button_test 348 | 349 | CMakeProjectManager.CMakeRunConfiguration.button_test 350 | 3768 351 | false 352 | true 353 | false 354 | false 355 | true 356 | 357 | 1 358 | 359 | 360 | 361 | ProjectExplorer.Project.TargetCount 362 | 1 363 | 364 | 365 | ProjectExplorer.Project.Updater.FileVersion 366 | 18 367 | 368 | 369 | Version 370 | 18 371 | 372 | 373 | --------------------------------------------------------------------------------