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

invoices's profile - activity

2016-11-06 08:16:49 -0500 received badge  Nice Question (source)
2014-02-01 11:40:46 -0500 received badge  Famous Question (source)
2013-11-28 03:34:43 -0500 received badge  Notable Question (source)
2013-09-29 18:07:34 -0500 received badge  Famous Question (source)
2013-09-01 22:34:26 -0500 received badge  Notable Question (source)
2013-08-12 03:42:33 -0500 received badge  Popular Question (source)
2013-08-11 20:15:24 -0500 received badge  Popular Question (source)
2013-08-08 00:17:59 -0500 asked a question Synchronize nodes

Hi, I've got following situation:

Two sensors nodes are publishing different values on different topics at 1khz:

SensorNode A publishes measured contact force values

SensorNode B publishes measured angles

Further I've got two subscribers for these two publishers:

Subscriber subA

Subscriber subB

Both Subscriber write on the same state-Object (state.force and state.angle)

Method void control(state.force,state.angle) is called in the CallBackRoutine of subB and does some calculations based on the measured force and measured angle. But what happens is that the force-values and angle-values don't match.

Sometimes it like in the Callback-Routine of subA values are written on state.force 5 times without having been read or sometimes in the Callback-Routine of subB state.force is read 5 times though they values couldn't be updated by subA

How can I synchronize the two nodes? I'm coding in C++ but I'm really new to ROS.

Thanks

2013-07-31 06:08:13 -0500 commented question RQT GUI with rosbuild

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

2013-07-31 02:27:00 -0500 asked a question RQT GUI with rosbuild

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
2013-07-31 01:23:40 -0500 commented question Cpp GUI Tutorial

Ok, I will create a new question as I still have not understood how to create my C++ RQT GUI

2013-07-31 01:22:17 -0500 received badge  Famous Question (source)
2013-07-30 19:47:10 -0500 received badge  Student (source)
2013-07-30 19:26:40 -0500 commented question Cpp GUI Tutorial

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

2013-07-30 10:36:18 -0500 commented answer Cpp GUI Tutorial

Thank you for your help, I made an edit for further questions.

2013-07-30 04:47:08 -0500 received badge  Notable Question (source)
2013-07-30 02:05:29 -0500 received badge  Popular Question (source)
2013-07-30 01:52:30 -0500 received badge  Editor (source)
2013-07-30 01:45:05 -0500 answered a question Cpp GUI Tutorial

Hey, thank you for your answer. I'm really new to QT and ROS. I tried to follow your links but was not able to understand it completely.

I've build my example GUI with QT Creator. Right now, it just consists of a button. When it's clicked, then "Hello" is printed on the console. I'm using c++ as I've never used Python before.

My ROS-Programm looks like this:

int main (int argc, char **argv){

ros::init(argc,argv,"my_test");
ros::NodeHandle subscriber;
ros::NodeHandle publisher("~");

Test myTest(subscriber,publisher);
ros::spin();

return 0;}

Where Test is some Test-Class that publishes and subscribes topics. For creating my ROS-Programm I use QT-Creator with CMakeList.txt, manifest.xml and Makefile.

My GUI-Programm has also a Main-Method:

int main(int argc, char *argv[]){
QApplication a(argc, argv);
MainWindow w;
w.show();    
return a.exec();}

How do I actually integrate my QT-GUI to ROS? What I actually want to do, is to manually update some parameters (setpoint for Robot-Arm) during runtime of my application. What is the best way for doing this?

2013-07-29 11:37:02 -0500 asked a question 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