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/