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

How to use ROS with GTK+?

asked 2011-10-06 01:25:09 -0500

Felix Tr gravatar image

updated 2014-01-28 17:10:31 -0500

ngrennan gravatar image

Hello all,

My goal is to write an interface for a robot. There are several requirements: 1. The interface should be written in C using GTK+ library. 2. The result should be compatible with ROS. The question is how to do this in the most correct and simple way? (I am a completely new "GUI writer" and a new user of ROS).

I have started from this tutorial page "", and trued to install "Anjuta" (which seems to be a user-friendly, GUI dedicated environment), but I have revealed that it is not compatible with ROS...

Thanks in advance, Felix.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-10-06 02:15:35 -0500

dornhege gravatar image

Does it have to be C only (i.e. not C++)? Then you will have problems with ROS as that is written in C++. If you just want to write C-code, but compile as C++ that's fine.

Other than that I would start from the ROS side, i.e. work through the ROS tutorials and create a basic ROS-package. Once you are familiar with that adding GTK code is just like adding any other library to ROS. You might be able to find examples for integrating GUI code into ROS as GTK + ROS packages. Currently I only know of ROS + Qt/wxWidgets, but the principle should be the same.

edit flag offensive delete link more

answered 2011-10-06 02:51:25 -0500

DimitriProsser gravatar image

You could use either Qt, GTK+ in C, or GTKmm (a C++ port for GTK+). There are examples of using Qt in the eros stack here. There's also a good example of using GTK+ with ROS here. Personally, I have used GTKmm for my GUI development in ROS.

edit flag offensive delete link more

Question Tools


Asked: 2011-10-06 01:25:09 -0500

Seen: 2,136 times

Last updated: Oct 06 '11