Ask Your Question
2

How do I use eclipse with python (pydev)

asked 2012-06-23 16:48:49 -0500

updated 2014-01-28 17:12:48 -0500

This page explains how to use eclipse with C++: http://www.ros.org/wiki/IDEs#Eclipse. This page explains how to set up eclipse with pydev to edit python files: https://wiki.nps.edu/display/~thchung/ROS+--+Using+the+Eclipse+IDE

But nothing seems to tell me how to actually run python ros packages under eclipse, set breakpoints, etc. When I try to run it fails with an exception when trying to load the manifest:

Traceback (most recent call last):
  File "/home/bouchier/ros_workspace/randomWalk/src/randomWalker.py", line 6, in <module>
    import roslib; roslib.load_manifest('randomWalk')
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest
    sys.path = _generate_python_path(package_name, _rospack) + sys.path
  File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path
    m = rospack.get_manifest(pkg)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 118, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 157, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 149, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: randomWalk

I've single-stepped through rosserial_python (which is what I really want to run in a debugger), and it gets the same error. I've tried running from different directories, & it seems to be unable to find manifest.xml when running in eclipse. (It runs fine from rosrun).

How do python developers do debugging? Is there an easy fix to use eclipse? Any other toolsets I should be using?

Thanks

Paul

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2012-06-24 14:03:12 -0500

updated 2012-06-24 14:03:25 -0500

Hi Paul,

as far as I know there is no direct support yet to launch ros nodes out of eclipse (and debug them). I use eclipse with pydev to develop the node but I still run it from the console with rosrun.

There has been done some effort by the guys from TU Munich to integrate the ros tools into an IDE, but I don't know how far the project is and if it is still actively developed. You can find the source in this repository.

You could try to execute rosrun as an external run script in eclipse. I tried to set it up once but gave up because I could not find a way to properly set up all the paths ros has set in the console (through setup.bash). There is probably a way but I decided its not worth it.

Good luck

Felix

edit flag offensive delete link more

Comments

tum rosclipse project is dormant, pydev integration was not even on the todo list yet.

KruseT ( 2012-06-26 22:33:38 -0500 )edit
0

answered 2012-06-25 00:19:09 -0500

Thanks Felix.

Answering my own question with a hypothesis

I guess most ros python developers would debug a python node by adding import pdb and inserting a pdb.set_trace() statement at a point where they want to start single-stepping.

Is that correct? Is there a better answer?

Sorry for the noobie question.

Paul

edit flag offensive delete link more

Your Answer

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

Add Answer

[hide preview]

Question Tools

Follow
2 followers

Stats

Asked: 2012-06-23 16:48:49 -0500

Seen: 1,338 times

Last updated: Jul 27 '13