ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to integrate Qt with ROS ?

asked 2013-11-19 18:39:27 -0500

Astronaut gravatar image

updated 2014-01-28 17:18:35 -0500

ngrennan gravatar image

Hello

I would like to use an QT as an user interface for my mobile platform. I have a sensor package consist of IMU , Laser, Kinect and wheel encoders. Would like to have an input button that run a rose node than do some classification with SVM and output button with some classification results. Any help or advice, or code suggestion regarding this?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2013-11-19 22:13:31 -0500

makokal gravatar image

Just build you app using whatever pieces of Qt you need then tie to ROS as follows. Add the find_package(Qt COMPONENTS ... REQUIRED) in your CMakeLists.txt file and the appropriate lines for moc and resource files as needed. For example;

FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})

file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ui)
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS *.h)

QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC})
QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})

And link as needed

add_executable([some_binary] ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})

target_link_libraries([some_binary] ${QT_QTCORE_LIBRARY} ... ${QT_QTGUI_LIBRARY} ${catkin_LIBRARIES} )
edit flag offensive delete link more

Comments

Sorry but Im totally new in Qt. So from where should I start?Do I start from the ROS side first or??Can you tell me a bit more and in a simple way as im totally new in this?Can you expand the answer in like simple steps are needed?

Astronaut gravatar image Astronaut  ( 2013-11-24 12:19:00 -0500 )edit
3

answered 2013-11-20 01:42:59 -0500

Another option is to write a rqt plugin as described in the rqt tutorials (using either Python or C++). This allows you to embed your UI with other rqt widgets easily.

edit flag offensive delete link more

Comments

So whats the difference between them?Is it possible to ingrate SVM and other machine learning methods into it?

Astronaut gravatar image Astronaut  ( 2013-11-20 14:25:12 -0500 )edit

You can add anything you want to your UI plugins. If such tight coupling of machine learning code into a UI widget makes sense depends on the application, however.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2013-11-21 02:44:36 -0500 )edit

Ok. thanks. Thats helps a lot. Any example or some tutorial in the web world (outside ROS) regarding these?

Astronaut gravatar image Astronaut  ( 2013-11-21 12:56:54 -0500 )edit

@Astronaut that sounds like a whole new question; I thought you were asking about mobile UI. It would be interesting, however, to try using Qt for mobile, since I've not seen anybody tried that in rqt.

130s gravatar image 130s  ( 2013-11-21 14:29:46 -0500 )edit

What do you mean a whole new question @IsaacSaito ? Im trying to have an UI that is deployed on a mobile platform. Why I can not use QT for mobile platform like robotics wheelchair?

Astronaut gravatar image Astronaut  ( 2013-11-21 14:51:52 -0500 )edit

Nevermind, I think I took your statement wrong (thought you started mentioning about web interface), but again, I'm curious about how rqt on mobile works.

130s gravatar image 130s  ( 2013-11-21 15:43:22 -0500 )edit

No. Its not web interface. I will try the first option building the application using Qt and than tie to ROS,.See hows going

Astronaut gravatar image Astronaut  ( 2013-11-21 16:04:21 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-11-19 18:39:27 -0500

Seen: 1,473 times

Last updated: Nov 20 '13