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

Revision history [back]

click to hide/show revision 1
initial version

Just like with any code development, IDEs are not necessary, but they are a very powerful tool and help you save time. I've been using QTCreator for some time and there's no way I will go back to things like hunting down the file which contains compilation errors (double click on the error to go to that line), not having code autocompletion, and manual debugging via GDB. Linux purists may scoff at me, but this stuff lets me write better code by not wasting my time on the things that should be easy anyway.

Now, to answer your specific questions:

  1. Theoretically, no, but catkin makes it easier. You do need to have the usual ROS files like CMakeLists.txt and manifest.xml in place - you can create these by hand or copy/paste and edit from a different project. However, the catkin buildsystem creates many more directories than rosbuild, so you're better off creating your package via catkin first.

  2. Yes. This is how you tell the buildsystem what your compilables and dependencies are, and where to look for them. Otherwise, the compiler/linker won't know what to do.

3 & 4. I do it the way you described with a combination of ROS_WARN/ROS_DEBUG printouts. I find this much easier than dealing with gdb directly and it is very similar, though not as powerful to Visual Studio's debugger.

I think it would be pretty hard to debug multiple nodes simultaneously. What you would do is simulate/replay your inputs and then debug one node at a time. See this and this answers for a way to use QTCreator. In general, you would run everything but the node you are trying to debug from the command line. Having set up QTCreator (in Projects->Run set your executable and command line parameters appropriately), you can then simply set your breakpoints and click on the debug button.

Just like with any code development, IDEs are not necessary, but they are a very powerful tool and help you save time. I've been using QTCreator for some time and there's no way I will go back to things like hunting down the file which contains compilation errors (double click on the error to go to that line), not having code autocompletion, and manual debugging via GDB. Linux purists may scoff at me, but this stuff lets me write better code by not wasting my time on the things that should be easy anyway.

Now, to answer your specific questions:

  1. Theoretically, no, but catkin makes it easier. You do need to have the usual ROS files like CMakeLists.txt and manifest.xml in place - you can create these by hand or copy/paste and edit from a different project. However, the catkin buildsystem creates many more directories than rosbuild, so you're better off creating your package via catkin first.

  2. Yes. This is how you tell the buildsystem what your compilables and dependencies are, and where to look for them. Otherwise, the compiler/linker won't know what to do.

3 & 4. I do it the way you described with a combination of ROS_WARN/ROS_DEBUG printouts. I find this much easier than dealing with gdb directly and it is very similar, though not as powerful to Visual Studio's debugger.

I think it would be pretty hard to debug multiple nodes simultaneously. What you would do is simulate/replay your inputs and then debug one node at a time. See this and this answers for a way to use QTCreator. In general, you would run everything but the node you are trying to debug from the command line. Having set up QTCreator (in Projects->Run set your executable and command line parameters appropriately), you can then simply set your breakpoints and click on the debug button.

Edit: To answer about multiple mains - go to Projects in QtCreator and click on Run.

QtCreator is smart enough to pick up the executables in your project (I believe it's doing it by reading the CMakeLists file). You can pick the exec you want to run from the list or you can add a path to any other exec. Here, I want to run prosilica_node from a specific directory:

image description

Now, if you have some other parameters to set: here in the arguments field I am remapping 2 topics. In addition, I am forcing this node to run in the /robot namespace by setting the ROS_NAMESPACE variable to robot

image description

Just open one of the existing stacks in QtCreator and look around in the Projects view. You should be able to change all of these yourself. Hope this helps.

Just like with any code development, IDEs are not necessary, but they are a very powerful tool and help you save time. I've been using QTCreator for some time and there's no way I will go back to things like hunting down the file which contains compilation errors (double click on the error to go to that line), not having code autocompletion, and manual debugging via GDB. Linux purists may scoff at me, but this stuff lets me write better code by not wasting my time on the things that should be easy anyway.

Now, to answer your specific questions:

  1. Theoretically, no, but catkin makes it easier. You do need to have the usual ROS files like CMakeLists.txt and manifest.xml in place - you can create these by hand or copy/paste and edit from a different project. However, the catkin buildsystem creates many more directories than rosbuild, so you're better off creating your package via catkin first.

  2. Yes. This is how you tell the buildsystem what your compilables and dependencies are, and where to look for them. Otherwise, the compiler/linker won't know what to do.

3 & 4. I do it the way you described with a combination of ROS_WARN/ROS_DEBUG printouts. I find this much easier than dealing with gdb directly and it is very similar, though not as powerful to Visual Studio's debugger.

I think it would be pretty hard to debug multiple nodes simultaneously. What you would do is simulate/replay your inputs and then debug one node at a time. See this and this answers for a way to use QTCreator. In general, you would run everything but the node you are trying to debug from the command line. Having set up QTCreator (in Projects->Run set your executable and command line parameters appropriately), you can then simply set your breakpoints and click on the debug button.

Edit: To answer about multiple mains - go to Projects in QtCreator and click on Run. (note: I guess it's important to mention that QtCreator has to be started from a terminal in which the ROS environment is setup, I have the usual ROS setup in my ~/.bashrc file and then launch via qtcreator CMakeLists.txt&)

QtCreator is smart enough to pick up the executables in your project (I believe it's doing it by reading the CMakeLists file). You can pick the exec you want to run from the list or you can add a path to any other exec. Here, I want to run prosilica_node from a specific directory:

image description

Now, if you have some other parameters to set: here in the arguments field I am remapping 2 topics. In addition, I am forcing this node to run in the /robot namespace by setting the ROS_NAMESPACE variable to robot

image description

Just open one of the existing stacks in QtCreator and look around in the Projects view. You should be able to change all of these yourself. Hope this helps.