RQT GUI with rosbuild [closed]

asked 2013-07-31 02:27:00 -0500

invoices gravatar image

updated 2013-07-31 06:02:59 -0500

Hi I want to create a GUI to publish some message on a topic. I already tried following tutorial : http://www.ros.org/wiki/rqt/Tutorials/Writing%20a%20C%2B%2B%20Plugin without success. I'm new to ROS (groovy), QT and RQT.

My requirements:

  • I want to create my plugin with C++ (for Ubuntu 12.04) as I have never used python before
  • The whole framework I'm using is based on rosbuild instead of catkin (at least I assume it, as we don't use package.xml but manifest.xml), so I need help to get this working with rosbuild. So I still want to use rosbuild, as I'm little more familiar with it than with Catkin
  • My main program is already working and I don't want it to be depended on the GUI. So it would be nice, if I could just start the GUI whenever I need it.

I tried to follow the above mentioned tutorial (using catkin). But, I'm not sure, what to change exactly in the plugin.xml (from the tutorial) to get CPP-Plugins working. Right now, my plugin.xml looks like this:

<library path="lib/libmy_namespace">
  <class name="my_namespace/myPlugin" type="my_namespace::myPlugin" base_class_type="rqt_gui_cpp::Plugin">
    <description>
      My GUI in C++
    </description>
    <qtgui>

      <label>my_namespace</label>
      <icon type="theme">system-help</icon>
      <statustip>Great user interface to provide real value.</statustip>
    </qtgui>
  </class>
</library>

My CmakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(my_namespace)


find_package(catkin REQUIRED COMPONENTS rqt_gui rqt_gui_cpp)

find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)


include(${QT_USE_FILE})

set(my_namespace_SRCS
  src/my_namespace/myPlugin.cpp
  src/my_namespace/mainwindow.cpp
)

set(my_namespace_HDRS
  include/my_namespace/myPlugin.h
   include/my_namespace/mainwindow.h
)

set(my_namespace_UIS
  src/my_namespace/mainwindow.ui
)

set(my_namespace_INCLUDE_DIRECTORIES
  include
  ${CMAKE_CURRENT_BINARY_DIR}
)

catkin_package(
        INCLUDE_DIRS ${my_namespace_INCLUDE_DIRECTORIES}
        LIBRARIES ${PROJECT_NAME}
        CATKIN_DEPENDS rqt_gui rqt_gui_cpp
)
catkin_python_setup()

qt4_wrap_cpp(my_namespace_MOCS ${my_namespace_HDRS})
qt4_wrap_ui(my_namespace_UIS_H ${my_namespace_UIS})

include_directories(${my_namespace_INCLUDE_DIRECTORIES} ${catkin_INCLUDE_DIRS})
add_library(${PROJECT_NAME} ${my_namespace_SRCS} ${my_namespace_MOCS} ${my_namespace_UIS_H})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})

find_package(class_loader)
class_loader_hide_library_symbols(${PROJECT_NAME})

install(FILES plugin.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

install(PROGRAMS scripts/my_namespace
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

My package.xml:

<?xml version="1.0"?>
<package>
  <name>my_namespace</name>
  <version>0.0.0</version>
  <description>The GUI package</description>


  <maintainer <a href="mailto:email="private@todo.todo">private</maintainer">email="private@todo.todo">private</maintainer</a>>

  <license>TODO</license>


  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rqt_gui</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>rqt_gui_cpp</build_depend>
  <run_depend>rqt_gui</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>rqt_gui_cpp</run_depend>


  <export>

    <rqt_gui plugin="${prefix}/plugin.xml"/>


  </export>
</package>

MyFiles:

  • my_namespace/CmakeLists.txt
  • my_namespace/package.xml
  • my_namespace/plugin.xml
  • my_namespace/setup.py
  • my_namespace/src/my_namespace/mainwindow.cpp
  • my_namespace/src/my_namespace/mainwindow.ui
  • my_namespace/src/my_namespace/myPlugin.cpp
  • my_namespace/include/my_namespace/mainwindow.h
  • my_namespace/include/my_namespace/myPlugin.h
  • my_namespace/scripts/my_namespace
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-04-27 01:57:24.583782

Comments

Could also describe what problems / error messages you have? Based on the above snippets I can at least spot some issues like invalid XML etc.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-07-31 05:31:52 -0500 )edit

In the folder my_namespace, I created a folder build. In that build folder, I called cmake .. and make after that, when I call rosrun my_namespace my_namespace, I get: [rosrun] Couldn't find executable named my_namespace below /home/private/my_namespace [rosrun] Found the following, but they're either not files, [rosrun] or not executable: [rosrun] /home/private/my_namespace [rosrun] /home/private/my_namespace/build/devel/share/my_namespace [rosrun] /home/private/my_namespace/build/devel/lib/python2.7/dist-packages/my_namespace [rosrun] /home/private/my_namespace/build/catkin_generated/stamps/my_namespace

invoices gravatar image invoices  ( 2013-07-31 06:08:13 -0500 )edit