{ "info": { "author": "Cordell Michaud", "author_email": "michaudcordell@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# SimpleDrivetrain\r\nVersion: v1.0.1\r\n\r\nA Python library that facilitates the control of robot drivetrains with complex motor arrangements.\r\n\r\n## Table of Contents\r\n* [Overview](#overview)\r\n* [Current Features](#current-features)\r\n* [Roadmap](#roadmap)\r\n* [Requirements](#requirements)\r\n* [Installation](#installation)\r\n* [How to Use](#how-to-use)\r\n - [Import simpledrivetrain](#import-simpledrivetrain)\r\n - [Creating a SimpleDrivetrain object](#creating-a-simpledrivetrain-object)\r\n - [Adding, removing, and accessing drive motors](#adding-removing-and-accessing-drive-motors)\r\n - [Updating drivetrain orientation](#updating-drivetrain-orientation)\r\n - [Getting motor velocities](#getting-motor-velocities)\r\n* [License](#license)\r\n\r\n## Overview\r\nSimpleDrivetrain provides an easy way to define a drivetrain by the location and orientation of its motors, and calculate the desired velocities for each motor given the overall desired translational velocity and rotational velocities for the drivetrain.\r\n\r\n## Current Features\r\n* Local-oriented and field-oriented 3-axis translation and rotation\r\n* Motor-level PWM scaling from user-defined PWM ranges or custom scaling functions\r\n* Support for loading drivetrains from an XML file\r\n\r\n## Roadmap\r\n* Motion profiles\r\n* Control loop\r\n\r\n## Requirements\r\n* Python 2.7+/3.x\r\n* Numpy\r\n* lxml\r\n\r\n## Installation\r\nInstall SimpleDrivetrain from PyPI by opening a terminal and typing the following command:\r\n```\r\n$ pip install simpledrivetrain\r\n```\r\n\r\n## How to Use\r\n### Import simpledrivetrain\r\n```python\r\nfrom simpledrivetrain.simple_drivetrain import SimpleDrivetrain\r\n```\r\n### Creating a SimpleDrivetrain object\r\n```python\r\ndrivetrain = SimpleDrivetrain()\r\n```\r\n### Adding, removing, and accessing drive motors\r\n* Motors can be added to the drivetrain by calling the ```add_new_motor``` \r\nmethod and supplying:\r\n - The ```name``` of the motor, a unique string identifier\r\n - The ```position``` of the motor relative to the drivetrain's \r\n center in the form of a 3D coordinate list e.g. [x, y, z]\r\n - The motor's positive drive ```direction``` in the form of a 3D cartesian direction vector\r\n e.g. [x, y, z]\r\n - Optionally, a boolean value ```inverted``` to set whether the motor is inverted \r\n - Optionally, a 3-tuple ```pwm_bounds``` in the form of (FULL_REVERSE, FULL STOP, FULL_FORWARD) \r\n to which to scale the motor velocity\r\n - Optionally, a function ```pwm_scaling_func``` which accepts a motor velocity in [-1, 1] and \r\n scales it to a desired pwm range\r\n ```python\r\n drivetrain.add_new_motor(name, position, direction, inverted=False, \r\n pwm_bounds=(0, 512, 1024), pwm_scaling_func=None)\r\n ```\r\n* Motors can be removed from the drivetrain by calling the ```remove_motor_by_name```\r\n method and supplying the ```name``` of the motor to remove\r\n ```python\r\n drivetrain.remove_motor_by_name(name)\r\n ```\r\n alternatively, a motor can also be removed from the drivetrain by calling the \r\n ```remove_motor_by_index``` method and supplying the motor's ```index``` \r\n of addition\r\n ```python\r\n drivetrain.remove_motor_by_index(index)\r\n ```\r\n* Motors can be accessed by calling the ```get_motor_by_name``` method and supplying \r\n the ```name``` of the motor to retrieve\r\n ```python\r\n motor = drivetrain.get_motor_by_name(name)\r\n ```\r\n alternatively, a motor can also be accessed by calling ```get_motor_by_index``` \r\n method and supplying the motor's ```index``` of addition\r\n ```python\r\n motor = drivetrain.get_motor_by_index(index)\r\n ``` \r\n* Motors can also be accessed through the motors instance variable, which stores the \r\n motors by order of addition in a list\r\n ```python\r\n motorlist = drivetrain.motors\r\n ```\r\n* Alternatively, motors and orientation can be loaded from an xml file by calling \r\n the ```load_drivetrain_from_file``` method and supplying the ```filepath``` string \r\n pointing to the xml file:\r\n ```python\r\n drivetrain.load_drivetrain_from_file(filepath)\r\n ```\r\n For an example file, see [Example SimpleDrivetrain xml FIle](tests/drivetrain_test.xml).\r\n\r\n### Updating drivetrain orientation\r\n```python\r\ndrivetrain.orientation = (pitch, roll, yaw) \r\n```\r\n### Getting motor velocities\r\n* Motor velocities scaled in [-1, 1], stored in a list by order of motor \r\n addition, can be calculated by calling the\r\n ```get_motor_vels``` method and supplying:\r\n - ```translation```, a 3D vector representing the drivetrain's desired \r\n overall velocity, e.g. [x, y, z]\r\n - ```rotation```, a 3D vector representing the drivetrain's desired \r\n rotational velocity, e.g. [pitching, rolling, yawing]\r\n - ```force_local_oriented```, a boolean value which, if set to true, \r\n ignores current drivetrain orientation and calculates local-oriented \r\n motor values. It is set to false by default.\r\n ```python\r\n drivetrain.get_motor_vels(translation, rotation, force_local_oriented=False)\r\n ```\r\n* Motor velocities scaled according to user-defined, motor-level PWM ranges \r\n or scaling functions, stored in a list by order of motor addition, can be \r\n calculated by calling the ```get_motor_vels_scaled``` method and supplying\r\n the same ```translation```, ```rotation```, and ```force_local_oriented```\r\n parameters as the ```get_motor_vels``` method:\r\n ```python\r\n drivetrain.get_motor_vels_scaled(translation, rotation, force_local_oriented=False)\r\n ```\r\n\r\n## License\r\nSimpleDrivetrain is distributed under the terms of the [MIT License](https://choosealicense.com/licenses/mit/#).\r\n\r\n\r\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaudcordell/SimpleDrivetrain", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "simpledrivetrain", "package_url": "https://pypi.org/project/simpledrivetrain/", "platform": "", "project_url": "https://pypi.org/project/simpledrivetrain/", "project_urls": { "Homepage": "https://github.com/michaudcordell/SimpleDrivetrain" }, "release_url": "https://pypi.org/project/simpledrivetrain/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "A Python library that facilitates the control of robot drivetrains with complex motor arrangements.", "version": "1.0.2" }, "last_serial": 4471562, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0dcdd592db1d4944f8c9514b4ba52e2a", "sha256": "0e3a9e7ebb51ade75fed65c9417e33842393d08fe4086a63d4887f9741e584b4" }, "downloads": -1, "filename": "simpledrivetrain-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "0dcdd592db1d4944f8c9514b4ba52e2a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7213, "upload_time": "2018-07-25T03:02:09", "url": "https://files.pythonhosted.org/packages/0c/c6/ea6e80c5a0f1d8fec5a78d1e51ec861d13d672efa32bfaeee53776659fc1/simpledrivetrain-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e926f6e6fa5cf3f5e16c056f6393ad2b", "sha256": "fa41133c1bd253f9e473753de07bf9ae68857c6c785f874ba7ba87baebcda2ae" }, "downloads": -1, "filename": "simpledrivetrain-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e926f6e6fa5cf3f5e16c056f6393ad2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6838, "upload_time": "2018-07-25T03:02:10", "url": "https://files.pythonhosted.org/packages/2b/b5/009d14f96b0572d8ac5f52b632c8634d4d3c6f083286b907517c0be5d8cf/simpledrivetrain-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "55bd89e4259240366e544fa58f16c489", "sha256": "d11555c463a5d827283ba1b6dde6a2a07183ebaa17c49c273fa55a839e48795c" }, "downloads": -1, "filename": "simpledrivetrain-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "55bd89e4259240366e544fa58f16c489", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7211, "upload_time": "2018-07-25T03:14:23", "url": "https://files.pythonhosted.org/packages/00/77/2e0aea4d9efe3d8eac1d14260519c2c73e4c4889ded47a075b3cf14f5196/simpledrivetrain-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d75e14b5992d63d3bd3f9bf141cac7f3", "sha256": "72d190ec8c4aeab330ac0b1e43c26993a2b494f8401fcf4c4081e5a4fd470cab" }, "downloads": -1, "filename": "simpledrivetrain-1.0.1.tar.gz", "has_sig": false, "md5_digest": "d75e14b5992d63d3bd3f9bf141cac7f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6833, "upload_time": "2018-07-25T03:14:24", "url": "https://files.pythonhosted.org/packages/5d/f7/ba86e7f5516c4b74a09204e39238ae7421301d921f92a9e51bfe0e9166cd/simpledrivetrain-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "264f4addfcc0a0c726ede01e349b24e3", "sha256": "05a48016d6d83ebfe11c507c9a43cccf717100fc74a53aead3357fd465df03b1" }, "downloads": -1, "filename": "simpledrivetrain-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "264f4addfcc0a0c726ede01e349b24e3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7246, "upload_time": "2018-11-10T01:49:00", "url": "https://files.pythonhosted.org/packages/12/a1/7eaa1bb46db54c2277b1d8cfa444fb6a625142dcc9d3d2f98e58d3dfba8b/simpledrivetrain-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "52283cd9f151f039386260a7c8ba8fb9", "sha256": "63ca23fd73ca32d0823b6c7bb2f8ae2f2d14aa180b273f486d5d9d7cf36a9fa1" }, "downloads": -1, "filename": "simpledrivetrain-1.0.2.tar.gz", "has_sig": false, "md5_digest": "52283cd9f151f039386260a7c8ba8fb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6882, "upload_time": "2018-11-10T01:49:01", "url": "https://files.pythonhosted.org/packages/37/db/864f2b0901c27f592d43ac13adb55408a9dc2abd83ac818bd1a5e8bb3707/simpledrivetrain-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "264f4addfcc0a0c726ede01e349b24e3", "sha256": "05a48016d6d83ebfe11c507c9a43cccf717100fc74a53aead3357fd465df03b1" }, "downloads": -1, "filename": "simpledrivetrain-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "264f4addfcc0a0c726ede01e349b24e3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7246, "upload_time": "2018-11-10T01:49:00", "url": "https://files.pythonhosted.org/packages/12/a1/7eaa1bb46db54c2277b1d8cfa444fb6a625142dcc9d3d2f98e58d3dfba8b/simpledrivetrain-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "52283cd9f151f039386260a7c8ba8fb9", "sha256": "63ca23fd73ca32d0823b6c7bb2f8ae2f2d14aa180b273f486d5d9d7cf36a9fa1" }, "downloads": -1, "filename": "simpledrivetrain-1.0.2.tar.gz", "has_sig": false, "md5_digest": "52283cd9f151f039386260a7c8ba8fb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6882, "upload_time": "2018-11-10T01:49:01", "url": "https://files.pythonhosted.org/packages/37/db/864f2b0901c27f592d43ac13adb55408a9dc2abd83ac818bd1a5e8bb3707/simpledrivetrain-1.0.2.tar.gz" } ] }