Ask Your Question
0

Creating a QT ROS package

asked 2017-10-25 14:26:05 -0600

MechLc gravatar image

How do i create a ros package that has QT GUI? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-10-26 03:33:15 -0600

l4ncelot gravatar image

updated 2017-10-26 03:37:10 -0600

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.

edit flag offensive delete link more

Comments

For some reason its not working for Kinetic

MechLc gravatar imageMechLc ( 2017-11-10 15:30:29 -0600 )edit

I've tried this on kinetic so it should work imo. Have you followed the guide to make sure your qt is installed properly?

l4ncelot gravatar imagel4ncelot ( 2017-11-13 02:13:38 -0600 )edit

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?

Valveware gravatar imageValveware ( 2018-01-10 09:11:00 -0600 )edit
1

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!

MechLc gravatar imageMechLc ( 2018-01-10 10:35:18 -0600 )edit

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

Valveware gravatar imageValveware ( 2018-01-10 12:52:25 -0600 )edit

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!

Valveware gravatar imageValveware ( 2018-01-10 12:55:11 -0600 )edit

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!

Valveware gravatar imageValveware ( 2018-01-10 13:01:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-25 14:26:05 -0600

Seen: 1,384 times

Last updated: Oct 26 '17