{ "info": { "author": "S\u00e9verin Lemaignan", "author_email": "severin.lemaignan@epfl.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering" ], "description": "pyRobots: a toolkit for robot executive control\n===============================================\n[![DOI](https://zenodo.org/badge/983/chili-epfl/pyrobots.svg)](https://zenodo.org/badge/latestdoi/983/chili-epfl/pyrobots)\n[![Documentation Status](https://readthedocs.org/projects/pyrobots/badge/?version=latest)](http://pyrobots.readthedocs.org)\n\n`pyRobots` provides a set of Python decorators to easily turn standard functions\ninto background tasks which can be cancelled at anytime and to make your controller\n*resource aware* (no, a robot can not turn left AND right at the same time).\n\nIt also provides a event-based mechanism to monitor specific conditions and\nasynchronously trigger actions.\n\nIt finally provides a library of convenient tools to manage poses in a uniform way\n(quaternions, Euler angles and 4D matrices, I look at you) and to interface with\nexisting middlewares (ROS, naoqi, aseba...).\n\n`pyRobots` took some inspiration from the\n[URBI](https://github.com/aldebaran/urbi) language.\n\nInstallation\n------------\n\n```\n$ pip install pyRobots\n```\n\n(or, of course, from the source)\n\nMain features\n-------------\n\n- Turns any Python function into a background *action* with the decorator\n `@action`.\n- Robot actions are non-blocking by default: they are instanciated as futures\n (lightweight threads),\n- Actions can be cancelled at any time via signals (the `ActionCancelled` signal\n is raised).\n- Lock specific resources with a simple `@lock(...)` in front of the actions.\n When starting, actions will wait for resources to be available if needed.\n- Supports *compound resources* (like `WHEELS` == `LEFTWHEEL` + `RIGHTWHEEL`)\n- Create event with `robot.whenever().do()`\n- Poses are managed explicitely and can easily be transformed from one reference\n frame to another one (integrates with ROS TF when available).\n- Extensive logging support to debug and replay experiments.\n\nSupport for a particular robot only require to subclass `GenericRobot` for this\nrobot (and, obviously, to code the actions you want your robot to perform).\n\nDocumentation\n-------------\n\n[Head to readthedocs](http://pyrobots.readthedocs.org). Sparse for now.\n\nMinimum Working Example\n-----------------------\n\n...that includes the creation of a specific robot\n\n```python\nimport time\nfrom robots import GenericRobot\nfrom robots.decorators import action, lock\nfrom robots.resources import Resource\nfrom robots.signals import ActionCancelled\n\n# create a 'lockable' resource for our robot\nWHEELS = Resource(\"wheels\")\n\nclass MyRobot(GenericRobot):\n\n def __init__(self):\n super(MyRobot, self).__init__()\n\n # create (and set) one element in the robot's state. Here a bumper.\n self.state.my_bumper = False\n\n # do whatever other initialization you need :-)\n\n def send_goal(self, pose):\n # move your robot using your favorite middleware\n print(\"Starting to move towards %s\" % pose)\n\n def stop(self):\n # stop your robot using your favorite middleware\n print(\"Motion stopped\")\n\n def whatever_lowlevel_method_you_need(self):\n pass\n\n@lock(WHEELS)\n@action\ndef move_forward(robot):\n \"\"\" We write action in a simple imperative, blocking way.\n \"\"\"\n\n # the target pose: simply x += 1.0m in the robot's frame. pyRobots\n # will handle the frames transformations as needed.\n target = [1.0, 0., 0., \"base_link\"]\n\n try:\n robot.send_goal(target)\n\n while(robot.pose.distance(robot.pose.myself(), target) > 0.1):\n # robot.sleep is exactly like time.sleep, except it lets the pyrobots\n # signals pass through.\n robot.sleep(0.5)\n\n print(\"Motion succeeded\")\n\n except ActionCancelled:\n # if the action is cancelled, clean up your state\n robot.stop()\n\n\nwith MyRobot() as robot:\n\n # Turn on DEBUG logging.\n # Shortcut for logging.getLogger(\"robots\").setLevel(logging.DEBUG)\n robot.debug()\n\n robot.whenever(\"my_bumper\", value = True).do(move_forward)\n\n try:\n while True:\n time.sleep(0.5)\n except KeyboardInterrupt:\n pass\n\n```\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chili-epfl/pyrobots", "keywords": null, "license": "ISC", "maintainer": null, "maintainer_email": null, "name": "pyRobots", "package_url": "https://pypi.org/project/pyRobots/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyRobots/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/chili-epfl/pyrobots" }, "release_url": "https://pypi.org/project/pyRobots/2.2/", "requires_dist": null, "requires_python": null, "summary": "A Python toolset for event-based, asynchronous programming of robot controllers", "version": "2.2" }, "last_serial": 2126028, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "d9d819c8f9e0c1efd6eae7e98286e8fc", "sha256": "e15c9a6e5a83f06ce09737120b88d0fa3328101ab8da454f8a679198db2f4a29" }, "downloads": -1, "filename": "pyRobots-2.0.tar.gz", "has_sig": false, "md5_digest": "d9d819c8f9e0c1efd6eae7e98286e8fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40076, "upload_time": "2014-09-18T10:41:11", "url": "https://files.pythonhosted.org/packages/8b/be/9e3477402ba84996f071e3b6eae4ede63de2179dce0f1a9ae2b11b3b7b6b/pyRobots-2.0.tar.gz" } ], "2.2": [ { "comment_text": "built for Linux-4.4.0-22-generic-x86_64-with-glibc2.7", "digests": { "md5": "d08e8719503705dc8e1eea4c4b300159", "sha256": "c39aeb340d12dfd6586df816dfde059eb5f4dfcf010007ea5943b878fd2ef135" }, "downloads": -1, "filename": "pyRobots-2.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "d08e8719503705dc8e1eea4c4b300159", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 85288, "upload_time": "2016-05-20T20:01:52", "url": "https://files.pythonhosted.org/packages/e5/72/aac4fb29d5eb77d1462f63cc976030d7f6554d7716e8aad278af8374dc88/pyRobots-2.2.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "553dafcc8ab75eded3c0e21d28c366e6", "sha256": "f19f3ddba71300895d6c204a30abbcf19f468f7a72ed3aa2850d8f380238ea96" }, "downloads": -1, "filename": "pyRobots-2.2.tar.gz", "has_sig": false, "md5_digest": "553dafcc8ab75eded3c0e21d28c366e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40430, "upload_time": "2016-05-20T20:01:44", "url": "https://files.pythonhosted.org/packages/a0/88/3b715225386558646a59f1d68ea3cb25bef78f18576e3e8b6f38b178ebbf/pyRobots-2.2.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-4.4.0-22-generic-x86_64-with-glibc2.7", "digests": { "md5": "d08e8719503705dc8e1eea4c4b300159", "sha256": "c39aeb340d12dfd6586df816dfde059eb5f4dfcf010007ea5943b878fd2ef135" }, "downloads": -1, "filename": "pyRobots-2.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "d08e8719503705dc8e1eea4c4b300159", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 85288, "upload_time": "2016-05-20T20:01:52", "url": "https://files.pythonhosted.org/packages/e5/72/aac4fb29d5eb77d1462f63cc976030d7f6554d7716e8aad278af8374dc88/pyRobots-2.2.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "553dafcc8ab75eded3c0e21d28c366e6", "sha256": "f19f3ddba71300895d6c204a30abbcf19f468f7a72ed3aa2850d8f380238ea96" }, "downloads": -1, "filename": "pyRobots-2.2.tar.gz", "has_sig": false, "md5_digest": "553dafcc8ab75eded3c0e21d28c366e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40430, "upload_time": "2016-05-20T20:01:44", "url": "https://files.pythonhosted.org/packages/a0/88/3b715225386558646a59f1d68ea3cb25bef78f18576e3e8b6f38b178ebbf/pyRobots-2.2.tar.gz" } ] }