Creating a QT ROS package
How do i create a ros package that has QT GUI? Thanks
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
You can use catkin_create_qt_pkg
. But it will probably generate some project which is not compileable (or at least in was like it my case). It depends on version of your ROS
, qt
etc.
Here is a great tutorial on how to do that. But in my case I had to modify it's CMakeLists.txt
to be able to build it. I also had to rename QtGui
include in main_window.hpp
.
From this #include <QtGui/QMainWindow>
to this #include <QtWidgets/QMainWindow>
.
I've added my example package here on github so take look.
Hey l4ncelot, when trying to open your github example I can run catkin_make succesfully but when opening it in Qt I get:CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package): Could not find a package configuration file provided by "roscpp" ... Can you help me?
Hey Valveware, I used this package I found : https://github.com/stonier/qt_ros add it to your workspace. If you have questions let me know. Thanks!
Does that work for Kinetic? I now did the following steps: 1) followed the installguide 2) cloned l4's example and qt_rosinto my source folder 3) ran catkin_make on my workspace ( no errors) 4) Qt -> open project -> catkin_ws/src/qtros_example/ CMakeLists.txt with the standard kit
Now the last step gives an error in Qt: CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package): Could not find a package configuration file provided by "roscpp". What am I still doing wrong? Qt Creator 4.5.0 based on Qt 5.10.0. Thanks in advance!
Is this perhaps a better solution for me? https://answers.ros.org/question/2755... I also which to create a GUI to interact with a Turtlebot running on ROS. EDIT: Solved it with this thread thanks!
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2017-10-25 14:26:05 -0500
Seen: 2,651 times
Last updated: Oct 26 '17