├── .gitignore ├── docs ├── error.PNG ├── pyqt_gui.png ├── ros_cmake.png ├── ros_cv_gui.png ├── rqt_mypkg.png ├── rqt_recfg.png ├── test_gui.png └── librviz_gui.jpg ├── test_gui ├── resources │ ├── images │ │ └── logo.png │ └── images.qrc ├── package.xml ├── src │ ├── main.cpp │ ├── qnode.cpp │ └── main_window.cpp ├── include │ └── test_gui │ │ ├── main_window.hpp │ │ └── qnode.hpp ├── CMakeLists.txt └── ui │ └── main_window.ui ├── dyn_cfg_gui ├── resources │ ├── images │ │ ├── close.png │ │ ├── open.png │ │ └── save.png │ └── images.qrc ├── src │ ├── main.cpp │ ├── rosthread.cpp │ ├── param_widget.cpp │ └── dyn_cfg_gui.cpp ├── include │ ├── editor_enum.h │ ├── rosthread.h │ ├── param_widget.h │ ├── editor_bool.h │ ├── editor_string.h │ ├── editor_decimal.h │ ├── dyn_cfg_gui.h │ └── editor_number.h ├── ui │ ├── editor_bool.ui │ ├── editor_enum.ui │ ├── editor_string.ui │ ├── editor_decimal.ui │ ├── editor_number.ui │ └── dyn_cfg_gui.ui ├── package.xml └── CMakeLists.txt ├── rqt_mypkg ├── scripts │ └── rqt_mypkg ├── setup.py ├── plugin.xml ├── include │ └── my_plugin.h ├── src │ └── my_plugin.cpp ├── package.xml ├── CMakeLists.txt └── ui │ └── my_plugin.ui ├── qt4rosgui ├── src │ ├── main.cpp │ └── qt4test.cpp ├── include │ └── qt4test.h ├── CMakeLists.txt ├── package.xml └── ui │ └── qt4test.ui ├── ros_cmake ├── main.cpp ├── widget.h ├── CMakeLists.txt ├── widget.cpp └── widget.ui ├── qt_ros_test ├── src │ ├── main.cpp │ ├── qt_ros_test.h │ ├── qt_ros_test.cpp │ └── qt_ros_test.ui ├── CMakeLists.txt └── package.xml ├── ros_cv_gui ├── src │ ├── main.cpp │ └── mydemo.cpp ├── include │ └── ros_cv_gui │ │ └── mydemo.h ├── package.xml ├── CMakeLists.txt └── ui │ └── mydemo.ui ├── vizlib_test ├── src │ ├── main.cpp │ ├── vizlib_test.h │ ├── vizlib_test.ui │ └── vizlib_test.cpp ├── package.xml └── CMakeLists.txt ├── ros_pyqt ├── setup.py ├── CMakeLists.txt ├── src │ └── rospy_gui.py └── package.xml ├── pyqt_gui ├── CMakeLists.txt ├── src │ └── pygui.py ├── package.xml └── ui │ └── pygui.ui ├── LICENSE └── README.MD /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *~ 3 | ~* 4 | *.user 5 | *-build/ 6 | 7 | -------------------------------------------------------------------------------- /docs/error.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/error.PNG -------------------------------------------------------------------------------- /docs/pyqt_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/pyqt_gui.png -------------------------------------------------------------------------------- /docs/ros_cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/ros_cmake.png -------------------------------------------------------------------------------- /docs/ros_cv_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/ros_cv_gui.png -------------------------------------------------------------------------------- /docs/rqt_mypkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/rqt_mypkg.png -------------------------------------------------------------------------------- /docs/rqt_recfg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/rqt_recfg.png -------------------------------------------------------------------------------- /docs/test_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/test_gui.png -------------------------------------------------------------------------------- /docs/librviz_gui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/docs/librviz_gui.jpg -------------------------------------------------------------------------------- /test_gui/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/test_gui/resources/images/logo.png -------------------------------------------------------------------------------- /dyn_cfg_gui/resources/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/dyn_cfg_gui/resources/images/close.png -------------------------------------------------------------------------------- /dyn_cfg_gui/resources/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/dyn_cfg_gui/resources/images/open.png -------------------------------------------------------------------------------- /dyn_cfg_gui/resources/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WelinLee/ROS_QT_GUI/HEAD/dyn_cfg_gui/resources/images/save.png -------------------------------------------------------------------------------- /test_gui/resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/logo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /rqt_mypkg/scripts/rqt_mypkg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | 5 | from rqt_gui.main import Main 6 | 7 | sys.exit(main.main(sys.argv, standalone='MyPlugin')) 8 | 9 | -------------------------------------------------------------------------------- /dyn_cfg_gui/resources/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/close.png 4 | images/open.png 5 | images/save.png 6 | 7 | 8 | -------------------------------------------------------------------------------- /qt4rosgui/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "include/qt4test.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Qt4Test w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ros_cmake/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w(argc, argv); 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /qt_ros_test/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "qt_ros_test.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Qt_Ros_Test w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ros_cv_gui/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/ros_cv_gui/mydemo.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | mydemo w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /vizlib_test/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "vizlib_test.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | VizlibTest w(argc, argv); 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ros_pyqt/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from distutils.core import setup 4 | from catkin_pkg.python_setup import generate_distutils_setup 5 | 6 | d=generate_distutils_setup( 7 | packages=['ros_pyqt'], 8 | package_dir={'':'src'} 9 | ) 10 | 11 | setup(**d) 12 | 13 | -------------------------------------------------------------------------------- /rqt_mypkg/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from distutils.core import setup 3 | from catkin_pkg.python_setup import generate_distutils_setup 4 | 5 | d=generate_distutils_setup( 6 | packages=['rqt_mypkg'], 7 | package_dir={'':'src'}, 8 | requires=['std_msgs', 'roscpp'] 9 | ) 10 | 11 | setup(**d) 12 | 13 | -------------------------------------------------------------------------------- /rqt_mypkg/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A plugin for myGUI 5 | 6 | 7 | 8 | system-help 9 | Great user to provide real value. 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /qt_ros_test/src/qt_ros_test.h: -------------------------------------------------------------------------------- 1 | #ifndef QT_ROS_TEST_H 2 | #define QT_ROS_TEST_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class Qt_Ros_Test; 9 | } 10 | 11 | class Qt_Ros_Test : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit Qt_Ros_Test(QWidget *parent = 0); 17 | ~Qt_Ros_Test(); 18 | 19 | private slots: 20 | void on_slider_value_change(int value); 21 | 22 | private: 23 | Ui::Qt_Ros_Test *ui; 24 | ros::Publisher chatter_publisher; 25 | }; 26 | 27 | #endif // QT_ROS_TEST_H 28 | -------------------------------------------------------------------------------- /qt4rosgui/include/qt4test.h: -------------------------------------------------------------------------------- 1 | #ifndef QT4_TEST_H 2 | #define QT4_TEST_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class Qt4Test; 10 | } 11 | 12 | class Qt4Test : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Qt4Test(QWidget *parent = 0); 18 | ~Qt4Test(); 19 | 20 | private slots: 21 | void slot_btn(); 22 | void slot_btn2(); 23 | 24 | private: 25 | Ui::Qt4Test *ui; 26 | ros::Publisher chatter_pub_; 27 | 28 | }; 29 | 30 | #endif // QT4_TEST_H 31 | -------------------------------------------------------------------------------- /dyn_cfg_gui/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main.cpp 3 | * 4 | * @brief Qt based gui. 5 | * 6 | * @date July 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | 12 | #include 13 | #include 14 | #include 15 | #include "../include/dyn_cfg_gui.h" 16 | 17 | /***************************************************************************** 18 | ** Main 19 | *****************************************************************************/ 20 | int main(int argc, char **argv) 21 | { 22 | QApplication app(argc, argv); 23 | DynRecfgWidget w(argc, argv); 24 | w.show(); 25 | return app.exec(); 26 | } 27 | -------------------------------------------------------------------------------- /ros_cmake/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "ui_widget.h" 9 | 10 | namespace Ui { 11 | class Widget; 12 | } 13 | 14 | class Widget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Widget(int argc, char **argv, QWidget *parent = 0); 20 | ~Widget(); 21 | 22 | void init_ros(int argc, char **argv); 23 | 24 | private slots: 25 | void slot_btn_start(); 26 | void slot_btn_quit(); 27 | void slot_timer(); 28 | 29 | private: 30 | ros::Publisher test_pub_; 31 | QTimer *m_timer = nullptr; 32 | Ui::Widget *ui; 33 | 34 | protected: 35 | virtual void closeEvent(QCloseEvent *ev); 36 | }; 37 | 38 | #endif // WIDGET_H 39 | -------------------------------------------------------------------------------- /ros_pyqt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(ros_pyqt) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED) 8 | 9 | ## System dependencies are found with CMake's conventions 10 | # find_package(Boost REQUIRED COMPONENTS system) 11 | 12 | 13 | ## Uncomment this if the package has a setup.py. This macro ensures 14 | ## modules and global scripts declared therein get installed 15 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 16 | catkin_python_setup() 17 | 18 | catkin_package( 19 | # INCLUDE_DIRS include 20 | # LIBRARIES ros_pyqt 21 | # CATKIN_DEPENDS other_catkin_pkg 22 | # DEPENDS system_lib 23 | ) 24 | -------------------------------------------------------------------------------- /pyqt_gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(pyqt_gui) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED) 8 | 9 | ## System dependencies are found with CMake's conventions 10 | # find_package(Boost REQUIRED COMPONENTS system) 11 | 12 | 13 | ## Uncomment this if the package has a setup.py. This macro ensures 14 | ## modules and global scripts declared therein get installed 15 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 16 | # catkin_python_setup() 17 | 18 | catkin_package( 19 | # INCLUDE_DIRS include 20 | # LIBRARIES ros_pyqt 21 | # CATKIN_DEPENDS other_catkin_pkg 22 | # DEPENDS system_lib 23 | ) 24 | -------------------------------------------------------------------------------- /test_gui/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_gui 4 | 0.1.0 5 | 6 | 7 | test_gui 8 | 9 | 10 | hansmotor 11 | hansmotor 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 | -------------------------------------------------------------------------------- /vizlib_test/src/vizlib_test.h: -------------------------------------------------------------------------------- 1 | #ifndef VIZLIB_TEST_H 2 | #define VIZLIB_TEST_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "vizlib_test/ui_vizlib_test.h" 10 | 11 | namespace Ui { 12 | class VizlibTest; 13 | } 14 | 15 | class VizlibTest : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit VizlibTest(int argc, char **argv, QWidget *parent = 0); 21 | ~VizlibTest(); 22 | 23 | void init_ros(int argc, char **argv); 24 | 25 | private slots: 26 | void slot_btn_display(); 27 | void slot_btn_quit(); 28 | 29 | private: 30 | rviz::VisualizationManager *manager_; 31 | rviz::RenderPanel * render_panel_; 32 | Ui::VizlibTest *ui; 33 | }; 34 | 35 | #endif // VIZLIB_TEST_H 36 | -------------------------------------------------------------------------------- /rqt_mypkg/include/my_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 3 | */ 4 | #ifndef RQT_MYPKG_CPP_MY_PLUGIN_H 5 | #define RQT_MYPKG_CPP_MY_PLUGIN_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include "rqt_mypkg/ui_my_plugin.h" 11 | 12 | namespace rqt_mypkg_cpp 13 | { 14 | 15 | class MyPlugin : public rqt_gui_cpp::Plugin 16 | { 17 | Q_OBJECT 18 | public: 19 | MyPlugin(); 20 | virtual void initPlugin(qt_gui_cpp::PluginContext& context); 21 | virtual void shutdownPlugin(); 22 | 23 | private slots: 24 | void on_slot_pub_topic(); 25 | void on_slider_value_change(int value); 26 | 27 | private: 28 | Ui::MyPluginWidget ui_; 29 | QWidget* widget_; 30 | ros::Publisher m_chatter; 31 | }; 32 | 33 | } // namespace rqt_mypkg_cpp 34 | 35 | #endif // RQT_MYPKG_CPP_MY_PLUGIN_H 36 | -------------------------------------------------------------------------------- /test_gui/src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main.cpp 3 | * 4 | * @brief Qt based gui. 5 | * 6 | * @date February 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include "../include/test_gui/main_window.hpp" 14 | 15 | /***************************************************************************** 16 | ** Main 17 | *****************************************************************************/ 18 | int main(int argc, char **argv) 19 | { 20 | /********************* 21 | ** Qt 22 | **********************/ 23 | QApplication app(argc, argv); 24 | test_gui::MainWindow w(argc,argv); 25 | w.show(); 26 | app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); 27 | int result = app.exec(); 28 | 29 | return result; 30 | } 31 | -------------------------------------------------------------------------------- /ros_cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(ros_cmake) 3 | 4 | ## Add support for C++11, supported in ROS Kinetic and newer 5 | add_definitions(-std=c++11) 6 | add_definitions(-Wall) 7 | add_definitions(-O0) 8 | add_definitions(-g) 9 | 10 | ## Find catkin macros and libraries 11 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 12 | ## is used, also find other catkin packages 13 | find_package(catkin REQUIRED COMPONENTS 14 | roscpp 15 | ) 16 | 17 | ## System dependencies are found with CMake's conventions 18 | find_package(Boost REQUIRED COMPONENTS system) 19 | find_package(Qt5Widgets) # Qt Environment 20 | 21 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 22 | set(CMAKE_AUTOMOC ON) 23 | set(CMAKE_AUTOUIC ON) 24 | set(CMAKE_AUTORCC ON) 25 | 26 | include_directories( 27 | ${CMAKE_CURRENT_BINARY_DIR} 28 | ) 29 | 30 | qt5_wrap_ui(UIC widget.ui) 31 | 32 | add_executable(${PROJECT_NAME} main.cpp widget.cpp widget.ui) 33 | target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} Qt5::Widgets) 34 | 35 | -------------------------------------------------------------------------------- /qt4rosgui/src/qt4test.cpp: -------------------------------------------------------------------------------- 1 | #include "include/qt4test.h" 2 | #include "qt4rosgui/ui_qt4test.h" 3 | #include 4 | #include 5 | 6 | 7 | Qt4Test::Qt4Test(QWidget *parent) : 8 | QWidget(parent), 9 | ui(new Ui::Qt4Test) 10 | { 11 | ui->setupUi(this); 12 | 13 | QObject::connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(slot_btn())); 14 | QObject::connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(slot_btn2())); 15 | 16 | int argc = 0; char **argv = nullptr; 17 | ros::init(argc, argv, "qt4test"); 18 | ros::NodeHandle n; 19 | chatter_pub_ = n.advertise("qt4pub", 1000); 20 | } 21 | 22 | Qt4Test::~Qt4Test() 23 | { 24 | delete ui; 25 | } 26 | 27 | void Qt4Test::slot_btn() 28 | { 29 | static int i = 0; 30 | std_msgs::Int8 msg; 31 | msg.data = i; 32 | chatter_pub_.publish(msg); 33 | i++; 34 | ui->lineEdit->setText(QString::number(i)); 35 | } 36 | 37 | void Qt4Test::slot_btn2() 38 | { 39 | qDebug() << "closed"; 40 | this->close(); 41 | } 42 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/editor_enum.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/editor_enum.h 3 | * 4 | * @brief Qt based gui for EditorEnum. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef EDITORENUM_H 9 | #define EDITORENUM_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include "dyn_cfg_gui/ui_editor_enum.h" 17 | 18 | /***************************************************************************** 19 | ** Interface [EditorString] 20 | *****************************************************************************/ 21 | /** 22 | * @brief Qt central, all operations relating to the view part here. 23 | */ 24 | class EditorEnum : public QWidget 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | EditorEnum(QWidget *parent = 0):QWidget(parent) 30 | { 31 | ui.setupUi(this); 32 | } 33 | 34 | ~EditorEnum(){} 35 | 36 | private slots: 37 | 38 | 39 | private: 40 | Ui::EditorEnum ui; 41 | }; 42 | 43 | #endif // EDITORENUM_H 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, ROS_QT_GUI Project, Author Welin 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. -------------------------------------------------------------------------------- /dyn_cfg_gui/include/rosthread.h: -------------------------------------------------------------------------------- 1 | #ifndef ROSTHREAD_H 2 | #define ROSTHREAD_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | typedef dynamic_reconfigure::Config::ConstPtr RecfgMsgVal; 13 | 14 | class RosThread : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | RosThread(QObject *parent = 0); 20 | ~RosThread(); 21 | 22 | void setServicesName(std::string srvname); 23 | void shutServicesUpdate(std::string srvname); 24 | 25 | signals: 26 | void signal_recfg_msg(const QString &topicname, const RecfgMsgVal &msg); 27 | 28 | private: 29 | void rosrunThread(); 30 | //void subRecfgCallBack(const ros::MessageEvent &event); 31 | void subRecfgCallBack(const dynamic_reconfigure::Config::ConstPtr &msg, std::string srvname); 32 | 33 | private: 34 | ros::NodeHandle *n_; 35 | bool m_isExt; 36 | boost::thread *m_ros_thread; 37 | ros::Subscriber m_subrecfg; 38 | QMap m_subMap; 39 | 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ros_cv_gui/include/ros_cv_gui/mydemo.h: -------------------------------------------------------------------------------- 1 | #ifndef MYDEMO_H 2 | #define MYDEMO_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "opencv2/opencv.hpp" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace Ui { 15 | class mydemo; 16 | } 17 | 18 | class mydemo : public QWidget 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit mydemo(QWidget *parent = 0); 24 | ~mydemo(); 25 | 26 | enum FilterType{ 27 | Box, 28 | Mean, 29 | Gaussian, 30 | Original 31 | }; 32 | 33 | private slots: 34 | void slot_open(); 35 | void slot_imgPro(int value); 36 | void slot_save(); 37 | void slot_quit(); 38 | void slot_toggle1(bool checked); 39 | void slot_toggle2(bool checked); 40 | void slot_toggle3(bool checked); 41 | 42 | private: 43 | void imageShow(cv::Mat matImg); 44 | void onBoxFilter(int value); 45 | void onMeanBlur(int value); 46 | void onGaussian(int value); 47 | 48 | private: 49 | Ui::mydemo *ui; 50 | image_transport::Publisher m_pub; 51 | QImage m_qImg; 52 | cv::Mat m_image; 53 | FilterType m_type; 54 | }; 55 | 56 | #endif // MYDEMO_H 57 | -------------------------------------------------------------------------------- /qt_ros_test/src/qt_ros_test.cpp: -------------------------------------------------------------------------------- 1 | #include "qt_ros_test.h" 2 | #include "qt_ros_test/ui_qt_ros_test.h" 3 | #include 4 | #include 5 | 6 | Qt_Ros_Test::Qt_Ros_Test(QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::Qt_Ros_Test) 9 | { 10 | ui->setupUi(this); 11 | 12 | ui->lineEdit->setText(QString::number(ui->verticalSlider->value())); 13 | QObject::connect(ui->verticalSlider, SIGNAL(valueChanged(int)), 14 | this, SLOT(on_slider_value_change(int))); 15 | 16 | int argc = 0; char **argv = NULL; 17 | ros::init(argc, argv, "client_plug"); 18 | if (!ros::master::check()) 19 | { 20 | ROS_INFO("No master started!"); 21 | this->close(); 22 | } 23 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 24 | ros::NodeHandle n; 25 | chatter_publisher = n.advertise("qtrostest_chat", 1000); 26 | //ros::spin(); 27 | } 28 | 29 | Qt_Ros_Test::~Qt_Ros_Test() 30 | { 31 | delete ui; 32 | } 33 | 34 | void Qt_Ros_Test::on_slider_value_change(int value) 35 | { 36 | ui->lineEdit->setText(QString::number(value)); 37 | 38 | std_msgs::String msg; 39 | std::stringstream ss; 40 | ss << "data: " << ui->verticalSlider->value(); 41 | msg.data = ss.str(); 42 | chatter_publisher.publish(msg); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/editor_bool.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorBool 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 50 11 | 12 | 13 | 14 | 15 | 300 16 | 20 17 | 18 | 19 | 20 | Param 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | TextLabel 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 30 49 | 25 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/editor_enum.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorEnum 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 50 11 | 12 | 13 | 14 | 15 | 300 16 | 30 17 | 18 | 19 | 20 | Param 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | TextLabel 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 30 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/editor_string.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorString 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 50 11 | 12 | 13 | 14 | 15 | 300 16 | 20 17 | 18 | 19 | 20 | Param string 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | TextLabel 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 30 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/param_widget.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/param_widget.h 3 | * 4 | * @brief Qt based gui for ParamWidget. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef PARAMWIDGET_H 9 | #define PARAMWIDGET_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include "editor_bool.h" 21 | #include "editor_number.h" 22 | #include "editor_decimal.h" 23 | #include "editor_string.h" 24 | 25 | /***************************************************************************** 26 | ** Interface [ParamWidget] 27 | *****************************************************************************/ 28 | /** 29 | * @brief Qt central, all operations relating to the view part here. 30 | */ 31 | class ParamWidget : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | ParamWidget(QString title, QWidget *parent = 0); 37 | ~ParamWidget(); 38 | 39 | void addCustomLayout(QWidget *widget); 40 | void rmCustomLayout(); 41 | 42 | signals: 43 | void signal_removenode(QString nodename); 44 | 45 | private slots: 46 | void slot_btn_load(); 47 | void slot_btn_save(); 48 | void slot_btn_close(); 49 | 50 | private: 51 | QVBoxLayout *m_vLayout; 52 | QPushButton *m_loadbtn; 53 | QPushButton *m_savebtn; 54 | QToolButton *m_closebtn; 55 | QString m_nodename; 56 | QList m_widgetLS; 57 | }; 58 | 59 | #endif // PARAMWIDGET_H 60 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/editor_bool.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/editor_bool.h 3 | * 4 | * @brief Qt based gui for EditorBool. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef EDITORBOOL_H 9 | #define EDITORBOOL_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include "dyn_cfg_gui/ui_editor_bool.h" 17 | 18 | /***************************************************************************** 19 | ** Interface [EditorBool] 20 | *****************************************************************************/ 21 | /** 22 | * @brief Qt central, all operations relating to the view part here. 23 | */ 24 | class EditorBool : public QWidget 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | struct ParamDesc 30 | { 31 | std::string name; 32 | bool isChecked; 33 | std::string describe; 34 | 35 | ParamDesc() 36 | { 37 | name = ""; 38 | isChecked = false; 39 | describe = ""; 40 | } 41 | }; 42 | 43 | EditorBool(ParamDesc desc, QWidget *parent = 0) 44 | : QWidget(parent), m_desc(desc) 45 | { 46 | ui.setupUi(this); 47 | 48 | ui._paramname_label->setText(QString::fromStdString(m_desc.name)); 49 | ui._checkbox->setChecked(m_desc.isChecked); 50 | 51 | this->setToolTip(QString::fromStdString(m_desc.describe)); 52 | } 53 | 54 | ~EditorBool(){} 55 | 56 | private slots: 57 | 58 | 59 | private: 60 | Ui::EditorBool ui; 61 | ParamDesc m_desc; 62 | }; 63 | 64 | #endif // EDITORBOOL_H 65 | -------------------------------------------------------------------------------- /pyqt_gui/src/pygui.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os, sys 4 | import rospy 5 | from std_msgs.msg import String 6 | from python_qt_binding import loadUi 7 | from PyQt4 import QtGui 8 | 9 | class pyGui(QtGui.QWidget): 10 | def __init__(self): 11 | super(pyGui, self).__init__() 12 | self_dir = os.path.dirname(os.path.realpath(__file__)) 13 | print self_dir 14 | self.ui_dir = os.path.join(self_dir, '../ui') 15 | ui_file = os.path.join(self.ui_dir, 'pygui.ui') 16 | loadUi(ui_file, self) 17 | self.pub = rospy.Publisher("pygui_topic", String, queue_size=10) 18 | rospy.init_node('py_gui') 19 | self.is_pub = False 20 | self.current_value = self.horizontalSlider.value() 21 | print self.current_value 22 | self.label.setText("num: " + str(self.current_value)) 23 | self.pushButton.pressed.connect(self.publish_topic) 24 | self.pushButton_2.pressed.connect(self.gui_close) 25 | self.horizontalSlider.valueChanged.connect(self.change_value) 26 | 27 | def publish_topic(self): 28 | self.pub.publish(str(self.current_value)) 29 | self.pushButton.setEnabled(False) 30 | self.is_pub = True 31 | 32 | def change_value(self, value): 33 | self.current_value = value 34 | if True == self.is_pub: 35 | self.label.setText("num: " + str(value)) 36 | self.pub.publish(str(self.current_value)) 37 | 38 | def gui_close(self): 39 | self.close() 40 | 41 | 42 | def main(): 43 | app=QtGui.QApplication(sys.argv) 44 | pyShow = pyGui() 45 | pyShow.show() 46 | sys.exit(app.exec_()) 47 | 48 | 49 | if __name__ == "__main__": 50 | main() -------------------------------------------------------------------------------- /dyn_cfg_gui/include/editor_string.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/editor_string.h 3 | * 4 | * @brief Qt based gui for EditorString. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef EDITORSTRING_H 9 | #define EDITORSTRING_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include "dyn_cfg_gui/ui_editor_string.h" 17 | 18 | /***************************************************************************** 19 | ** Interface [EditorString] 20 | *****************************************************************************/ 21 | /** 22 | * @brief Qt central, all operations relating to the view part here. 23 | */ 24 | class EditorString : public QWidget 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | struct ParamDesc 30 | { 31 | std::string name; 32 | std::string text; 33 | std::string describe; 34 | 35 | ParamDesc() 36 | { 37 | name = ""; 38 | text = ""; 39 | describe = ""; 40 | } 41 | }; 42 | 43 | EditorString(ParamDesc desc, QWidget *parent = 0) 44 | : QWidget(parent), m_desc(desc) 45 | { 46 | ui.setupUi(this); 47 | 48 | ui._paramname_label->setText(QString::fromStdString(m_desc.name)); 49 | ui._paramval_lineedit->setText(QString::fromStdString(m_desc.text)); 50 | 51 | this->setToolTip(QString::fromStdString(m_desc.describe)); 52 | } 53 | 54 | ~EditorString(){} 55 | 56 | private slots: 57 | 58 | 59 | private: 60 | Ui::EditorString ui; 61 | ParamDesc m_desc; 62 | }; 63 | 64 | #endif // EDITORSTRING_H 65 | -------------------------------------------------------------------------------- /ros_pyqt/src/rospy_gui.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import rospy 5 | from std_msgs.msg import String 6 | from PyQt4 import QtGui 7 | from PyQt4.QtGui import QLabel, QVBoxLayout, QHBoxLayout, QSlider, QPushButton 8 | from PyQt4.QtCore import Qt 9 | 10 | class PyGui(QtGui.QWidget): 11 | def __init__(self): 12 | super(PyGui, self).__init__() 13 | self.setObjectName('PyGui') 14 | self.pub = rospy.Publisher("pyqt_topic", String, queue_size=10) 15 | rospy.init_node('pyqt_gui') 16 | self.current_value = 0 17 | my_layout = QHBoxLayout() 18 | my_btn = QPushButton() 19 | my_btn.setText("Publisher") 20 | my_btn.setFixedWidth(130) 21 | my_btn.clicked.connect(self.publish_topic) 22 | my_layout.addWidget(my_btn) 23 | my_layout.addSpacing(50) 24 | self.my_label = QLabel() 25 | self.my_label.setFixedWidth(140) 26 | self.my_label.setText("num: " + str(0)) 27 | self.my_label.setEnabled(False) 28 | my_layout.addWidget(self.my_label) 29 | my_slider = QSlider() 30 | my_slider.setMinimum(0) 31 | my_slider.setMaximum(99) 32 | my_slider.setOrientation(Qt.Horizontal) 33 | my_slider.valueChanged.connect(self.changeValue) 34 | my_vlay = QVBoxLayout() 35 | my_vlay.addWidget(my_slider) 36 | layout = QVBoxLayout() 37 | layout.addLayout(my_layout) 38 | layout.addLayout(my_vlay) 39 | self.setLayout(layout) 40 | # self.show() 41 | 42 | def publish_topic(self): 43 | self.pub.publish(str(self.current_value)) 44 | 45 | def changeValue(self, value): 46 | self.my_label.setText("num: " + str(value)) 47 | self.current_value = value 48 | 49 | 50 | if __name__ == "__main__": 51 | app=QtGui.QApplication(sys.argv) 52 | pyShow = PyGui() 53 | pyShow.show() 54 | sys.exit(app.exec_()) 55 | -------------------------------------------------------------------------------- /vizlib_test/src/vizlib_test.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | VizlibTest 4 | 5 | 6 | 7 | 0 8 | 0 9 | 913 10 | 440 11 | 12 | 13 | 14 | VizlibTest 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Dispaly 27 | 28 | 29 | 30 | 31 | 32 | 33 | Qt::Horizontal 34 | 35 | 36 | 37 | 40 38 | 20 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Quit 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /rqt_mypkg/src/my_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 3 | */ 4 | 5 | #include "my_plugin.h" 6 | #include 7 | #include 8 | #include 9 | 10 | namespace rqt_mypkg_cpp 11 | { 12 | 13 | MyPlugin::MyPlugin() 14 | : rqt_gui_cpp::Plugin() 15 | , widget_(0) 16 | { 17 | setObjectName("C++PluginT"); 18 | } 19 | 20 | void MyPlugin::initPlugin(qt_gui_cpp::PluginContext& context) 21 | { 22 | // access standalone command line arguments 23 | QStringList argv = context.argv(); 24 | // create QWidget 25 | widget_ = new QWidget(); 26 | // extend the widget with all attributes and children from UI file 27 | ui_.setupUi(widget_); 28 | // add widget to the user interface 29 | context.addWidget(widget_); 30 | 31 | ui_.lineEdit->setText(QString::number(ui_.verticalSlider->value())); 32 | 33 | QObject::connect(ui_.verticalSlider, SIGNAL(valueChanged(int)), this, SLOT(on_slider_value_change(int))); 34 | QObject::connect(ui_.pushButton, SIGNAL(clicked()), this, SLOT(on_slot_pub_topic())); 35 | 36 | m_chatter = getNodeHandle().advertise("temp_chatter", 1000); 37 | } 38 | 39 | void MyPlugin::shutdownPlugin() 40 | { 41 | // unregister all publishers here 42 | m_chatter.shutdown(); 43 | } 44 | 45 | void MyPlugin::on_slot_pub_topic() 46 | { 47 | std_msgs::String msg; 48 | std::stringstream ss; 49 | ss << "data: " << ui_.verticalSlider->value(); 50 | msg.data = ss.str(); 51 | m_chatter.publish(msg); 52 | } 53 | 54 | void MyPlugin::on_slider_value_change(int value) 55 | { 56 | ui_.lineEdit->setText(QString::number(value)); 57 | } 58 | 59 | } // namespace rqt_mypkg_cpp 60 | 61 | // #define PLUGINLIB_DECLARE_CLASS(pkg, class_name, class_type, base_class_type) 62 | PLUGINLIB_DECLARE_CLASS(rqt_mypkg_cpp, MyPlugin, rqt_mypkg_cpp::MyPlugin, rqt_gui_cpp::Plugin) 63 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/editor_decimal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/editor_decimal.h 3 | * 4 | * @brief Qt based gui for EditorDecimal. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef EDITORDECIMAL_H 9 | #define EDITORDECIMAL_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include "dyn_cfg_gui/ui_editor_decimal.h" 17 | 18 | /***************************************************************************** 19 | ** Interface [EditorDecimal] 20 | *****************************************************************************/ 21 | /** 22 | * @brief Qt central, all operations relating to the view part here. 23 | */ 24 | class EditorDecimal : public QWidget 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | struct ParamDesc 30 | { 31 | std::string name; 32 | double value; 33 | double minvalue; 34 | double maxvalue; 35 | std::string describe; 36 | 37 | ParamDesc() 38 | { 39 | name = ""; 40 | value = 0; minvalue = -99.99; maxvalue = 99.99; 41 | describe = ""; 42 | } 43 | }; 44 | 45 | EditorDecimal(ParamDesc desc, QWidget *parent = 0) 46 | : QWidget(parent), m_desc(desc) 47 | { 48 | ui.setupUi(this); 49 | 50 | ui._paramname_label->setText(QString::fromStdString(m_desc.name)); 51 | ui._min_val_label->setText(QString::number(m_desc.minvalue)); 52 | ui._max_val_label->setText(QString::number(m_desc.maxvalue)); 53 | ui.doubleSpinBox->setValue(m_desc.value); 54 | 55 | this->setToolTip(QString::fromStdString(m_desc.describe)); 56 | } 57 | 58 | ~EditorDecimal(){} 59 | 60 | private slots: 61 | 62 | 63 | private: 64 | Ui::EditorDecimal ui; 65 | ParamDesc m_desc; 66 | }; 67 | 68 | #endif // EDITORDECIMAL_H 69 | -------------------------------------------------------------------------------- /ros_cmake/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | Widget::Widget(int argc, char **argv, QWidget *parent) : 8 | QWidget(parent), 9 | ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | 13 | init_ros(argc, argv); 14 | 15 | QObject::connect(ui->pushButton_start, SIGNAL(clicked()), this, SLOT(slot_btn_start())); 16 | QObject::connect(ui->pushButton_quit, SIGNAL(clicked()), this, SLOT(slot_btn_quit())); 17 | 18 | m_timer = new QTimer( this ); 19 | QObject::connect( m_timer, SIGNAL(timeout()), this, SLOT(slot_timer())); 20 | } 21 | 22 | Widget::~Widget() 23 | { 24 | delete m_timer; 25 | delete ui; 26 | } 27 | 28 | void Widget::init_ros(int argc, char **argv) 29 | { 30 | ros::init(argc, argv, "ros_cmake"); 31 | ros::NodeHandle private_nh("~"); 32 | test_pub_ = private_nh.advertise("test", 1000); 33 | } 34 | 35 | void Widget::slot_btn_start() 36 | { 37 | static bool flag = true; 38 | if(true == flag) 39 | { 40 | m_timer->start(1000); 41 | ui->pushButton_start->setText(QString("Stop")); 42 | flag = false; 43 | } 44 | else 45 | { 46 | m_timer->stop(); 47 | ui->pushButton_start->setText(QString("Start")); 48 | flag = true; 49 | } 50 | } 51 | 52 | void Widget::slot_timer() 53 | { 54 | static int i = 0; 55 | std_msgs::Int8 msg; 56 | msg.data = i; 57 | test_pub_.publish(msg); 58 | ui->lineEdit->setText(QString::number(i)); 59 | i++; 60 | } 61 | 62 | void Widget::slot_btn_quit() 63 | { 64 | if(m_timer->isActive()) 65 | m_timer->stop(); 66 | this->close(); 67 | } 68 | 69 | void Widget::closeEvent(QCloseEvent *ev) 70 | { 71 | int result = QMessageBox::question(this, QString("Tips"), QString("Dialog is closing...")); 72 | if(QMessageBox::Yes == result) 73 | ev->accept(); 74 | else 75 | ev->ignore(); 76 | } 77 | -------------------------------------------------------------------------------- /dyn_cfg_gui/src/rosthread.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/rosthread.h" 2 | #include 3 | 4 | RosThread::RosThread(QObject *parent) 5 | : QObject(parent) 6 | { 7 | qRegisterMetaType("RecfgMsgVal"); 8 | 9 | m_isExt = false; m_ros_thread = NULL; m_subMap.clear(); 10 | n_ = new ros::NodeHandle; 11 | m_ros_thread = new boost::thread(boost::bind(&RosThread::rosrunThread, this)); 12 | } 13 | 14 | RosThread::~RosThread() 15 | { 16 | m_isExt = true; 17 | if(m_ros_thread) 18 | { 19 | m_ros_thread->interrupt(); 20 | m_ros_thread->join(); 21 | delete m_ros_thread; 22 | } 23 | ROS_INFO("Ros shutdown, proceeding to close the gui."); 24 | } 25 | 26 | void RosThread::rosrunThread() 27 | { 28 | ros::Duration initDur(0.2); 29 | while (ros::ok() && !m_isExt) 30 | { 31 | ros::spinOnce(); 32 | initDur.sleep(); 33 | } 34 | ROS_INFO("ros thread closing..."); 35 | } 36 | 37 | void RosThread::setServicesName(std::string srvname) 38 | { 39 | if(!m_subMap.contains(srvname)) 40 | { 41 | ROS_INFO("sub service name: %s", srvname.c_str()); 42 | ros::Subscriber sub = n_->subscribe(srvname, 1000, boost::bind(&RosThread::subRecfgCallBack, this, _1, srvname)); 43 | m_subMap.insert(srvname, sub); 44 | } 45 | else 46 | return; 47 | } 48 | 49 | void RosThread::shutServicesUpdate(std::string srvname) 50 | { 51 | if(m_subMap.contains(srvname)) 52 | { 53 | m_subMap[srvname].shutdown(); 54 | m_subMap.remove(srvname); 55 | ROS_INFO("%s topic shut down.", srvname.c_str()); 56 | } 57 | else 58 | return; 59 | } 60 | 61 | void RosThread::subRecfgCallBack(const dynamic_reconfigure::Config::ConstPtr &msg, std::string srvname) 62 | { 63 | // const std::string &pub_name = event.getPublisherName(); 64 | // const dynamic_reconfigure::ConfigConstPtr &msg = event.getMessage(); 65 | emit signal_recfg_msg(QString::fromStdString(srvname), msg); 66 | } 67 | -------------------------------------------------------------------------------- /ros_pyqt/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ros_pyqt 4 | 0.0.0 5 | The ros_pyqt package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /pyqt_gui/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | pyqt_gui 4 | 0.0.0 5 | The pyqt_gui package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /qt4rosgui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(qt4rosgui) 3 | 4 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -rdynamic -Wall -O0 -std=c++11") 5 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -rdynamic -Wall -O0") 6 | add_definitions(-std=c++11) 7 | add_definitions(-Wall) 8 | add_definitions(-O0) 9 | add_definitions(-g) 10 | 11 | ## Find catkin macros and libraries 12 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 13 | ## is used, also find other catkin packages 14 | find_package(catkin REQUIRED COMPONENTS 15 | roscpp 16 | std_msgs 17 | ) 18 | 19 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 20 | set(CMAKE_AUTOMOC ON) 21 | 22 | ## System dependencies are found with CMake's conventions 23 | find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui) 24 | include(${QT_USE_FILE}) 25 | qt4_wrap_ui(UIC ui/qt4test.ui) 26 | qt4_wrap_cpp(MOC include/qt4test.h) 27 | 28 | ################################### 29 | ## catkin specific configuration ## 30 | ################################### 31 | ## The catkin_package macro generates cmake config files for your package 32 | ## Declare things to be passed to dependent projects 33 | ## INCLUDE_DIRS: uncomment this if you package contains header files 34 | ## LIBRARIES: libraries you create in this project that dependent projects also need 35 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 36 | ## DEPENDS: system dependencies of this project that dependent projects also need 37 | catkin_package( 38 | INCLUDE_DIRS include 39 | # LIBRARIES qt4rosgui 40 | # CATKIN_DEPENDS roscpp std_msgs 41 | # DEPENDS system_lib 42 | ) 43 | 44 | ########### 45 | ## Build ## 46 | ########### 47 | 48 | ## Specify additional locations of header files 49 | ## Your package locations should be listed before other locations 50 | include_directories( 51 | include 52 | ${CMAKE_CURRENT_BINARY_DIR}/.. 53 | /usr/included/qt4 54 | ) 55 | 56 | 57 | ## Declare a C++ executable 58 | add_executable(qt4rosgui_node src/main.cpp src/qt4test.cpp ${MOC} ${UIC}) 59 | target_link_libraries(qt4rosgui_node ${catkin_LIBRARIES} ${QT_LIBRARIES}) 60 | 61 | -------------------------------------------------------------------------------- /vizlib_test/src/vizlib_test.cpp: -------------------------------------------------------------------------------- 1 | #include "vizlib_test.h" 2 | #include 3 | #include 4 | #include 5 | 6 | VizlibTest::VizlibTest(int argc, char **argv, QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::VizlibTest) 9 | { 10 | ui->setupUi(this); 11 | 12 | init_ros(argc, argv); 13 | 14 | render_panel_ = new rviz::RenderPanel; 15 | manager_ = new rviz::VisualizationManager( render_panel_ ); 16 | render_panel_->initialize( manager_->getSceneManager(), manager_ ); 17 | manager_->initialize(); 18 | //manager_->startUpdate(); 19 | 20 | ui->verticalLayout->addWidget( render_panel_ ); 21 | 22 | QObject::connect(ui->pushButton_start, SIGNAL(clicked()), this, SLOT(slot_btn_display())); 23 | QObject::connect(ui->pushButton_quit, SIGNAL(clicked()), this, SLOT(slot_btn_quit())); 24 | } 25 | 26 | VizlibTest::~VizlibTest() 27 | { 28 | delete ui; 29 | } 30 | 31 | void VizlibTest::init_ros(int argc, char **argv) 32 | { 33 | ros::init(argc, argv, "vizlib_test", ros::init_options::AnonymousName); 34 | } 35 | 36 | void VizlibTest::slot_btn_display() 37 | { 38 | static int i = 0; 39 | 40 | if(i%2 == 0) 41 | { 42 | manager_->removeAllDisplays(); 43 | 44 | rviz::Display *map = manager_->createDisplay( "rviz/Map", "adjustable map", true ); 45 | map->subProp( "Topic" )->setValue( "/map" ); 46 | 47 | rviz::Display *robot = manager_->createDisplay( "rviz/RobotModel", "adjustable robot", true ); 48 | robot->subProp( "Robot Description" )->setValue( "robot_description" ); 49 | 50 | rviz::Display *laser = manager_->createDisplay( "rviz/LaserScan", "adjustable scan", true ); 51 | laser->subProp( "Topic" )->setValue( "/scan" ); 52 | laser->subProp( "Size (m)" )->setValue( "0.1" ); 53 | 54 | manager_->startUpdate(); 55 | ui->pushButton_start->setText("NonDisplay"); 56 | } 57 | else if(i%2 == 1) 58 | { 59 | manager_->stopUpdate(); 60 | ui->pushButton_start->setText("Display"); 61 | } 62 | i++; 63 | } 64 | 65 | void VizlibTest::slot_btn_quit() 66 | { 67 | this->close(); 68 | } 69 | -------------------------------------------------------------------------------- /qt4rosgui/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | qt4rosgui 4 | 0.0.0 5 | The qt4rosgui package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | 45 | roscpp> 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /test_gui/include/test_gui/main_window.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/test_gui/main_window.hpp 3 | * 4 | * @brief Qt based gui for test_gui. 5 | * 6 | * @date February 2018 7 | **/ 8 | 9 | #ifndef test_gui_MAIN_WINDOW_H 10 | #define test_gui_MAIN_WINDOW_H 11 | 12 | /***************************************************************************** 13 | ** Includes 14 | *****************************************************************************/ 15 | #include 16 | #include "ui_main_window.h" 17 | #include "qnode.hpp" 18 | 19 | /***************************************************************************** 20 | ** Namespace 21 | *****************************************************************************/ 22 | namespace test_gui 23 | { 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 | { 33 | Q_OBJECT 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_button_connect_clicked(bool check ); 49 | void on_checkbox_use_environment_stateChanged(int state); 50 | 51 | /****************************************** 52 | ** Manual connections 53 | *******************************************/ 54 | void updateLoggingView(); // no idea why this can't connect automatically 55 | void updateLogListen(); 56 | 57 | private: 58 | Ui::MainWindowDesign ui; 59 | QNode qnode; 60 | }; 61 | 62 | } // namespace test_gui 63 | 64 | #endif // test_gui_MAIN_WINDOW_H 65 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/dyn_cfg_gui.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/dyn_cfg_gui.h 3 | * 4 | * @brief Qt based gui for DynRecfgWidget. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef DYNRECFGWIDGET_H 9 | #define DYNRECFGWIDGET_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "dyn_cfg_gui/ui_dyn_cfg_gui.h" 19 | #include 20 | #include 21 | #include 22 | #include "editor_bool.h" 23 | #include "editor_number.h" 24 | #include "editor_decimal.h" 25 | #include "editor_string.h" 26 | #include "rosthread.h" 27 | #include "param_widget.h" 28 | 29 | /***************************************************************************** 30 | ** Interface [DynRecfgWidget] 31 | *****************************************************************************/ 32 | /** 33 | * @brief Qt central, all operations relating to the view part here. 34 | */ 35 | class DynRecfgWidget : public QWidget 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | DynRecfgWidget(int argc, char **argv, QWidget *parent = 0); 41 | ~DynRecfgWidget(); 42 | 43 | void ros_init(int argc, char **argv); 44 | 45 | private slots: 46 | void slot_btn_refresh(); 47 | void slot_btn_collapse(); 48 | void slot_btn_expand(); 49 | void slot_selected_node(const QModelIndex &index); 50 | void slot_txt_filter(const QString &text); 51 | void slot_addparamui(const QString &topicname, const RecfgMsgVal &msg); 52 | void slot_removenode(QString name); 53 | 54 | private: 55 | bool find_dynmaic_services(std::vector &srvls); 56 | void rosrunthread(); 57 | 58 | private: 59 | Ui::DynRecfgWidget ui; 60 | QStandardItemModel *m_model; 61 | QSortFilterProxyModel *m_proxyModel; 62 | QString selected_node__; 63 | QStringList nodelist__; 64 | bool isSelectedNode__; 65 | RosThread *m_rosthread; 66 | QMap m_paramMap; 67 | }; 68 | 69 | #endif // DYNRECFGWIDGET_H 70 | -------------------------------------------------------------------------------- /qt_ros_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.11) 2 | project(qt_ros_test) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED COMPONENTS 8 | roscpp 9 | std_msgs 10 | ) 11 | 12 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 13 | set(CMAKE_AUTOMOC ON) 14 | set(CMAKE_AUTOUIC ON) 15 | set(CMAKE_AUTORCC ON) 16 | 17 | ## System dependencies are found with CMake's conventions 18 | # find_package(Boost REQUIRED COMPONENTS system) 19 | find_package(Qt5Widgets REQUIRED) 20 | qt5_wrap_cpp(MOC src/qt_ros_test.h) 21 | qt5_wrap_ui(UIC src/qt_ros_test.ui) 22 | 23 | ## Uncomment this if the package has a setup.py. This macro ensures 24 | ## modules and global scripts declared therein get installed 25 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 26 | # catkin_python_setup() 27 | 28 | 29 | ################################### 30 | ## catkin specific configuration ## 31 | ################################### 32 | ## The catkin_package macro generates cmake config files for your package 33 | ## Declare things to be passed to dependent projects 34 | ## INCLUDE_DIRS: uncomment this if you package contains header files 35 | ## LIBRARIES: libraries you create in this project that dependent projects also need 36 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 37 | ## DEPENDS: system dependencies of this project that dependent projects also need 38 | catkin_package( 39 | INCLUDE_DIRS include 40 | # LIBRARIES client_plugin 41 | CATKIN_DEPENDS roscpp std_msgs 42 | # DEPENDS system_lib 43 | ) 44 | 45 | ########### 46 | ## Build ## 47 | ########### 48 | 49 | ## Specify additional locations of header files 50 | ## Your package locations should be listed before other locations 51 | include_directories( 52 | INCLUDE_DIRS include 53 | ${CMAKE_CURRENT_BINARY_DIR}/.. 54 | ${catkin_INCLUDE_DIRS} 55 | ) 56 | 57 | ## Declare a C++ executable 58 | add_executable(${PROJECT_NAME}_node src/main.cpp src/qt_ros_test.cpp src/qt_ros_test.h src/qt_ros_test.ui) 59 | target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} Qt5::Widgets) 60 | 61 | -------------------------------------------------------------------------------- /vizlib_test/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vizlib_test 4 | 0.0.0 5 | The vizlib_test package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | rviz 45 | roscpp 46 | rviz 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ros_cv_gui/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ros_cv_gui 4 | 0.0.0 5 | The ros_cv_gui package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | std_msgs 45 | roscpp 46 | std_msgs 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /dyn_cfg_gui/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | dyn_cfg_gui 4 | 0.0.0 5 | The dyn_cfg_gui package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | std_msgs 45 | roscpp 46 | std_msgs 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /qt_ros_test/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | qt_ros_test 4 | 0.0.0 5 | The qt_ros_test package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | std_msgs 45 | roscpp 46 | std_msgs 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /dyn_cfg_gui/include/editor_number.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/editor_number.h 3 | * 4 | * @brief Qt based gui for EditorNumber. 5 | * 6 | * @date July 2018 7 | **/ 8 | #ifndef EDITORNUMBER_H 9 | #define EDITORNUMBER_H 10 | 11 | /***************************************************************************** 12 | ** Includes 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | #include 17 | #include "dyn_cfg_gui/ui_editor_number.h" 18 | 19 | /***************************************************************************** 20 | ** Interface [EditorNumber] 21 | *****************************************************************************/ 22 | /** 23 | * @brief Qt central, all operations relating to the view part here. 24 | */ 25 | class EditorNumber : public QWidget 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | struct ParamDesc 31 | { 32 | std::string name; 33 | int value; 34 | int minvalue; 35 | int maxvalue; 36 | std::string describe; 37 | 38 | ParamDesc() 39 | { 40 | name = ""; 41 | value = 0; minvalue = -99; maxvalue = 99; 42 | describe = ""; 43 | } 44 | }; 45 | 46 | EditorNumber(ParamDesc desc, QWidget *parent = 0) 47 | : QWidget(parent), m_desc(desc) 48 | { 49 | ui.setupUi(this); 50 | 51 | ui._paramname_label->setText(QString::fromStdString(m_desc.name)); 52 | ui._min_val_label->setText(QString::number(m_desc.minvalue)); 53 | ui._max_val_label->setText(QString::number(m_desc.maxvalue)); 54 | ui._slider_horizontal->setValue(m_desc.value); 55 | 56 | int sliderVal = ui._slider_horizontal->value(); 57 | ui._paramval_lineEdit->setText(QString::number(sliderVal)); 58 | 59 | this->setToolTip(QString::fromStdString(m_desc.describe)); 60 | 61 | QObject::connect(ui._slider_horizontal, SIGNAL(valueChanged(int)), this, SLOT(slot_slider_changed(int))); 62 | } 63 | 64 | ~EditorNumber(){} 65 | 66 | private slots: 67 | void slot_slider_changed(int value) 68 | { 69 | ui._paramval_lineEdit->setText(QString::number(value)); 70 | } 71 | 72 | private: 73 | Ui::EditorNumber ui; 74 | ParamDesc m_desc; 75 | }; 76 | 77 | #endif // EDITORNUMBER_H 78 | -------------------------------------------------------------------------------- /test_gui/include/test_gui/qnode.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /include/test_gui/qnode.hpp 3 | * 4 | * @brief Communications central! 5 | * 6 | * @date February 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Ifdefs 10 | *****************************************************************************/ 11 | #ifndef test_gui_QNODE_HPP_ 12 | #define test_gui_QNODE_HPP_ 13 | 14 | /***************************************************************************** 15 | ** Includes 16 | *****************************************************************************/ 17 | #include 18 | #include "std_msgs/String.h" 19 | #include 20 | #include 21 | #include 22 | 23 | /***************************************************************************** 24 | ** Namespaces 25 | *****************************************************************************/ 26 | namespace test_gui 27 | { 28 | 29 | /***************************************************************************** 30 | ** Class 31 | *****************************************************************************/ 32 | class QNode : public QThread 33 | { 34 | Q_OBJECT 35 | public: 36 | QNode(int argc, char** argv); 37 | virtual ~QNode(); 38 | bool init(); 39 | bool init(const std::string &master_url, const std::string &host_url); 40 | void run(); 41 | 42 | /********************* 43 | ** Logging 44 | **********************/ 45 | enum LogLevel 46 | { 47 | Debug, 48 | Info, 49 | Warn, 50 | Error, 51 | Fatal 52 | }; 53 | 54 | QStringListModel* loggingModel() 55 | {return &logging_model;} 56 | void log( const LogLevel &level, const std::string &msg); 57 | 58 | void RecvTopicCallback(const std_msgs::StringConstPtr &msg); 59 | QStringListModel* loggingModelLis() 60 | {return &logging_listen;} 61 | void log_listen(const LogLevel &level, const std::string &msg); 62 | 63 | Q_SIGNALS: 64 | void loggingUpdated(); 65 | void loggingListen(); 66 | void rosShutdown(); 67 | 68 | private: 69 | int init_argc; 70 | char** init_argv; 71 | ros::Publisher chatter_publisher; 72 | ros::Subscriber chatter_subscriber; 73 | QStringListModel logging_model; 74 | QStringListModel logging_listen; 75 | }; 76 | 77 | } // namespace test_gui 78 | 79 | #endif /* test_gui_QNODE_HPP_ */ 80 | -------------------------------------------------------------------------------- /rqt_mypkg/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | rqt_mypkg 4 | 0.0.0 5 | The rqt_mypkg package 6 | 7 | 8 | 9 | 10 | hans 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | catkin 43 | roscpp 44 | rqt_gui 45 | rqt_gui_cpp 46 | std_msgs 47 | roscpp 48 | rqt_gui 49 | rqt_gui_cpp 50 | std_msgs 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ros_cv_gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(ros_cv_gui) 3 | 4 | #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 5 | 6 | ## Find catkin macros and libraries 7 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 8 | ## is used, also find other catkin packages 9 | find_package(catkin REQUIRED COMPONENTS 10 | roscpp 11 | std_msgs 12 | cv_bridge 13 | image_transport 14 | sensor_msgs 15 | ) 16 | 17 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 18 | set(CMAKE_AUTOMOC ON) 19 | set(CMAKE_AUTOUIC ON) 20 | set(CMAKE_AUTORCC ON) 21 | 22 | ## System dependencies are found with CMake's conventions 23 | # find_package(Boost REQUIRED COMPONENTS system) 24 | find_package(OpenCV REQUIRED) 25 | find_package(Qt5Widgets REQUIRED) 26 | QT5_WRAP_CPP(myMOC include/${PROJECT_NAME}/mydemo.h) 27 | QT5_WRAP_UI(myUIC ui/mydemo.ui) 28 | 29 | 30 | ## Uncomment this if the package has a setup.py. This macro ensures 31 | ## modules and global scripts declared therein get installed 32 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 33 | # catkin_python_setup() 34 | 35 | ################################### 36 | ## catkin specific configuration ## 37 | ################################### 38 | ## The catkin_package macro generates cmake config files for your package 39 | ## Declare things to be passed to dependent projects 40 | ## INCLUDE_DIRS: uncomment this if you package contains header files 41 | ## LIBRARIES: libraries you create in this project that dependent projects also need 42 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 43 | ## DEPENDS: system dependencies of this project that dependent projects also need 44 | catkin_package( 45 | # INCLUDE_DIRS include 46 | # LIBRARIES ros_dynamic_test 47 | CATKIN_DEPENDS roscpp std_msgs 48 | # DEPENDS system_lib 49 | ) 50 | 51 | ########### 52 | ## Build ## 53 | ########### 54 | 55 | link_directories(/usr/local/lib) 56 | 57 | ## Specify additional locations of header files 58 | ## Your package locations should be listed before other locations 59 | include_directories( 60 | include 61 | ${catkin_INCLUDE_DIRS} 62 | ${CMAKE_CURRENT_BINARY_DIR}/.. 63 | ${OpenCV_INCLUDE_DIRS} 64 | /usr/local/include/yaml-cpp 65 | ) 66 | 67 | 68 | ## Declare a C++ executable 69 | add_executable(${PROJECT_NAME}_node src/main src/mydemo.cpp include/${PROJECT_NAME}/mydemo.h 70 | ui/mydemo.ui) 71 | target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${OpenCV_LIBS} Qt5::Widgets yaml-cpp) 72 | 73 | -------------------------------------------------------------------------------- /test_gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.0) 6 | project(test_gui) 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 | INCLUDE_DIRS include 20 | # LIBRARIES my_msgs 21 | CATKIN_DEPENDS roscpp 22 | ) 23 | 24 | ############################################################################## 25 | # Qt Environment 26 | ############################################################################## 27 | 28 | # this comes from qt_build's qt-ros.cmake which is automatically 29 | # included via the dependency call in package.xml 30 | rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here 31 | 32 | ############################################################################## 33 | # Sections 34 | ############################################################################## 35 | 36 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 37 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 38 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/test_gui/*.hpp) 39 | 40 | QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 41 | QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS}) 42 | QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}) 43 | 44 | ############################################################################## 45 | # Sources 46 | ############################################################################## 47 | 48 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 49 | 50 | ############################################################################## 51 | # Binaries 52 | ############################################################################## 53 | 54 | add_executable(test_gui ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP} include/${PROJECT_NAME}/qnode.hpp) 55 | target_link_libraries(test_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}) 56 | install(TARGETS test_gui RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) 57 | 58 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/editor_decimal.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorDecimal 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 50 11 | 12 | 13 | 14 | 15 | 300 16 | 20 17 | 18 | 19 | 20 | Param 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | param_name 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 30 49 | 0 50 | 51 | 52 | 53 | min 54 | 55 | 56 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 150 65 | 0 66 | 67 | 68 | 69 | -99.989999999999995 70 | 71 | 72 | 0.010000000000000 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 30 81 | 0 82 | 83 | 84 | 85 | max 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /vizlib_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(vizlib_test) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED COMPONENTS 8 | roscpp 9 | rviz 10 | ) 11 | 12 | ## System dependencies are found with CMake's conventions 13 | # find_package(Boost REQUIRED COMPONENTS system) 14 | find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui) 15 | include(${QT_USE_FILE}) 16 | set(qtlib ${QT_LIBRARIES}) 17 | 18 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.h) 19 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*.ui) 20 | 21 | QT4_WRAP_CPP(QT_MOC_H ${QT_MOC}) 22 | QT4_WRAP_UI(QT_FORMS_H ${QT_FORMS}) 23 | 24 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 25 | 26 | ## Uncomment this if the package has a setup.py. This macro ensures 27 | ## modules and global scripts declared therein get installed 28 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 29 | # catkin_python_setup() 30 | 31 | ################################### 32 | ## catkin specific configuration ## 33 | ################################### 34 | ## The catkin_package macro generates cmake config files for your package 35 | ## Declare things to be passed to dependent projects 36 | ## INCLUDE_DIRS: uncomment this if you package contains header files 37 | ## LIBRARIES: libraries you create in this project that dependent projects also need 38 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 39 | ## DEPENDS: system dependencies of this project that dependent projects also need 40 | catkin_package( 41 | # INCLUDE_DIRS include 42 | # LIBRARIES vizlib_test 43 | # CATKIN_DEPENDS roscpp rviz 44 | # DEPENDS system_lib 45 | ) 46 | 47 | ########### 48 | ## Build ## 49 | ########### 50 | 51 | ## Specify additional locations of header files 52 | ## Your package locations should be listed before other locations 53 | include_directories( 54 | include 55 | ${CMAKE_CURRENT_BINARY_DIR}/.. 56 | ${catkin_INCLUDE_DIRS} 57 | ) 58 | 59 | ## Declare a C++ library 60 | # add_library(vizlib_test 61 | # src/${PROJECT_NAME}/vizlib_test.cpp 62 | # ) 63 | 64 | ## Add cmake target dependencies of the library 65 | ## as an example, code may need to be generated before libraries 66 | ## either from message generation or dynamic reconfigure 67 | # add_dependencies(vizlib_test ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 68 | 69 | ## Declare a C++ executable 70 | add_executable(vizlib_test_node src/main.cpp ${QT_SOURCES} 71 | ${QT_MOC_H} ${QT_FORMS_H} ${QT_RESOURCES_CPP}) 72 | target_link_libraries(vizlib_test_node ${catkin_LIBRARIES} ${qtlib}) 73 | 74 | ## Add cmake target dependencies of the executable 75 | ## same as for the library above 76 | # add_dependencies(vizlib_test_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /dyn_cfg_gui/src/param_widget.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/param_widget.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date July 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "../include/param_widget.h" 16 | 17 | /***************************************************************************** 18 | ** Implementation [ParamWidget] 19 | *****************************************************************************/ 20 | ParamWidget::ParamWidget(QString title, QWidget *parent) 21 | : QWidget(parent), m_nodename(title) 22 | { 23 | m_vLayout = new QVBoxLayout; 24 | QHBoxLayout *hLayout = new QHBoxLayout; 25 | m_savebtn = new QPushButton(QIcon(QString(":/images/save.png")), ""); 26 | m_loadbtn = new QPushButton(QIcon(QString(":/images/open.png")), ""); 27 | m_closebtn = new QToolButton(); 28 | m_closebtn->setIcon(QIcon(QString(":/images/close.png"))); 29 | 30 | QLabel *label = new QLabel(); 31 | QFont font("Trebuchet MS, Bold"); 32 | font.setUnderline(true); 33 | font.setBold(true); 34 | label->setFont(font); 35 | label->setText(title.remove("/parameter_updates")); 36 | 37 | hLayout->addWidget(m_savebtn); 38 | hLayout->addWidget(m_loadbtn); 39 | hLayout->addStretch(); 40 | hLayout->addWidget(label); 41 | hLayout->addStretch(); 42 | hLayout->addWidget(m_closebtn); 43 | 44 | m_vLayout->addLayout(hLayout); 45 | this->setLayout(m_vLayout); 46 | 47 | QObject::connect(m_savebtn, SIGNAL(clicked()), this, SLOT(slot_btn_save())); 48 | QObject::connect(m_loadbtn, SIGNAL(clicked()), this, SLOT(slot_btn_load())); 49 | QObject::connect(m_closebtn, SIGNAL(clicked()), this, SLOT(slot_btn_close())); 50 | 51 | m_widgetLS.clear(); 52 | } 53 | 54 | ParamWidget::~ParamWidget() 55 | { 56 | 57 | } 58 | 59 | void ParamWidget::addCustomLayout(QWidget *widget) 60 | { 61 | m_vLayout->addWidget(widget); 62 | m_widgetLS.append(widget); 63 | } 64 | 65 | void ParamWidget::rmCustomLayout() 66 | { 67 | foreach (QWidget *widget, m_widgetLS) 68 | { 69 | m_vLayout->removeWidget(widget); 70 | delete widget; 71 | widget = NULL; 72 | } 73 | m_widgetLS.clear(); 74 | } 75 | 76 | void ParamWidget::slot_btn_save() 77 | { 78 | QString filename = QFileDialog::getSaveFileName(this, tr("Save parmeters to file..."), ".", 79 | tr("YAML files {.yaml} (*.yaml)")); 80 | if(!filename.isEmpty()) 81 | {} 82 | } 83 | 84 | void ParamWidget::slot_btn_load() 85 | { 86 | QString filename = QFileDialog::getOpenFileName(this, tr("Load from File"), ".", 87 | tr("YAML files {.yaml} (*.yaml)")); 88 | if(!filename.isEmpty()) 89 | {} 90 | } 91 | 92 | void ParamWidget::slot_btn_close() 93 | { 94 | emit signal_removenode(m_nodename); 95 | this->close(); 96 | } 97 | -------------------------------------------------------------------------------- /qt_ros_test/src/qt_ros_test.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Qt_Ros_Test 4 | 5 | 6 | 7 | 0 8 | 0 9 | 450 10 | 250 11 | 12 | 13 | 14 | Qt_Ros_Test 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Qt::Vertical 25 | 26 | 27 | 28 | 20 29 | 40 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Publisher: 40 | 41 | 42 | 43 | 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Qt::Vertical 56 | 57 | 58 | 59 | 20 60 | 40 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Qt::Horizontal 71 | 72 | 73 | 74 | 40 75 | 20 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 20 84 | 85 | 86 | Qt::Vertical 87 | 88 | 89 | 90 | 91 | 92 | 93 | Qt::Horizontal 94 | 95 | 96 | 97 | 40 98 | 20 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /ros_cmake/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 372 10 | 294 11 | 12 | 13 | 14 | QWidget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Qt::Vertical 23 | 24 | 25 | 26 | 20 27 | 40 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Start 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Quit 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Qt::Vertical 67 | 68 | 69 | 70 | 20 71 | 40 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Publisher data: 82 | 83 | 84 | 85 | 86 | 87 | 88 | false 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | Qt::Vertical 98 | 99 | 100 | 101 | 20 102 | 40 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /dyn_cfg_gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(dyn_cfg_gui) 3 | 4 | ## Add support for C++11, supported in ROS Kinetic and newer 5 | add_definitions(-std=c++11) 6 | add_definitions(-Wall) 7 | add_definitions(-O0) 8 | add_definitions(-g) 9 | 10 | ## Find catkin macros and libraries 11 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 12 | ## is used, also find other catkin packages 13 | find_package(catkin REQUIRED COMPONENTS 14 | roscpp 15 | dynamic_reconfigure 16 | ) 17 | 18 | ## System dependencies are found with CMake's conventions 19 | find_package(Boost REQUIRED) 20 | find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets) # Qt Environment 21 | 22 | 23 | ## Uncomment this if the package has a setup.py. This macro ensures 24 | ## modules and global scripts declared therein get installed 25 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 26 | # catkin_python_setup() 27 | 28 | 29 | ################################### 30 | ## catkin specific configuration ## 31 | ################################### 32 | ## The catkin_package macro generates cmake config files for your package 33 | ## Declare things to be passed to dependent projects 34 | ## INCLUDE_DIRS: uncomment this if you package contains header files 35 | ## LIBRARIES: libraries you create in this project that dependent projects also need 36 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 37 | ## DEPENDS: system dependencies of this project that dependent projects also need 38 | catkin_package( 39 | INCLUDE_DIRS include 40 | # LIBRARIES dyn_cfg_gui 41 | # CATKIN_DEPENDS other_catkin_pkg 42 | # DEPENDS system_lib 43 | ) 44 | 45 | ########### 46 | ## Build ## 47 | ########### 48 | 49 | ## Specify additional locations of header files 50 | ## Your package locations should be listed before other locations 51 | include_directories( 52 | include 53 | ${CMAKE_CURRENT_BINARY_DIR}/.. 54 | ${catkin_LIBRARY_DIRS} 55 | ) 56 | 57 | ############################################################################## 58 | # Sections 59 | ############################################################################## 60 | file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/*.h) 61 | file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui) 62 | file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc) 63 | 64 | QT5_WRAP_CPP(QT_MOC_H ${QT_MOC}) 65 | QT5_WRAP_UI(QT_FORMS_H ${QT_FORMS}) 66 | QT5_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) 67 | 68 | ############################################################################## 69 | # Sources 70 | ############################################################################## 71 | file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp) 72 | 73 | ## Declare a C++ library 74 | # add_library(dyn_cfg_gui 75 | # src/${PROJECT_NAME}/dyn_cfg_gui.cpp 76 | # ) 77 | 78 | ## Add cmake target dependencies of the library 79 | ## as an example, code may need to be generated before libraries 80 | ## either from message generation or dynamic reconfigure 81 | # add_dependencies(dyn_cfg_gui ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 82 | 83 | ## Declare a C++ executable 84 | ## Specify libraries to link a library or executable target against 85 | add_executable(${PROJECT_NAME} ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_H} ${QT_MOC_H}) 86 | target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} Qt5::Core Qt5::Gui Qt5::Widgets) 87 | 88 | ## Add cmake target dependencies of the executable 89 | ## same as for the library above 90 | # add_dependencies(dyn_cfg_gui_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 91 | 92 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/editor_number.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EditorNumber 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 50 11 | 12 | 13 | 14 | 15 | 300 16 | 20 17 | 18 | 19 | 20 | Param 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | param_name 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 30 49 | 0 50 | 51 | 52 | 53 | min 54 | 55 | 56 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 0 65 | 0 66 | 67 | 68 | 69 | 70 | 130 71 | 0 72 | 73 | 74 | 75 | -99 76 | 77 | 78 | 1 79 | 80 | 81 | Qt::Horizontal 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 30 90 | 0 91 | 92 | 93 | 94 | max 95 | 96 | 97 | 98 | 99 | 100 | 101 | false 102 | 103 | 104 | 105 | 0 106 | 0 107 | 108 | 109 | 110 | 111 | 75 112 | 20 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /rqt_mypkg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.11) 2 | project(rqt_mypkg) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED COMPONENTS 8 | roscpp 9 | rqt_gui 10 | rqt_gui_cpp 11 | std_msgs 12 | ) 13 | 14 | ## System dependencies are found with CMake's conventions 15 | # find_package(Boost REQUIRED COMPONENTS system) 16 | if("${qt_gui_cpp_USE_QT_MAJOR_VERSION} " STREQUAL "5 ") 17 | find_package(Qt5Widgets REQUIRED) 18 | else() 19 | find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED) 20 | include(${QT_USE_FILE}) 21 | endif() 22 | 23 | ## Uncomment this if the package has a setup.py. This macro ensures 24 | ## modules and global scripts declared therein get installed 25 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 26 | catkin_python_setup() 27 | 28 | 29 | ################################### 30 | ## catkin specific configuration ## 31 | ################################### 32 | ## The catkin_package macro generates cmake config files for your package 33 | ## Declare things to be passed to dependent projects 34 | ## INCLUDE_DIRS: uncomment this if you package contains header files 35 | ## LIBRARIES: libraries you create in this project that dependent projects also need 36 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 37 | ## DEPENDS: system dependencies of this project that dependent projects also need 38 | catkin_package( 39 | # INCLUDE_DIRS include 40 | LIBRARIES ${PROJECT_NAME} 41 | CATKIN_DEPENDS roscpp rqt_gui rqt_gui_cpp std_msgs 42 | # DEPENDS system_lib 43 | ) 44 | 45 | set (rqt_mypkg_cpp_SRCS 46 | src/my_plugin.cpp 47 | ) 48 | set(rqt_mypkg_cpp_HDRS 49 | include/my_plugin.h 50 | ) 51 | set(rqt_mypkg_cpp_UIS 52 | ui/my_plugin.ui 53 | ) 54 | 55 | if("${qt_gui_cpp_USE_QT_MAJOR_VERSION}" STREQUAL "5") 56 | qt5_wrap_cpp(rqt_mypkg_cpp_MOCS ${rqt_mypkg_cpp_HDRS}) 57 | qt5_wrap_ui(rqt_mypkg_cpp_UIS_H ${rqt_mypkg_cpp_UIS}) 58 | else() 59 | qt4_wrap_cpp(rqt_mypkg_cpp_MOCS ${rqt_mypkg_cpp_HDRS}) 60 | qt4_wrap_ui(rqt_mypkg_cpp_UIS_H ${rqt_mypkg_cpp_UIS}) 61 | endif() 62 | 63 | ## Specify additional locations of header files 64 | ## Your package locations should be listed before other locations 65 | # include_directories(include) 66 | include_directories( 67 | include 68 | ${CMAKE_CURRENT_BINARY_DIR}/.. 69 | ${catkin_INCLUDE_DIRS} 70 | ) 71 | 72 | ## Declare a C++ library 73 | add_library(${PROJECT_NAME} 74 | ${rqt_mypkg_cpp_SRCS} 75 | ${rqt_mypkg_cpp_MOCS} 76 | ${rqt_mypkg_cpp_UIS_H} 77 | ) 78 | 79 | ## Specify libraries to link a library or executable target against 80 | target_link_libraries(${PROJECT_NAME} 81 | ${catkin_LIBRARIES} 82 | ) 83 | if("${qt_gui_cpp_USE_QT_MAJOR_VERSION}" STREQUAL "5") 84 | target_link_libraries(${PROJECT_NAME} Qt5::Widgets) 85 | else() 86 | target_link_libraries(${PROJECT_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) 87 | endif() 88 | 89 | ############# 90 | ## Install ## 91 | ############# 92 | 93 | ## Mark other files for installation (e.g. launch and bag files, etc.) 94 | install(FILES 95 | plugin.xml 96 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 97 | ) 98 | 99 | ## Mark executables and/or libraries for installation 100 | install(TARGETS ${PROJECT_NAME} 101 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 102 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 103 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 104 | ) 105 | 106 | catkin_install_python(PROGRAMS scripts/rqt_mypkg 107 | DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} 108 | ) 109 | 110 | ## Mark cpp header files for installation 111 | install(DIRECTORY include 112 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 113 | ) 114 | 115 | -------------------------------------------------------------------------------- /pyqt_gui/ui/pygui.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PyGUI 4 | 5 | 6 | 7 | 0 8 | 0 9 | 564 10 | 148 11 | 12 | 13 | 14 | PyQtGUI 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Qt::Horizontal 25 | 26 | 27 | 28 | 40 29 | 20 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | publiser 38 | 39 | 40 | 41 | 42 | 43 | 44 | Qt::Horizontal 45 | 46 | 47 | 48 | 40 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | quit 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | 68 | 40 69 | 20 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Qt::Horizontal 82 | 83 | 84 | 85 | 40 86 | 20 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | false 95 | 96 | 97 | TextLabel 98 | 99 | 100 | 101 | 102 | 103 | 104 | 20 105 | 106 | 107 | Qt::Horizontal 108 | 109 | 110 | 111 | 112 | 113 | 114 | Qt::Horizontal 115 | 116 | 117 | 118 | 40 119 | 20 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | ## Author 2 | - **Welin** 2018.02.23 3 | - modified in 2018.10.31 4 | - update in 2021.10.14 5 | 6 | ## Overview 7 | In the project, so many ways are provided to implement ROS-Qt GUI, namely rqt, such as qt4, qt5, pyqt4. Also ROS could be treated as a open-source library to extend some other module by using CMAKE, not just using catkin_make/rosbuild, to make the development more flexible. 8 | 9 | ## Description 10 | * In this project, three approaches are provided to implement ROS&Qt GUI and another two projects for PyQt GUI. 11 | * In the test_gui package, it just modified the example in catkin_create_qt_pkg depending on qt_build using Qt4 library. 12 | * In the rqt_mypkg package, it is the C++ rqt_plugin test depending on rqt_gui_cpp. 13 | * In the qt_ros_test package, it combines ROS with Qt5 library. 14 | 15 | Remeber to add Qt install environment to the CMAKE_PRFIX_PATH such as `set(Qt5_DIR "path/to/cmake/Qt5")` before `find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)` if you encounter the following problem. 16 | 17 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/error.PNG) 18 | 19 | 20 | 21 | The above three are written in C++ programmer. 22 | The following two below are written in Python. 23 | 24 | * In the ros_pyqt package, it uses PyQt (PyQt4) to implement the GUI. 25 | * In the pyqt_gui package, it uses PyQt and python_qt_binding to implement the GUI. 26 | 27 | 28 | In the qt4rosgui package, it uses Qt4 libraries to implement the ROS-GUI **NOT** depends on qt-ros package (namely command `catkin_create_qt_pkg`). 29 | 30 | In the librviz_test package, it uses librviz to build a visualizer tool for display using Qt4. 31 | 32 | For more complicated examples, please see the package dyn_cfg_gui or ros_cv_gui, it is the implementation for rqt_reconfigure and some image processing by using OpenCV and Qt5. Also see [ROS_dynamic_reconfig](https://github.com/WelinLee/ROS_dynamic_reconfig "ROS_dynamic_reconfig"), [ros_cv_qt_gui](https://github.com/WelinLee/ros_cv_qt_gui) and [ros_opencv_pro](https://github.com/WelinLee/ROS_OPENCV_PRO) for detail. 33 | 34 | ## TODO 35 | ```sh 36 | $ mkdir -p catkin_ws/src 37 | $ cd catkin_ws/src 38 | ``` 39 | 40 | git clone the project from the corrent URL 41 | 42 | ```sh 43 | $ cd .. 44 | $ catkin_make 45 | $ source devel/setup.bash 46 | ``` 47 | 48 | Then, `rosrun test_gui test_gui` or `rosrun qt_ros_test qt_ros_test_node` or `rosrun qt4rosgui qt4rosgui_node`. The effect is below: 49 | 50 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/test_gui.png) 51 | 52 | To run the rqt_mypkg, just open rqt (`rosrun rqt_gui rqt_gui`), and the "rqt first C++ plugin" could be found in the Plugins menu. The effect is below: 53 | 54 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/rqt_mypkg.png) 55 | 56 | To run ros_pyqt *or* pyqt_gui, just using the command `python ros_pyqt` or `python pyqt_gui`. The effect is below: 57 | 58 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/pyqt_gui.png) 59 | 60 | If you have a mobile robot such as TurtleBot or else, the slam navigation status could be shown as below. Just `run ros vizlib_test vizlib_test_node`. 61 | 62 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/librviz_gui.jpg) 63 | 64 | Using `rosrun dyn_cfg_gui dyn_cfg_gui` command, the effect is shown below. 65 | 66 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/rqt_recfg.png) 67 | 68 | The ros&opencv example is also provided as shown below. 69 | ```sh 70 | $ rosrun ros_cv_gui ros_cv_gui_node 71 | ``` 72 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/ros_cv_gui.png) 73 | 74 | 75 | 76 | ### **Especially**, 77 | the ros_cmake package could be separated in a individual directory, not using catkin_make/rosbuild. 78 | ```sh 79 | $ mkdir build 80 | $ cd build 81 | $ cmake .. 82 | $ make 83 | $ ./ros_cmake #the executable program 84 | ``` 85 | The effect is shown below, the topic has been subscribed. Remember to open roscore at first. 86 | 87 | ![ROS_QT_GUI](https://github.com/WelinLee/ROS_QT_GUI/blob/master/docs/ros_cmake.png) 88 | 89 | 90 | 91 | Enjoy! 92 | 93 | -------------------------------------------------------------------------------- /dyn_cfg_gui/ui/dyn_cfg_gui.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DynRecfgWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 944 10 | 704 11 | 12 | 13 | 14 | DynRecfgGui 15 | 16 | 17 | 18 | :/images/icon.png:/images/icon.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Qt::Horizontal 28 | 29 | 30 | 31 | 32 | 300 33 | 16777215 34 | 35 | 36 | 37 | QFrame::StyledPanel 38 | 39 | 40 | QFrame::Raised 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Filter Key: 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | &Collapse 65 | 66 | 67 | 68 | 69 | 70 | 71 | &Expand 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | &Refresh 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | true 94 | 95 | 96 | 97 | 98 | 0 99 | 0 100 | 618 101 | 684 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | Qt::Vertical 112 | 113 | 114 | 115 | 20 116 | 40 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /qt4rosgui/ui/qt4test.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Qt4Test 4 | 5 | 6 | 7 | 0 8 | 0 9 | 374 10 | 210 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Qt::Vertical 21 | 22 | 23 | 24 | 20 25 | 40 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Qt::Horizontal 38 | 39 | 40 | 41 | 40 42 | 20 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | start 51 | 52 | 53 | 54 | 55 | 56 | 57 | quit 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | 68 | 40 69 | 20 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Qt::Vertical 80 | 81 | 82 | 83 | 20 84 | 40 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | Qt::Horizontal 95 | 96 | 97 | 98 | 40 99 | 20 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | false 108 | 109 | 110 | 111 | 112 | 113 | 114 | Qt::Horizontal 115 | 116 | 117 | 118 | 40 119 | 20 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | Qt::Vertical 132 | 133 | 134 | 135 | 20 136 | 40 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /rqt_mypkg/ui/my_plugin.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MyPluginWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 402 10 | 224 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | Form 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Qt::Vertical 31 | 32 | 33 | 34 | 20 35 | 40 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Qt::Horizontal 46 | 47 | 48 | 49 | 40 50 | 20 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Publisher 59 | 60 | 61 | 62 | 63 | 64 | 65 | Qt::Horizontal 66 | 67 | 68 | 69 | 40 70 | 20 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | Qt::Vertical 81 | 82 | 83 | 84 | 20 85 | 40 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Number value: 96 | 97 | 98 | 99 | 100 | 101 | 102 | false 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | Qt::Vertical 112 | 113 | 114 | 115 | 20 116 | 40 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | Qt::Horizontal 127 | 128 | 129 | 130 | 40 131 | 20 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 5 140 | 141 | 142 | Qt::Vertical 143 | 144 | 145 | 146 | 147 | 148 | 149 | Qt::Horizontal 150 | 151 | 152 | 153 | 40 154 | 20 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /ros_cv_gui/src/mydemo.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/ros_cv_gui/mydemo.h" 2 | #include "ros_cv_gui/ui_mydemo.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define BOXFILTER std::string("BoxFilter") 11 | #define MEANBLUR std::string("MeanBlur") 12 | #define GAUSSIANBLUR std::string("GaussianBlur") 13 | #define ORIGIANIMG std::string("Original") 14 | 15 | mydemo::mydemo(QWidget *parent) : 16 | QWidget(parent), 17 | ui(new Ui::mydemo) 18 | { 19 | ui->setupUi(this); 20 | 21 | this->setWindowTitle(QString("ROS_CV GUI")); 22 | 23 | connect(ui->pushButton_open, SIGNAL(clicked()), this, SLOT(slot_open())); 24 | connect(ui->pushButton_quit, SIGNAL(clicked()), this, SLOT(slot_quit())); 25 | connect(ui->pushButton_save, SIGNAL(clicked()), this, SLOT(slot_save())); 26 | connect(ui->radioButton, SIGNAL(toggled(bool)), this, SLOT(slot_toggle1(bool))); 27 | connect(ui->radioButton_2, SIGNAL(toggled(bool)), this, SLOT(slot_toggle2(bool))); 28 | connect(ui->radioButton_3, SIGNAL(toggled(bool)), this, SLOT(slot_toggle3(bool))); 29 | connect(ui->verticalSlider, &QSlider::valueChanged, this, &mydemo::slot_imgPro); 30 | 31 | ui->label_txt->setText(QString::fromStdString(ORIGIANIMG)); 32 | 33 | int argc = 0; char **argv = NULL; 34 | ros::init(argc, argv, "ros_cv_gui"); 35 | ros::NodeHandle nh; 36 | image_transport::ImageTransport it(nh); 37 | m_pub = it.advertise("img_proc/image", 1); 38 | 39 | } 40 | 41 | mydemo::~mydemo() 42 | { 43 | delete ui; 44 | } 45 | 46 | void mydemo::slot_open() 47 | { 48 | QString filename = QFileDialog::getOpenFileName(this, QString("OpenImage"), ".", QString("Image Files (*.jpg *.png *.bmp)")); 49 | if(filename.right(4)==".jpg"||filename.right(4)==".png"||filename.right(4)==".bmp") 50 | { 51 | m_image = cv::imread(filename.toStdString()); 52 | qDebug() << "image channels:" << m_image.channels(); 53 | imageShow(m_image); 54 | } 55 | 56 | std::string yamlfile = "/home/user/param.yaml"; 57 | YAML::Node yamlConfig = YAML::LoadFile(yamlfile); 58 | std::string str_param = yamlConfig["filter_type"].as(); 59 | int int_param = yamlConfig["value"].as(); 60 | if(BOXFILTER == str_param) 61 | { 62 | m_type = Box; 63 | ui->radioButton->setChecked(true); 64 | ui->label_txt->setText(QString::fromStdString(BOXFILTER)); 65 | } 66 | else if(MEANBLUR == str_param) 67 | { 68 | m_type = Mean; 69 | ui->radioButton_2->setChecked(true); 70 | ui->label_txt->setText(QString::fromStdString(MEANBLUR)); 71 | } 72 | else if(GAUSSIANBLUR == str_param) 73 | { 74 | m_type = Gaussian; 75 | ui->radioButton_3->setChecked(true); 76 | ui->label_txt->setText(QString::fromStdString(GAUSSIANBLUR)); 77 | } 78 | else 79 | { 80 | m_type = Original; 81 | int_param = 0; 82 | ui->label_txt->setText(QString::fromStdString(ORIGIANIMG)); 83 | } 84 | ui->verticalSlider->setValue(int_param); 85 | ui->lineEdit->setText(QString::number(int_param)); 86 | 87 | } 88 | 89 | void mydemo::slot_toggle1(bool checked) 90 | { 91 | if(checked) 92 | { 93 | m_type = Box; 94 | onBoxFilter(0); 95 | ui->verticalSlider->setValue(0); 96 | ui->lineEdit->setText(QString::number(0)); 97 | ui->label_txt->setText(QString::fromStdString(BOXFILTER)); 98 | } 99 | } 100 | 101 | void mydemo::slot_toggle2(bool checked) 102 | { 103 | if(checked) 104 | { 105 | m_type = Mean; 106 | onMeanBlur(0); 107 | ui->verticalSlider->setValue(0); 108 | ui->lineEdit->setText(QString::number(0)); 109 | ui->label_txt->setText(QString::fromStdString(MEANBLUR)); 110 | } 111 | } 112 | 113 | void mydemo::slot_toggle3(bool checked) 114 | { 115 | if(checked) 116 | { 117 | m_type = Gaussian; 118 | onGaussian(0); 119 | ui->verticalSlider->setValue(0); 120 | ui->lineEdit->setText(QString::number(0)); 121 | ui->label_txt->setText(QString::fromStdString(GAUSSIANBLUR)); 122 | } 123 | } 124 | 125 | void mydemo::slot_imgPro(int value) 126 | { 127 | ui->lineEdit->setText(QString("%1").arg(ui->verticalSlider->value())); 128 | 129 | if(!m_image.data) 130 | return; 131 | 132 | switch(m_type) 133 | { 134 | case Box: 135 | onBoxFilter(value); 136 | case Mean: 137 | onMeanBlur(value); 138 | case Gaussian: 139 | onGaussian(value); 140 | default: 141 | break; 142 | } 143 | 144 | } 145 | 146 | void mydemo::onBoxFilter(int value) 147 | { 148 | cv::Mat dstImage; 149 | cv::boxFilter(m_image, dstImage, -1, cv::Size(value+1,value+1)); 150 | imageShow(dstImage); 151 | } 152 | 153 | void mydemo::onMeanBlur(int value) 154 | { 155 | cv::Mat dstImage; 156 | cv::blur(m_image, dstImage, cv::Size(value+1,value+1), cv::Point(-1,-1)); 157 | imageShow(dstImage); 158 | } 159 | 160 | void mydemo::onGaussian(int value) 161 | { 162 | cv::Mat dstImage; 163 | cv::GaussianBlur(m_image, dstImage, cv::Size(value*2+1,value*2+1), 0, 0); 164 | imageShow(dstImage); 165 | } 166 | 167 | void mydemo::imageShow(cv::Mat matImg) 168 | { 169 | sensor_msgs::ImagePtr msg; 170 | msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", matImg).toImageMsg(); 171 | m_pub.publish(msg); 172 | 173 | cv::Mat showImg; 174 | cv::cvtColor(matImg, showImg, CV_BGR2RGB); 175 | m_qImg = QImage((const unsigned char*)(showImg.data), showImg.cols, showImg.rows, QImage::Format_RGB888); 176 | ui->label->setPixmap(QPixmap::fromImage(m_qImg)); 177 | } 178 | 179 | void mydemo::slot_save() 180 | { 181 | std::string yamlfile = "/home/user/param.yaml"; 182 | YAML::Node yamlConfig = YAML::LoadFile(yamlfile); 183 | yamlConfig["value"] = ui->verticalSlider->value(); 184 | yamlConfig["filter_type"] = (ui->label_txt->text()).toStdString(); 185 | 186 | std::ofstream file; 187 | file.open(yamlfile.c_str()); 188 | file.flush(); 189 | file << yamlConfig; 190 | file.close(); 191 | } 192 | 193 | void mydemo::slot_quit() 194 | { 195 | this->close(); 196 | } 197 | -------------------------------------------------------------------------------- /test_gui/src/qnode.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/qnode.cpp 3 | * 4 | * @brief Ros communication central! 5 | * 6 | * @date February 2018 7 | **/ 8 | 9 | /***************************************************************************** 10 | ** Includes 11 | *****************************************************************************/ 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include "../include/test_gui/qnode.hpp" 18 | 19 | /***************************************************************************** 20 | ** Namespaces 21 | *****************************************************************************/ 22 | namespace test_gui 23 | { 24 | 25 | /***************************************************************************** 26 | ** Implementation 27 | *****************************************************************************/ 28 | QNode::QNode(int argc, char** argv ) 29 | : init_argc(argc), init_argv(argv) 30 | {} 31 | 32 | QNode::~QNode() 33 | { 34 | if(ros::isStarted()) 35 | { 36 | ros::shutdown(); // explicitly needed since we use ros::start(); 37 | ros::waitForShutdown(); 38 | } 39 | wait(); 40 | } 41 | 42 | bool QNode::init() 43 | { 44 | ros::init(init_argc,init_argv,"test_gui"); 45 | if (!ros::master::check()) 46 | { 47 | return false; 48 | } 49 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 50 | ros::NodeHandle n; 51 | ros::NodeHandle nSub; 52 | // Add your ros communications here. 53 | chatter_publisher = n.advertise("testgui_chat", 1000); 54 | chatter_subscriber = nSub.subscribe("testgui_chat", 100, &QNode::RecvTopicCallback, this); 55 | //ros::spin(); 56 | start(); 57 | return true; 58 | } 59 | 60 | bool QNode::init(const std::string &master_url, const std::string &host_url) 61 | { 62 | std::map remappings; 63 | remappings["__master"] = master_url; 64 | remappings["__hostname"] = host_url; 65 | ros::init(remappings,"test_gui"); 66 | if (!ros::master::check()) 67 | { 68 | return false; 69 | } 70 | ros::start(); // explicitly needed since our nodehandle is going out of scope. 71 | ros::NodeHandle n; 72 | ros::NodeHandle nSub; 73 | // Add your ros communications here. 74 | chatter_publisher = n.advertise("testgui_chat", 1000); 75 | chatter_subscriber = nSub.subscribe("testgui_chat", 100, &QNode::RecvTopicCallback, this); 76 | start(); 77 | return true; 78 | } 79 | 80 | void QNode::RecvTopicCallback(const std_msgs::StringConstPtr &msg) 81 | { 82 | log_listen(Info, std::string("I heard: ")+msg->data.c_str()); 83 | } 84 | 85 | void QNode::run() 86 | { 87 | //ros::Rate loop_rate(1); 88 | ros::Duration initDur(0.1); 89 | int count = 0; 90 | while (ros::ok()) 91 | { 92 | std_msgs::String msg; 93 | std::stringstream ss; 94 | ss << "hello world -- " << count; 95 | msg.data = ss.str(); 96 | chatter_publisher.publish(msg); 97 | log(Info,std::string("I sent: ")+msg.data); 98 | ros::spinOnce(); 99 | //loop_rate.sleep(); 100 | initDur.sleep(); 101 | ++count; 102 | } 103 | std::cout << "Ros shutdown, proceeding to close the gui." << std::endl; 104 | Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch) 105 | } 106 | 107 | 108 | void QNode::log(const LogLevel &level, const std::string &msg) 109 | { 110 | logging_model.insertRows(logging_model.rowCount(),1); 111 | std::stringstream logging_model_msg; 112 | switch (level) 113 | { 114 | case(Debug): 115 | { 116 | ROS_DEBUG_STREAM(msg); 117 | logging_model_msg << "[DEBUG] [" << ros::Time::now() << "]: " << msg; 118 | break; 119 | } 120 | case(Info): 121 | { 122 | ROS_INFO_STREAM(msg); 123 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 124 | break; 125 | } 126 | case(Warn): 127 | { 128 | ROS_WARN_STREAM(msg); 129 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 130 | break; 131 | } 132 | case(Error): 133 | { 134 | ROS_ERROR_STREAM(msg); 135 | logging_model_msg << "[ERROR] [" << ros::Time::now() << "]: " << msg; 136 | break; 137 | } 138 | case(Fatal): 139 | { 140 | ROS_FATAL_STREAM(msg); 141 | logging_model_msg << "[FATAL] [" << ros::Time::now() << "]: " << msg; 142 | break; 143 | } 144 | } 145 | QVariant new_row(QString(logging_model_msg.str().c_str())); 146 | logging_model.setData(logging_model.index(logging_model.rowCount()-1),new_row); 147 | Q_EMIT loggingUpdated(); // used to readjust the scrollbar 148 | } 149 | 150 | void QNode::log_listen(const LogLevel &level, const std::string &msg) 151 | { 152 | logging_listen.insertRows(logging_listen.rowCount(),1); 153 | std::stringstream logging_model_msg; 154 | switch (level) 155 | { 156 | case(Debug): 157 | { 158 | ROS_DEBUG_STREAM(msg); 159 | logging_model_msg << "[DEBUG] [" << ros::Time::now() << "]: " << msg; 160 | break; 161 | } 162 | case(Info): 163 | { 164 | ROS_INFO_STREAM(msg); 165 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 166 | break; 167 | } 168 | case(Warn): 169 | { 170 | ROS_WARN_STREAM(msg); 171 | logging_model_msg << "[INFO] [" << ros::Time::now() << "]: " << msg; 172 | break; 173 | } 174 | case(Error): 175 | { 176 | ROS_ERROR_STREAM(msg); 177 | logging_model_msg << "[ERROR] [" << ros::Time::now() << "]: " << msg; 178 | break; 179 | } 180 | case(Fatal): 181 | { 182 | ROS_FATAL_STREAM(msg); 183 | logging_model_msg << "[FATAL] [" << ros::Time::now() << "]: " << msg; 184 | break; 185 | } 186 | } 187 | QVariant new_row(QString(logging_model_msg.str().c_str())); 188 | logging_listen.setData(logging_listen.index(logging_listen.rowCount()-1),new_row); 189 | Q_EMIT loggingListen(); // used to readjust the scrollbar 190 | } 191 | 192 | } // namespace test_gui 193 | -------------------------------------------------------------------------------- /test_gui/src/main_window.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/main_window.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date February 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "../include/test_gui/main_window.hpp" 15 | 16 | /***************************************************************************** 17 | ** Namespaces 18 | *****************************************************************************/ 19 | namespace test_gui 20 | { 21 | 22 | using namespace Qt; 23 | 24 | /***************************************************************************** 25 | ** Implementation [MainWindow] 26 | *****************************************************************************/ 27 | MainWindow::MainWindow(int argc, char** argv, QWidget *parent) 28 | : QMainWindow(parent) 29 | , qnode(argc,argv) 30 | { 31 | ui.setupUi(this); // Calling this incidentally connects all ui's triggers to on_...() callbacks in this class. 32 | QObject::connect(ui.actionAbout_Qt, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt())); // qApp is a global variable for the application 33 | 34 | ReadSettings(); 35 | setWindowIcon(QIcon(":/images/logo.png")); 36 | ui.tab_manager->setCurrentIndex(0); // ensure the first tab is showing - qt-designer should have this already hardwired, but often loses it (settings?). 37 | QObject::connect(&qnode, SIGNAL(rosShutdown()), this, SLOT(close())); 38 | 39 | /********************* 40 | ** Logging 41 | **********************/ 42 | ui.view_logging->setModel(qnode.loggingModel()); 43 | QObject::connect(&qnode, SIGNAL(loggingUpdated()), this, SLOT(updateLoggingView())); 44 | ui.view_listen->setModel(qnode.loggingModelLis()); 45 | QObject::connect(&qnode, SIGNAL(loggingListen()), this, SLOT(updateLogListen())); 46 | 47 | /********************* 48 | ** Auto Start 49 | **********************/ 50 | if(ui.checkbox_remember_settings->isChecked()) 51 | { 52 | on_button_connect_clicked(true); 53 | } 54 | } 55 | 56 | MainWindow::~MainWindow() 57 | { 58 | 59 | } 60 | 61 | /***************************************************************************** 62 | ** Implementation [Slots] 63 | *****************************************************************************/ 64 | void MainWindow::showNoMasterMessage() 65 | { 66 | QMessageBox msgBox; 67 | msgBox.setText("Couldn't find the ros master."); 68 | msgBox.exec(); 69 | close(); 70 | } 71 | 72 | /* 73 | * These triggers whenever the button is clicked, regardless of whether it 74 | * is already checked or not. 75 | */ 76 | void MainWindow::on_button_connect_clicked(bool check) 77 | { 78 | if(ui.checkbox_use_environment->isChecked()) 79 | { 80 | if(!qnode.init()) 81 | showNoMasterMessage(); 82 | else 83 | ui.button_connect->setEnabled(false); 84 | } 85 | else 86 | { 87 | if(!qnode.init(ui.line_edit_master->text().toStdString(), 88 | ui.line_edit_host->text().toStdString())) 89 | { 90 | showNoMasterMessage(); 91 | } 92 | else 93 | { 94 | ui.button_connect->setEnabled(false); 95 | ui.line_edit_master->setReadOnly(true); 96 | ui.line_edit_host->setReadOnly(true); 97 | ui.line_edit_topic->setReadOnly(true); 98 | } 99 | } 100 | } 101 | 102 | void MainWindow::on_checkbox_use_environment_stateChanged(int state) 103 | { 104 | bool enabled; 105 | if (state == 0) 106 | enabled = true; 107 | else 108 | enabled = false; 109 | 110 | ui.line_edit_master->setEnabled(enabled); 111 | ui.line_edit_host->setEnabled(enabled); 112 | //ui.line_edit_topic->setEnabled(enabled); 113 | } 114 | 115 | /***************************************************************************** 116 | ** Implemenation [Slots][manually connected] 117 | *****************************************************************************/ 118 | /** 119 | * This function is signalled by the underlying model. When the model changes, 120 | * this will drop the cursor down to the last line in the QListview to ensure 121 | * the user can always see the latest log message. 122 | */ 123 | void MainWindow::updateLoggingView() 124 | { 125 | ui.view_logging->scrollToBottom(); 126 | } 127 | 128 | void MainWindow::updateLogListen() 129 | { 130 | ui.view_listen->scrollToBottom(); 131 | } 132 | 133 | /***************************************************************************** 134 | ** Implementation [Configuration] 135 | *****************************************************************************/ 136 | void MainWindow::ReadSettings() 137 | { 138 | QSettings settings("Qt-Ros Package", "test_gui"); 139 | restoreGeometry(settings.value("geometry").toByteArray()); 140 | restoreState(settings.value("windowState").toByteArray()); 141 | QString master_url = settings.value("master_url",QString("http://192.168.1.2:11311/")).toString(); 142 | QString host_url = settings.value("host_url", QString("192.168.1.3")).toString(); 143 | //QString topic_name = settings.value("topic_name", QString("/chatter")).toString(); 144 | ui.line_edit_master->setText(master_url); 145 | ui.line_edit_host->setText(host_url); 146 | //ui.line_edit_topic->setText(topic_name); 147 | bool remember = settings.value("remember_settings", false).toBool(); 148 | ui.checkbox_remember_settings->setChecked(remember); 149 | bool checked = settings.value("use_environment_variables", false).toBool(); 150 | ui.checkbox_use_environment->setChecked(checked); 151 | if(checked) 152 | { 153 | ui.line_edit_master->setEnabled(false); 154 | ui.line_edit_host->setEnabled(false); 155 | //ui.line_edit_topic->setEnabled(false); 156 | } 157 | } 158 | 159 | void MainWindow::WriteSettings() 160 | { 161 | QSettings settings("Qt-Ros Package", "test_gui"); 162 | settings.setValue("master_url",ui.line_edit_master->text()); 163 | settings.setValue("host_url",ui.line_edit_host->text()); 164 | //settings.setValue("topic_name",ui.line_edit_topic->text()); 165 | settings.setValue("use_environment_variables",QVariant(ui.checkbox_use_environment->isChecked())); 166 | settings.setValue("geometry", saveGeometry()); 167 | settings.setValue("windowState", saveState()); 168 | settings.setValue("remember_settings",QVariant(ui.checkbox_remember_settings->isChecked())); 169 | } 170 | 171 | void MainWindow::closeEvent(QCloseEvent *event) 172 | { 173 | WriteSettings(); 174 | QMainWindow::closeEvent(event); 175 | } 176 | 177 | } // namespace test_gui 178 | -------------------------------------------------------------------------------- /dyn_cfg_gui/src/dyn_cfg_gui.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file /src/dyn_cfg_gui.cpp 3 | * 4 | * @brief Implementation for the qt gui. 5 | * 6 | * @date July 2018 7 | **/ 8 | /***************************************************************************** 9 | ** Includes 10 | *****************************************************************************/ 11 | #include 12 | #include 13 | #include 14 | #include "../include/dyn_cfg_gui.h" 15 | 16 | /***************************************************************************** 17 | ** Implementation [DynRecfgWidget] 18 | *****************************************************************************/ 19 | DynRecfgWidget::DynRecfgWidget(int argc, char **argv, QWidget *parent) 20 | : QWidget(parent) 21 | { 22 | ui.setupUi(this); 23 | 24 | m_model = new QStandardItemModel(ui.treeView); 25 | m_model->setHorizontalHeaderLabels(QStringList() << QString("Dynamic Services")); 26 | m_proxyModel = new QSortFilterProxyModel; 27 | m_proxyModel->setSourceModel(m_model); 28 | m_proxyModel->setFilterKeyColumn(0); 29 | ui.treeView->setModel(m_proxyModel); 30 | ui.treeView->setEditTriggers(QAbstractItemView::NoEditTriggers); 31 | ui.treeView->header()->setDefaultAlignment(Qt::AlignHCenter); 32 | 33 | QObject::connect(ui.pushButton_refresh, SIGNAL(clicked()), this, SLOT(slot_btn_refresh())); 34 | QObject::connect(ui.pushButton_collapse, SIGNAL(clicked()), this, SLOT(slot_btn_collapse())); 35 | QObject::connect(ui.pushButton_expand, SIGNAL(clicked()), this, SLOT(slot_btn_expand())); 36 | QObject::connect(ui.treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slot_selected_node(QModelIndex))); 37 | QObject::connect(ui.lineEdit_filter, SIGNAL(textChanged(QString)), this, SLOT(slot_txt_filter(QString))); 38 | 39 | ros_init(argc, argv); 40 | } 41 | 42 | DynRecfgWidget::~DynRecfgWidget() 43 | { 44 | delete m_rosthread; 45 | } 46 | 47 | void DynRecfgWidget::ros_init(int argc, char **argv) 48 | { 49 | ros::init(argc, argv, "DynRecfgGui"); 50 | selected_node__ = ""; nodelist__.clear(); isSelectedNode__ = false; 51 | m_rosthread = new RosThread; 52 | connect(m_rosthread, SIGNAL(signal_recfg_msg(QString, RecfgMsgVal)), 53 | this, SLOT(slot_addparamui(QString, RecfgMsgVal))); 54 | 55 | if(ros::ok()) 56 | slot_btn_refresh(); 57 | } 58 | 59 | bool DynRecfgWidget::find_dynmaic_services( std::vector &srvls) 60 | { 61 | srvls.clear(); 62 | 63 | XmlRpc::XmlRpcValue args, result, payload; 64 | args[0] = ros::this_node::getName(); 65 | 66 | if (!ros::master::execute("getSystemState", args, result, payload, true)) 67 | { 68 | ROS_ERROR("Execute ros system wrong!"); 69 | return false; 70 | } 71 | 72 | //std::cout << "payload[2] (services) size: " << payload[2].size() << " \n"; 73 | for (int i = 0; i < payload[2].size(); ++i) 74 | { 75 | XmlRpc::XmlRpcValue val = payload[2][i]; 76 | std::string service_name = val[0]; 77 | int index = service_name.find("/set_parameters"); 78 | if(index > 0) //not found index = -1 79 | { 80 | std::string dynsrv_name = service_name.assign(service_name.c_str(), index); 81 | srvls.push_back(dynsrv_name); 82 | qDebug() << "dynamic service name: " << QString::fromStdString(dynsrv_name); 83 | } 84 | } 85 | return true; 86 | } 87 | 88 | /***************************************************************************** 89 | ** Implementation [Slots] 90 | *****************************************************************************/ 91 | void DynRecfgWidget::slot_btn_refresh() 92 | { 93 | m_model->clear(); 94 | m_model->setHorizontalHeaderLabels(QStringList() << QString("Dynamic Services")); 95 | 96 | std::vector srvLists; 97 | if(!find_dynmaic_services(srvLists)) 98 | return; 99 | 100 | if(srvLists.size() < 1) 101 | return; 102 | 103 | qDebug() << "Number of dynamic services: " << srvLists.size(); 104 | for(unsigned int i = 0; i < srvLists.size(); i++) 105 | { 106 | QStandardItem *srvItem = new QStandardItem(QString::fromStdString(srvLists.at(i))); 107 | m_model->appendRow(srvItem); 108 | } 109 | } 110 | 111 | void DynRecfgWidget::slot_selected_node(const QModelIndex &index) 112 | { 113 | QString node = index.data().toString(); 114 | QString updatetopic = node + "/parameter_updates"; 115 | m_rosthread->setServicesName(updatetopic.toStdString()); 116 | 117 | if(selected_node__ == node) 118 | return; 119 | if(nodelist__.contains(node)) 120 | return; 121 | 122 | selected_node__ = node; 123 | nodelist__.append(node); 124 | } 125 | 126 | void DynRecfgWidget::slot_txt_filter(const QString &text) 127 | { 128 | QRegExp regExp(ui.lineEdit_filter->text(), Qt::CaseInsensitive, QRegExp::RegExp); //CaseInsensitive has no capital letter 129 | m_proxyModel->setFilterRegExp(regExp); 130 | } 131 | 132 | void DynRecfgWidget::slot_btn_collapse() 133 | { 134 | ui.treeView->collapseAll(); 135 | } 136 | 137 | void DynRecfgWidget::slot_btn_expand() 138 | { 139 | ui.treeView->expandAll(); 140 | } 141 | 142 | void DynRecfgWidget::slot_removenode(QString name) 143 | { 144 | m_rosthread->shutServicesUpdate(name.toStdString()); 145 | m_paramMap.remove(name); 146 | 147 | nodelist__.removeOne(name); 148 | if(selected_node__ == name) 149 | selected_node__ = ""; 150 | } 151 | 152 | void DynRecfgWidget::slot_addparamui(const QString &topicname, const RecfgMsgVal &msg) 153 | { 154 | QString srvname = topicname; 155 | if(!m_paramMap.contains(srvname)) 156 | { 157 | m_paramMap[srvname] = new ParamWidget(srvname); 158 | QObject::connect(m_paramMap[srvname] , SIGNAL(signal_removenode(QString)), this, SLOT(slot_removenode(QString))); 159 | ui.verticalLayout->addWidget(m_paramMap[srvname]); 160 | } 161 | else 162 | { 163 | m_paramMap[srvname]->rmCustomLayout(); 164 | } 165 | 166 | for(unsigned int i = 0; i < msg->bools.size(); i++) 167 | { 168 | EditorBool::ParamDesc desc; 169 | desc.name = msg->bools[i].name; 170 | desc.isChecked = msg->bools[i].value; 171 | EditorBool *editbool = new EditorBool(desc); 172 | m_paramMap[srvname]->addCustomLayout(editbool); 173 | } 174 | for(unsigned int i = 0; i < msg->ints.size(); i++) 175 | { 176 | EditorNumber::ParamDesc desc; 177 | desc.name = msg->ints[i].name; 178 | desc.value = msg->ints[i].value; 179 | EditorNumber *editint = new EditorNumber(desc); 180 | m_paramMap[srvname]->addCustomLayout(editint); 181 | } 182 | for(unsigned int i = 0; i < msg->doubles.size(); i++) 183 | { 184 | EditorDecimal::ParamDesc desc; 185 | desc.name = msg->doubles[i].name; 186 | desc.value = msg->doubles[i].value; 187 | EditorDecimal *editdbl = new EditorDecimal(desc); 188 | m_paramMap[srvname]->addCustomLayout(editdbl); 189 | } 190 | for(unsigned int i = 0; i < msg->strs.size(); i++) 191 | { 192 | EditorString::ParamDesc desc; 193 | desc.name = msg->strs[i].name; 194 | desc.text = msg->strs[i].value; 195 | EditorString *editstr = new EditorString(desc); 196 | m_paramMap[srvname]->addCustomLayout(editstr); 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /ros_cv_gui/ui/mydemo.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | mydemo 4 | 5 | 6 | 7 | 0 8 | 0 9 | 784 10 | 540 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Qt::Horizontal 25 | 26 | 27 | 28 | 40 29 | 20 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 41 | 42 | 43 | 44 | 640 45 | 0 46 | 47 | 48 | 49 | 50 | 640 51 | 16777215 52 | 53 | 54 | 55 | 56 | 480 57 | 0 58 | 59 | 60 | 61 | 62 | 15 63 | 64 | 65 | 66 | TextLabel 67 | 68 | 69 | Qt::AlignCenter 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | Open.. 83 | 84 | 85 | 86 | 87 | 88 | 89 | Quit 90 | 91 | 92 | 93 | 94 | 95 | 96 | QFrame::NoFrame 97 | 98 | 99 | QFrame::Raised 100 | 101 | 102 | 103 | 104 | 105 | BoxFilter 106 | 107 | 108 | true 109 | 110 | 111 | false 112 | 113 | 114 | 115 | 116 | 117 | 118 | MeanBlur 119 | 120 | 121 | 122 | 123 | 124 | 125 | Gaussian 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | Qt::Horizontal 138 | 139 | 140 | 141 | 40 142 | 20 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 40 151 | 152 | 153 | 2 154 | 155 | 156 | 0 157 | 158 | 159 | 0 160 | 161 | 162 | Qt::Vertical 163 | 164 | 165 | 166 | 167 | 168 | 169 | Qt::Horizontal 170 | 171 | 172 | 173 | 40 174 | 20 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | false 185 | 186 | 187 | 188 | 189 | 190 | Qt::AlignCenter 191 | 192 | 193 | 194 | 195 | 196 | 197 | Save 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 0 208 | 0 209 | 210 | 211 | 212 | 213 | 640 214 | 480 215 | 216 | 217 | 218 | 219 | 640 220 | 480 221 | 222 | 223 | 224 | 225 | 640 226 | 480 227 | 228 | 229 | 230 | 231 | 20 232 | 75 233 | true 234 | 235 | 236 | 237 | 238 | 239 | 240 | QFrame::Box 241 | 242 | 243 | QFrame::Plain 244 | 245 | 246 | Display Image 247 | 248 | 249 | Qt::AlignCenter 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /test_gui/ui/main_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindowDesign 4 | 5 | 6 | 7 | 0 8 | 0 9 | 944 10 | 704 11 | 12 | 13 | 14 | RosQtGUI 15 | 16 | 17 | 18 | :/images/logo.png:/images/logo.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 | Qt::Horizontal 62 | 63 | 64 | 65 | 40 66 | 20 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | Publisher 75 | 76 | 77 | 78 | 79 | 80 | 81 | Qt::Horizontal 82 | 83 | 84 | 85 | 40 86 | 20 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Qt::Horizontal 102 | 103 | 104 | 105 | 40 106 | 20 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | Subscriber 115 | 116 | 117 | 118 | 119 | 120 | 121 | Qt::Horizontal 122 | 123 | 124 | 125 | 40 126 | 20 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 0 149 | 0 150 | 151 | 152 | 153 | 154 | 325 155 | 395 156 | 157 | 158 | 159 | QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable 160 | 161 | 162 | Qt::RightDockWidgetArea 163 | 164 | 165 | Command Panel 166 | 167 | 168 | 2 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 0 177 | 0 178 | 179 | 180 | 181 | QFrame::StyledPanel 182 | 183 | 184 | QFrame::Raised 185 | 186 | 187 | 188 | 189 | 190 | Ros Master 191 | 192 | 193 | 194 | 195 | 196 | QFrame::StyledPanel 197 | 198 | 199 | QFrame::Raised 200 | 201 | 202 | Ros Master Url 203 | 204 | 205 | 206 | 207 | 208 | 209 | http://192.168.1.2:11311/ 210 | 211 | 212 | 213 | 214 | 215 | 216 | QFrame::StyledPanel 217 | 218 | 219 | QFrame::Raised 220 | 221 | 222 | Ros IP 223 | 224 | 225 | 226 | 227 | 228 | 229 | 192.168.1.67 230 | 231 | 232 | 233 | 234 | 235 | 236 | QFrame::StyledPanel 237 | 238 | 239 | QFrame::Raised 240 | 241 | 242 | Ros Hostname 243 | 244 | 245 | 246 | 247 | 248 | 249 | false 250 | 251 | 252 | unused 253 | 254 | 255 | 256 | 257 | 258 | 259 | Qt::RightToLeft 260 | 261 | 262 | Use environment variables 263 | 264 | 265 | 266 | 267 | 268 | 269 | Qt::RightToLeft 270 | 271 | 272 | Remember settings on startup 273 | 274 | 275 | 276 | 277 | 278 | 279 | Qt::Horizontal 280 | 281 | 282 | 283 | 170 284 | 21 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | true 293 | 294 | 295 | 296 | 0 297 | 0 298 | 299 | 300 | 301 | Set the target to the current joint trajectory state. 302 | 303 | 304 | Clear all waypoints and set the target to the current joint trajectory state. 305 | 306 | 307 | Connect 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | Qt::Vertical 318 | 319 | 320 | 321 | 20 322 | 233 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 0 335 | 0 336 | 337 | 338 | 339 | Quit 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | &Quit 349 | 350 | 351 | Ctrl+Q 352 | 353 | 354 | Qt::ApplicationShortcut 355 | 356 | 357 | 358 | 359 | &Preferences 360 | 361 | 362 | 363 | 364 | &About 365 | 366 | 367 | 368 | 369 | About &Qt 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | quit_button 379 | clicked() 380 | MainWindowDesign 381 | close() 382 | 383 | 384 | 859 385 | 552 386 | 387 | 388 | 469 389 | 299 390 | 391 | 392 | 393 | 394 | 395 | --------------------------------------------------------------------------------