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

Using pypy with ROS for better performance ?

asked 2013-06-26 22:08:11 -0600

victorp gravatar image

updated 2014-01-28 17:17:03 -0600

ngrennan gravatar image

How can I use pypy instead of the default python interpreter for a ROS node written in python ? I tried:

cd /path/to/node
pypy script/pioneer.py

But I'm getting an error:

Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "scripts/pioneer.py", line 5, in <module>
    import roslib
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest
  File "/opt/ros/groovy/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ImportError: No module named rospkg

Also, changing the first line of the script to #!/usr/bin/pypy and using rosrun yields the same.

EDIT: OK, I added the missing directories to sys.path (namely /usr/lib/pymodules/python2.7) but now I'm getting another error:

ImportError: No module named _tf
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-12 10:55:01 -0600

tfoote gravatar image

tf uses c binding for python which are going to be harder in pypy.

edit flag offensive delete link more

Comments

Could you solve to use pypy with ROS?

Thank you!

gre721 gravatar image gre721  ( 2016-12-19 10:25:11 -0600 )edit
1

No; as @tfoote said this would require a significant rewrite of tf (and probably other libraries that use the cpython API).

ahendrix gravatar image ahendrix  ( 2016-12-19 12:14:29 -0600 )edit

Question Tools

Stats

Asked: 2013-06-26 22:08:11 -0600

Seen: 1,207 times

Last updated: Dec 19 '16