Skip to main content

Toolsuite for running ROS environments directly from python code, without any specific requirements outside of usual python

Project description

https://travis-ci.org/asmodehn/pyros-setup.svg?branch=master

Toolsuite for running ROS environments directly from python code, without any specific requirements outside of usual python.

This is a pure python package, to be installed in your system, in order to allow easy ROS access from your python environment.

To install it:

sudo pip install -i https://testpypi.python.org/pypi pyros_setup

To run the self tests, using entry_points defined in setup.py:

pyros_setup

OR using the python package directly:

python -m pyros_setup

OR using nosetests specifically:

nosetests pyros_setup

It can also be used from source inside a catkin workspace in the same way. The workspace act as a virtual environment (using https://github.com/asmodehn/catkin_pure_python). This is useful for development along with ROS packages:

$ catkin_make
$ source devel/setup.bash
$ python -m pyros_setup
$ pyros_setup
$ nosetests pyros_setup

However it is also usable by catkin from source for ease of development and compatibility testing.

Basically it allows you to do this:

try:
    import rospy
    import roslaunch
    import rosgraph
    import rosnode
except ImportError:  # if ROS environment is not setup, we emulate it.
    import pyros_setup
    pyros_setup = pyros_setup.delayed_import_auto(base_path=os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..', '..'))
    import rospy
    import roslaunch
    import rosgraph
    import rosnode

A ROS package WILL NOT be provided, since there is no simple and clean way to turn a pure python package into a catkin package. If you want to depend on pyros-setup, you should use the rosdep pip dependency mechanism.

Note: If you know any easier / less tricky / more pythonic way of handling dynamic imports, let me know!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyros_setup-0.1.0.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

pyros_setup-0.1.0-py2.py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page