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

Uploaded Source

Built Distribution

pyros_setup-0.1.1-py2.py3-none-any.whl (10.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for pyros_setup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fffbfd40da630a44045a090f9a99947fb2d279ae320ad76c131d17f2d59ca637
MD5 73afc3d9170260646b7f6d4129bb478c
BLAKE2b-256 3844916be72311e93bd1a11f1012cdcf1f3ff4c812863a867193ff5e07cb0226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyros_setup-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d516a49840430f9ec6edf9edd54fa1f4f9aead2183d938f2ef463cda05771741
MD5 d1fb9c99dad0885fa54669667cb45c97
BLAKE2b-256 15c58e5f3ad455b37de0226da9c58cf14fb54f8a296b9df6e534ed230fd1d513

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