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.

HowTo install

To install it:

pip install 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_pip). This is useful for development along with ROS packages:

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

HowTo code

Basically it allows you to do this:

import pyros_setup
try:
    import rospy
    import roslaunch
    import rosgraph
    import rosnode
except ImportError:  # if ROS environment is not setup, we emulate it.
    pyros_setup.configurable_import().configure('mysetup.cfg').activate()  # this will use mysetup.cfg from pyros-setup instance folder
    import rospy
    import roslaunch
    import rosgraph
    import rosnode

With mysetup.cfg in pyros-setup instance folder containing:

import os
WORKSPACES=[os.path.join('home', 'user', 'ROS', 'workspace', 'devel')]
DISTRO='indigo'

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

HowTo deploy

If you want to use pyros-setup, you should use the pip package, since the whole point is to provide access to ROS from pure python environment. This is now possible thanks to [catkin_pip](https://github.com/asmodehn/catkin_pip)

Remarks

Although it would technically be possible to build a ROS package from this source, this will NOT be done. The catkin build system is only here to help having pyros-setup in a source workspace while developing on it. When using ROS directly this package is not needed, and having it installed among ROS packages would cause much user confusion when importing packages.

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.2.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

pyros_setup-0.1.2-py2.py3-none-any.whl (11.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyros_setup-0.1.2.tar.gz.

File metadata

  • Download URL: pyros_setup-0.1.2.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyros_setup-0.1.2.tar.gz
Algorithm Hash digest
SHA256 70769187f356d41b473c6771b28913386ec03a2cd80e4d51a75a81580a177b62
MD5 be6b9f403c3d30e63c559608875364bf
BLAKE2b-256 99939f120264b53308640ad55e65ef5ba9342a006aef565c5bdf07c45bc572f2

See more details on using hashes here.

File details

Details for the file pyros_setup-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyros_setup-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5355735884334fec58fb48332b09ed2314bfe6ae34efcdb71fc99d8d3ac26b58
MD5 a77c6647134078f95e540f59d4910341
BLAKE2b-256 ea5c7c333f0143233f620fa9f560b8cd0937b39728d3ab84bfeeedf6dbe395f5

See more details on using hashes here.

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