From commandline, you can run your script on debugger by:
$ roscd %YOUR_PKG_HOME%
$ gdb python
$ run %YOUR_SCRIPT_PATH%
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 .project.org
3 Run make eclipse-project
following http://www.ros.org/wiki/IDEs#Eclipse. 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.org .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/
Originally posted by 130s with karma: 10937 on 2013-02-07
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by Sentinal_Bias on 2014-01-14:
Hi Thanks for the reply
I also got this to work for python debugging
http://winpdb.org/docs/ Its a graphical debugger for python. All I have to do is go the source directory and run it from the terminal from there.