ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

debug ros node python

asked 2013-02-07 00:55:46 -0500

Sentinal_Bias gravatar image

updated 2014-01-28 17:15:09 -0500

ngrennan gravatar image

Hi I am new to ROS

how do you debug your ros node, say you code it in python.

Is it possible to use run a ros node in an ide and set break points ect? I saw a link on setting up ide's but they seemed like it was for C++ IDE's

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-07 05:10:57 -0500

130s gravatar image

updated 2013-02-07 18:01:27 -0500

From commandline, you can run your script on debugger by:

$ roscd %YOUR_PKG_HOME%
$ gdb python

If you'd prefer to sticking to eclipse, one dumb workaround to utilize make solution on wiki is:

1 Install pydev on eclipse, create your python project on eclipse by "File" --> "New" --> "Pydev Project". When successful, close eclipse.

2 Copy the .project file that was just generated by eclipse. Eg. by doing:

$ roscd %YOUR_PKG_HOME%
$ cp .project

3 Run make eclipse-project following If you don't have Makefile in the current dir, create one as the same wiki page suggests when error occurs.

4 Swap .project and remove .cproject:

$ mv .project 
$ rm .cproject

This sets up ROS python environment on eclipse. You should be able to run your ROS script in debug mode.

Apparently this is not smart and ideal, but works for me.

This works even on Groovy where make eclipse-project generates many unnecessary files & directories. In this case you might want to remove them & Makefile you no longer need by like:

$ rm -fR catkin* CATKIN_IGNORE cmake_install.cmake devel/ gtest/ Makefile test_results/
edit flag offensive delete link more


Hi Thanks for the reply I also got this to work for python debugging Its a graphical debugger for python. All I have to do is go the source directory and run it from the terminal from there.

Sentinal_Bias gravatar imageSentinal_Bias ( 2014-01-13 23:24:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

The deadline to submit a proposal to present at ROSCon 2017 is June 25, 2017. Submit yours now!

Question Tools


Asked: 2013-02-07 00:55:46 -0500

Seen: 1,290 times

Last updated: Feb 07 '13