Ask Your Question
0

How can I use Qt5 with ROS kinetic?

asked 2017-12-02 14:19:17 -0500

Zenzu gravatar image

updated 2017-12-02 14:20:17 -0500

Hi guys, I am a beginner with ROS and I want to do GUI for control my robotic arm. I think that I can use Qt5 in ROS without any plugins or changing some settings in QtCreator. I want to test a simple GUI with "Hello world" button but I have no idea how to do CMakeLists.txt and package.xml for my package. Can you show me how should I do CMakeLists.txt and package.xml? Thank you

Here is my package's path:

catkin_ws/src/gui

  • gui.cpp
  • CMakeLists.txt
  • package.xml

I have no idea if it works but here is my idea of simple "Hello world button" program gui.cpp:

#include <QApplication>
#include <QPushButton>
#include <ros/ros.h>


int main(int argc, char **argv){
   ros::init(argc, argv, "gui");
   ros::NodeHandle nh;
   QApplication app (argc, argv);

   QPushButton button ("Hello world !");
   button.show();

  return app.exec();
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-04 02:59:00 -0500

rastaxe gravatar image

You can use roscreate-qt-pkg, it is very easy.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-12-02 14:15:40 -0500

Seen: 1,072 times

Last updated: Dec 04 '17