{ "info": { "author": "CP Sridhar", "author_email": "sridhar@mistyrobotics.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# mistyPy\n\nOfficial Python library to work with your Misty robot. Currently in BETA\n\n## Requirements\n\npython >= 3.4\n\nrequests\n\nwebsocket 0.52.0\n\n## Installing\n\n### Step 1: Easy start\n\nIf you are already comfortable using Python, skip to step 2\n\nInstall anaconda for python >= 3.4 version\n```\nhttps://www.anaconda.com/download/\n```\nEnter the following in your terminal \n```\nconda create -n python=3.4 requests\n```\nNow your environment is setup. To activate your environment enter the below command in your terminal:\n\nSay you used the name 'misty_developer' in the conda create step\n```\nsource activate misty_developer\npip install mistyPy\npip install websocket-client==0.52.0\n```\nskip step 2\n```\nNote:\nEverytime you open a new termial, enter \nsource activate \n```\n\n### Step 2: Self Setup \n\nuse the command after setting up python >= 3.4\n```\npip install mistyPy\npip install requests\npip install websocket-client==0.52.0\n```\n\n## Current support\n\n#### API\n\nChanaging LED, Changing image on screen, Playing audio, Moving Head, Driving Misty\n\n#### WebSockets\n\nBackpack string stream, Time of Flights, Face Recognition, Face Training, Face Detection\n\n## Writing your own python program for Misty\n\n```\nimport mistyPy\n```\n#### Connecting to the robot\nSyntax: robot_name = mistyPy.Robot(\"Enter the robot IP here\")\nName your misty- > let me call mine 'mia' \n```\nmia = mistyPy.Robot(\"10.0.1.206\")\n```\nNow you can refer to your robot as mia\n\n#### Change LED color\nSynatx: robot_name.changeLED(red,green,blue)\n```\nmia.changeLED(0,200,255) # Purple\n```\n\n#### Change image on the screen\n\nSyntax: robot_name.changeImage(\"image_name.format\")\n```\nmia.changeImage(\"Happy.jpg\")\n```\nto get a list of all the images saved on your misty\n```\nmia.printImageList() # prints [\"Happy.jpg\",\"Confused.jpg\",\"Angry.jpg\" ....]\nimages = mia.getImageList() # Return list of saved image files\n```\n\n#### Play saved audio file\n\nSynatx: robot_name.playAudio(\"file_name.format\")\n```\nmia.playAudio(\"008-Ah.wav\")\n```\nto get a list of all the audio files saved on your misty\n```\nmia.printAudioList() # prints [\"eeee.wav\",\"Aaah.wav\",\"nah.wav\"....]\naudios = mia.getAudioList() # returns list of saved audio files \n\n```\n\n#### Battery check\n\nSynatx: output = robot_name.battery()\n```\ncharge_percentage = mia.battery()\nprint(charge_percentage)\n```\n\n#### Move the head\n\nRoll, pitch and yaw values can range from -5 to 5\n\nOne Command to control roll, pitch, and yaw\n\nSyntax: robot_name.moveHead(roll_value, pitch_value, yaw_value, optional velocity_value)\n```\nmia.moveHead(-1,-5,3)\nmia.moveHead(-1,-5,3, velocity = 5)\n```\n\nIndividial command per axis (also can take an optional velocity argument)\n```\nmia.headRoll(-1)\nmia.headPitch(-5, velocity = 5)\nmia.headYaw(3)\n```\n\n#### Drive Misty\n\nThere are three modes to drive Misty\n1. drive : you tell the linear and angular speed and Misty keeps on driving \n2. driveTime : you tell misty the speeds and also how long misty has to execute it\n3. driveTrack : instead of telling misty linear and angular speed, you tell the speed of left and right wheels individually\n\nSyntax: robot_name.drive(linear_velocity, angular_velocity)\n\nSyntax: robot_name.driveTime(linear_velocity, angular_velocity,time_in_milli_second)\n\nSyntax: robot_name.driveTrack(left_track_speed,right_track_speed)\n```\nmia.drive(50,20) # goes forward and turns\nmia.driveTime(70,0,3000) # goes forward for three seconds\nmia.driveTrack(50,-50) # spins in the same place\n```\n\nNote: \nvelocity range -100 to 100\n\n#### Stop Driving\n\nYou could either send a command with velocities 0 or use this\n\nSyntax: robot_name.stop()\n```\nmia.stop()\n```\n\n#### Train a Face for Misty to recognise\n\nSyntax: robot_name.learnFace()\n```\nmia.learnFace(\"Ian\")\n```\n\nMisty takes 15 seconds to capture your face and another 15 seconds to process it!\n\nYou would see a countdown printing in the terminal\n\n#### Get a list of the Learned Faces\n\nSyntax: robot_name.getLearnedFaces()\n```\nmia.printLearnedFaces() # prints [Ian, CP, John, Allison, Woo,....]\nnames = mia.getLearnedFaces() # returns the names of trained faces as a list\n```\n\n#### Delete all Learned Faces\n\nSyntax: robot_name.clearLearnedFaces()\n```\nmia.clearLearnedFaces()\n```\n\n### WebSockets - a brief into \n\nConsider all the above commands as a short handshakes while websockets work like you keep holding hands for a long time. You could continuosly stream data with websockets. Comes in handy when working with sensors on Misty, Arduino/Raspberry backpacks.\n\nTo start the handshake you got to subscribe to a topic\n\n--- Continuos data stream ---\n\nTo end the handshake you got to unsubscribe from the same topic\n\n--- No more data ---\n\n#### Arduino/RaspberryPy backpack\n\nTo start the hanshake / to subscribe to the backpack (anything you send from arduino Serial.println(\"your_data\") to Misty)\n\nSyntax: robot_name.subscribe(\"StringMessage\")\n```\nmia.subscribe(\"StringMessage\")\n```\nThis streams all data into the function call 'backpack()'\n\nSyntax: robot_name.backpack()\n\nYou could call this any number of times at any time instant to get the data steram from you arduino\n\nLets say arduino is sending me temparature data in celcius and i want to turn my air cooler on at a threshold of 25\u02daC\n```\nwhile True:\n temp = mia.backpack()\n if int(temp) > 25:\n turn_on_air_cooler()\n else:\n pass\n```\nTo end the handshake / to unsubscribe from the backpack data stream\n\nSyntax: robot_name.unsubscribe(\"StringMessage\")\n```\nmia.unsubscribe(\"StringMessage\")\n```\n#### Time Of Flights\n\nMisty has three time of flight sensors in the front and one on the back. They stream distance to obstacles in meters. \n\nTo start handshake / subscribe to time of flight sensors data\n\nSyntax: robot_name.subscribe(\"TimeOfFlight\")\n```\nmia.subscribe(\"TimeOfFlight\")\n```\nThis streams all 4 time of flight sensor data into the function call 'time_of_flight()' \n\nSyntax: robot_name.time_of_flight()\n```\nincoming_data = mia.time_of_flight()\n```\nprint(incoming_data) would print {'Left': 0.233, 'Center': 0.072, 'Right': 0.037, 'Back': 0.115}\n\nTo get just the Left time of flight sensor data\n```\nprint(incoming_data[\"Left\"])\n```\n\nSay misty is driving backwards and you want to stop if the wall is just or closer than 10 cm\n```\nmia.drive(-10,0)\nwhile True:\n if mia.time_of_flight()[\"Back\"] <= 0.010:\n mia.stop()\n break\n```\n\n#### Computer Vision\n\nTo start the Face Recognition / Face Detection you subscribe to the websocket first\n\nSyntax: robot_name.subscribe(\"FaceRecognition\")\n```\nmia.subscribe(\"FaceRecognition\")\n```\nThis streams all data into the function call 'faceRec()'\n\nSyntax: robot_name.faceRec()\n\nOnce subscribed to Face Recognition you could call faceRec() anytime to pull the latest data from Misty\n\n```\nwhile True:\n data = mia.faceRec()\n print(data) # {'personName' : 'Samanta', 'distance' : '95', 'elevation' : '6'} \n name = data[\"personName\"] # You could extract specific values of your interest like this\n distance = data[\"distance\"] # units in mm\n elevation = data[\"elevation\"]\n\n```\n\nIf a face is detected and the person is unknown the \"personName\" field would output \"unknown_person\"\n\nTo stop Face Recognition / Face Detection\n\nSyntax: robot_name.unsubscribe(\"FaceRecognition\")\n```\nmia.unsubscribe(\"FaceRecognition\")\n```\n\n\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/MistyCommunity/mistyPy", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mistyPy", "package_url": "https://pypi.org/project/mistyPy/", "platform": "", "project_url": "https://pypi.org/project/mistyPy/", "project_urls": { "Homepage": "https://github.com/MistyCommunity/mistyPy" }, "release_url": "https://pypi.org/project/mistyPy/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python library for Misty. BETA V 0.0.4", "version": "0.0.4" }, "last_serial": 4473326, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "34aa4610dc9221663b3346f1048a2895", "sha256": "2fcb77d7a330e88ba75acde82eaf425586b3364fa0b9779278f224f47d23c65d" }, "downloads": -1, "filename": "mistyPy-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "34aa4610dc9221663b3346f1048a2895", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6158, "upload_time": "2018-09-04T23:50:49", "url": "https://files.pythonhosted.org/packages/c6/ab/9ae6caea95f2288b980206121d0201949ae1b0ba058a1c8443bbc3fcc77d/mistyPy-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48cbdcbfb7be49c58c81ea902746c46c", "sha256": "43184660b2dfc8dc385be735234b6496d5f5e10eddb4661f99a517660e57c895" }, "downloads": -1, "filename": "mistyPy-0.0.1.tar.gz", "has_sig": false, "md5_digest": "48cbdcbfb7be49c58c81ea902746c46c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6365, "upload_time": "2018-09-04T23:50:51", "url": "https://files.pythonhosted.org/packages/b6/ba/b9c4c9c00d3fed63422b163dec8d3561672637cd3661c4221e9aec2fba6f/mistyPy-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d09b128918fa52fdb2c628a02d0bdbdc", "sha256": "8a6fd92f8740ef6188b2be44885dc2e678aecaca43059e281d5b20c89515adce" }, "downloads": -1, "filename": "mistyPy-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d09b128918fa52fdb2c628a02d0bdbdc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6199, "upload_time": "2018-09-05T00:04:01", "url": "https://files.pythonhosted.org/packages/35/c7/c4f05ffe210fbcb824f0540b798d75e47ab0340050e70db63c1dbd3042ce/mistyPy-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8e738cef0007bd0dd492306779fbfa6", "sha256": "82fd437182934f2f593896d1f1a654845313e1704d66050685bd6d521aa1efda" }, "downloads": -1, "filename": "mistyPy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e8e738cef0007bd0dd492306779fbfa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6423, "upload_time": "2018-09-05T00:04:03", "url": "https://files.pythonhosted.org/packages/a8/38/2f4641a5936e0d85d16c1bbf1bdeec0976af879f2add152260240bd2293d/mistyPy-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "426b6021efa38f03e257e7ec182b5afc", "sha256": "6138d822e516d35c301a673c4408bbe1d9ffabd66f6c385952319068b1b5163f" }, "downloads": -1, "filename": "mistyPy-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "426b6021efa38f03e257e7ec182b5afc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7168, "upload_time": "2018-10-01T03:51:44", "url": "https://files.pythonhosted.org/packages/fb/39/f168bb793025bee0e37ecf0a0717d4790889f25e6502967f235090761dfd/mistyPy-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73e64122ee0819b19290ec392435e314", "sha256": "f3697359707e1df9dbd8e0a543b683087213bb4f80fc00028fb4ea02c442a77f" }, "downloads": -1, "filename": "mistyPy-0.0.3.tar.gz", "has_sig": false, "md5_digest": "73e64122ee0819b19290ec392435e314", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8407, "upload_time": "2018-10-01T03:51:45", "url": "https://files.pythonhosted.org/packages/21/c4/fdbaef716c76f6805addda1d8d0caf5f05d9d2358ccb20d016a71de9eb6b/mistyPy-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "8d02aedf0093c4e5d5ee73932b88f11d", "sha256": "3f62c41454e9738cf2033f14f36c30d22ae50e5a7d499476f43b75e02c0f9e71" }, "downloads": -1, "filename": "mistyPy-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "8d02aedf0093c4e5d5ee73932b88f11d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7186, "upload_time": "2018-11-11T03:39:43", "url": "https://files.pythonhosted.org/packages/2a/e4/e982485889e8e1578c76d830a093d156ecc50b1c9b16552709b90bc9a8a8/mistyPy-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72f08a887e300e8ec4e25da151e321d3", "sha256": "8ecdb75ae25cb5fc3840cf9228dedc26b143da39ca142b337273daa46a0a8031" }, "downloads": -1, "filename": "mistyPy-0.0.4.tar.gz", "has_sig": false, "md5_digest": "72f08a887e300e8ec4e25da151e321d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8423, "upload_time": "2018-11-11T03:39:45", "url": "https://files.pythonhosted.org/packages/a6/ea/495956b17a497b4542f2770ba81a08cc8e57ab3e8dfe1b7fe814c96154d2/mistyPy-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8d02aedf0093c4e5d5ee73932b88f11d", "sha256": "3f62c41454e9738cf2033f14f36c30d22ae50e5a7d499476f43b75e02c0f9e71" }, "downloads": -1, "filename": "mistyPy-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "8d02aedf0093c4e5d5ee73932b88f11d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7186, "upload_time": "2018-11-11T03:39:43", "url": "https://files.pythonhosted.org/packages/2a/e4/e982485889e8e1578c76d830a093d156ecc50b1c9b16552709b90bc9a8a8/mistyPy-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "72f08a887e300e8ec4e25da151e321d3", "sha256": "8ecdb75ae25cb5fc3840cf9228dedc26b143da39ca142b337273daa46a0a8031" }, "downloads": -1, "filename": "mistyPy-0.0.4.tar.gz", "has_sig": false, "md5_digest": "72f08a887e300e8ec4e25da151e321d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8423, "upload_time": "2018-11-11T03:39:45", "url": "https://files.pythonhosted.org/packages/a6/ea/495956b17a497b4542f2770ba81a08cc8e57ab3e8dfe1b7fe814c96154d2/mistyPy-0.0.4.tar.gz" } ] }