{ "info": { "author": "Richard Clark", "author_email": "pydev@richard-h-clark.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: System :: Hardware" ], "description": "A Python library for controlling Dynamixel servos.\n\nInstallation\n============\n\nThis package requires pyserial, whicah can be installed using:\n\n::\n\n\tpip install pyserial\n\t\nor, using another method described on the documentation page:\n\n\thttp://pythonhosted.org//pyserial/pyserial.html#installation\n\nThe PyDynamixel package itself can be installed using pip:\n\n::\n\n\tpip install pydynamixel \n\nThe source code (with examples) is available from the GitHub repository:\n\n\thttps://github.com/richard-clark/pydynamixel\n\nIt can also be installed by cloning into the source and running ``setup.py``:\n\t\n::\n\t\n\tgit clone https://github.com/richard-clark/pydynamixel\n\tcd pydynamixel\n\tpython setup.py install\n\nCommunication\n=============\n\nThe ``get_serial_for_url`` method can be used to get a ``serial`` object correctly\nconfigured for the specified url (on POSIX systems; Windows users can use\n``get_serial_for_com``).\n\nBy default, Dynamixels comminate at a high baud rate (1,000,000 baud), and use a single-wire\nprotocol. This combination is highly susceptible to noise. For this reason, the\n``write_and_get_response`` multiple function is recommended as the preferred way of commincating\nwith the Dynamixel. This function will make multiple arguments to clear the serial port, send the\npacket, and read a valid response before failing.\n\nServo Initialization\n====================\n\nThe first time that a servo is instructed to move to a specified position after it has been \npowered up, it will do so at the maximum speed possible, regardless of whether the velocity \nhas been set. This is dangerous, as the servos are quite powerful.\n\nThis issue can be mitigated by first reading the current position of the servo, and then \ncommanding the servo to move to that same position. The ``init()`` method performs this function.\n\nBasic LED Example\n=================\n\nThe AX-18A servos have integrated LEDs. By default, these LEDs are off. The following code \ncan be used to turn on the LED on a connected servo (on POSIX-compliant platforms, \nsuch as Linux and OSX). \n\n::\n\n from pydynamixel import dynamixel, registers\n\n # You'll need to change this to the serial port of your USB2Dynamixel\n serial_port = '/dev/tty.usbserial-A921X77J'\n\n # You'll need to change this to the ID of your servo\n servo_id = 9\n\n # Turn the LED on\n led_value = dynamixel.registers.LED_STATE.ON\n \n try:\n ser = dynamixel.get_serial_for_url(serial_port)\n dynamixel.set_led(ser, servo_id, led_value)\n print('LED set successfully!')\n except Exception as e:\n print('Unable to set LED.')\n print(e)\n \nTo perform the same function on Windows, use the following:\n\n::\n\n from pydynamixel import dynamixel, registers\n\n # You'll need to change this to the serial port of your USB2Dynamixel\n com_port = 'COM5'\n\n # You'll need to change this to the ID of your servo\n servo_id = 9\n\n # Turn the LED on\n led_value = dynamixel.registers.LED_STATE.ON\n \n try:\n ser = dynamixel.get_serial_for_url(serial_port)\n dynamixel.set_led(ser, servo_id, led_value)\n print('LED set successfully!')\n except Exception as e:\n print('Unable to set LED.')\n print(e)\n \nMotion Example\n==============\n\nThis example simply moves a specified servo to a specified position.\n\n::\n\n from pydynamixel import dynamixel\n\n # You'll need to change this to the serial port of your USB2Dynamixel\n serial_port = '/dev/tty.usbserial-A921X77J'\n\n # You'll need to modify these for your setup\n servo_id = 9\n target_position = 768 # (range: 0 to 1023)\n\n # If this is the first time the robot was powered on, \n # you'll need to read and set the current position.\n # (See the documentation above.)\n first_move = True\n\n try:\n ser = dynamixel.get_serial_for_url(serial_port)\n \n if first_move == True:\n dynamixel.init(ser, servo_id)\n \n dynamixel.set_position(ser, servo_id, target_position)\n dynamixel.send_action_packet(ser)\n \n print('Success!')\n \n except Exception as e:\n print('Unable to move to desired position.')\n print(e)\n \n\nChain Module\n============\n\nMultiple servos can be controlled more easily using the chain module.\n\nThe following example demonstrates the process of manipulating the robot \nusing a series of frames using the same velocity for each servo. Each item\nin ``pos`` contains a list of positions, each one corresponding with a\nservo id. After instructing each joint to move to the specified position,\nthe program waits until alls ervos have finished moving before moving to the\nnext frame.\n\n::\n\n from pydynamixel import chain, dynamixel\n\n servo_ids = [1, 2, 3, 4, 5, 6, 7]\n velocity = 180\n \n # Initialize the servos\n chain.init(ser, servo_ids, velocity)\n \n # A list of frames each consisting of the target \n # displacements for each joint\n pos = [[822, 94, 929, 919, 104, 820, 691],\n [822, 632, 391, 919, 104, 523, 561],\n [822, 640, 383, 911, 112, 516, 650],\n [822, 100, 923, 918, 105, 538, 650],\n [818, 100, 923, 918, 105, 538, 650],\n [495, 100, 923, 918, 105, 538, 650],\n [495, 714, 309, 802, 221, 538, 650],\n [495, 723, 300, 791, 232, 538, 569],\n [495, 103, 920, 916, 107, 538, 571],\n [495, 103, 920, 916, 107, 538, 571],\n [495, 723, 300, 791, 232, 538, 569],\n [495, 714, 309, 802, 221, 538, 650],\n [495, 100, 923, 918, 105, 538, 650],\n [818, 100, 923, 918, 105, 538, 650],\n [822, 100, 923, 918, 105, 538, 650],\n [822, 640, 383, 911, 112, 516, 650],\n [822, 632, 391, 919, 104, 523, 561],\n [822, 94, 929, 919, 104, 820, 691]]\n \n # Iterate over the vectors, move to each, \n # and wait for each move to complete\n for v in pos:\n vector = chain.make_vector_constant_velocity(v, servo_ids, velocity)\n chain.move_to_vector(ser, vector)\n chain.wait_for_move(ser, joints)\n \nFore each vector, after instructing the joints to move to the specified position, \nthe program waits until all servos have finished moving before moving to the next frame.\n\nFurther Documentation\n=====================\n\nFor further documentation, see\n\n\thttp://richard-h-clark.com/tag/pydynamixel", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://richard-h-clark.com/pydynamixel", "keywords": "dynamixel,servo", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pydynamixel", "package_url": "https://pypi.org/project/pydynamixel/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pydynamixel/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://richard-h-clark.com/pydynamixel" }, "release_url": "https://pypi.org/project/pydynamixel/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "A package for controlling Dynamixel servos", "version": "1.0.1" }, "last_serial": 1205479, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "96c6ca8cb68224762508fa156129770f", "sha256": "b677300f2119f52cdf8ff74efe9f966f6fe09bd7f2960c0e4992b7692554c7fa" }, "downloads": -1, "filename": "pydynamixel-1.0.0.tar.gz", "has_sig": false, "md5_digest": "96c6ca8cb68224762508fa156129770f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9947, "upload_time": "2014-08-13T23:00:25", "url": "https://files.pythonhosted.org/packages/d4/85/5a94763cbafd9cf344ae6a2aca452c05209ca64024bf3887a4cee90d04d1/pydynamixel-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d893a18548239c8cd4facef4b5d11538", "sha256": "51530b9aa9858277fb845e3fcff6aec0ff142e00ca454b9caea17abd408b0a1e" }, "downloads": -1, "filename": "pydynamixel-1.0.1.tar.gz", "has_sig": false, "md5_digest": "d893a18548239c8cd4facef4b5d11538", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9948, "upload_time": "2014-08-28T17:50:20", "url": "https://files.pythonhosted.org/packages/16/b1/041c77d66a1f6b9a1c066b31ffcbb1005793d27bb44a26ea3ad772a2eeda/pydynamixel-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d893a18548239c8cd4facef4b5d11538", "sha256": "51530b9aa9858277fb845e3fcff6aec0ff142e00ca454b9caea17abd408b0a1e" }, "downloads": -1, "filename": "pydynamixel-1.0.1.tar.gz", "has_sig": false, "md5_digest": "d893a18548239c8cd4facef4b5d11538", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9948, "upload_time": "2014-08-28T17:50:20", "url": "https://files.pythonhosted.org/packages/16/b1/041c77d66a1f6b9a1c066b31ffcbb1005793d27bb44a26ea3ad772a2eeda/pydynamixel-1.0.1.tar.gz" } ] }