Cpp GUI Tutorial
Hi,
is there any tutorial, how to create a GUI, where I can publish messages on a certain topic for C++? Or can anyone provide a minimal Example, how to read and publish a integer?
Thanks
EDIT: I tried to follow the tutorial : http : // ros.org/wiki/rqt/Tutorials/Writing%20a%20C%2B%2B%20Plugin
But somehow, when I try to load Cmakelists in QT Creator, I get following error:
CMake Error at /opt/ros/groovy/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python
"/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py" "/home/GUITest/rqt_mypkg/package.xml" "/home/GUITest/build/catkin_generated/package.cmake") returned error code 1 Call Stack (most recent call first):
/opt/ros/groovy/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/groovy/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)
/opt/ros/groovy/share/catkin/cmake/catkin_package.cmake:95 (catkin_package_xml)
CMakeLists.txt:51 (catkin_package)return parse_package_string(f.read(),
filename) File "/usr/lib/pymodules/python2.7/catkin_pkg/package.py", line 448, in parse_package_string raise InvalidPackage('Error(s) in %s:%s' % (filename, ''.join(['\n- %s' % e for e in errors]))) catkin_pkg.package.InvalidPackage: Invalid package manifest "/home/GUITest/rqt_mypkg/package.xml": Error(s) in /home/GUITest/rqt_mypkg/package.xml: - The manifest must not contain the following tags: package Traceback (most recent call last): File "/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py", line 98, in <module> main() File "/opt/ros/groovy/share/catkin/cmake/parse_package_xml.py", line 90, in main package = parse_package(args.package_xml) File "/usr/lib/pymodules/python2.7/catkin_pkg/package.py", line 315, in parse_package
Further, I don't get this from the tutorial:
Basically the same step described in previous tutorial. Some unique cases: Replace rqt_gui_py with rqt_gui_cpp C++ binding specific note for xml attribute: /library/class@name The name of the plugin that is exported via the PLUGINLIB_DECLARE_CLASS macro.
I just replaced rqt_gui_py with rqt_gui_cpp. But what is meant with C++ binding specific note for xml atribute? What should I do here exactly?
[EDIT] My plugin.xml looks like this:
<library path="src">
<class name="MyPlugin" type="my_namespace::MyPlugin" base_class_type="rqt_gui_cpp::Plugin">
<description>
An example Python GUI plugin to create a great user interface.
</description>
<qtgui>
<!-- optional grouping...
<group>
<label>Group</label>
</group>
<group>
<label>Subgroup</label>
</group>
-->
<label>My first CPP Plugin</label>
<icon type="theme">system-help</icon>
<statustip>Great user interface to provide real value.</statustip>
</qtgui>
</class>
</library>
I have following files:
- /home/GUITest/rqt_mypkg/package.xml
- /home/GUITest/rqt_mypkg/plugin.xml
- /home/GUITest/rqt_mypkg/CmakeLists.xml
- /home/GUITest/rqt_mypkg/my_namespace/my_plugin.h
- /home/GUITest/rqt_mypkg/my_namespace/my_plugin.cpp
Why are you using QT Creator? The tutorial does not mention this. Why not just try to follow the tutorial and take the example code and see if it compiles?
If I try to call CMake in the console, I get the same error. From this tutorial; http://ros.org/wiki/rqt/Tutorials/Create%20your%20new%20rqt%20plugin I dont get the point 6 and below. I dont have a setup.py. Do I need it? Im not using python
@invoices I suppose that your original question is already answered. If so, you better open up a new question so that others can have a better view of what's your problem.
Ok, I will create a new question as I still have not understood how to create my C++ RQT GUI