{"id":15009918,"url":"https://github.com/momsfriendlyrobotcompany/pycreate2","last_synced_at":"2025-09-08T01:32:30.850Z","repository":{"id":37561556,"uuid":"92549148","full_name":"MomsFriendlyRobotCompany/pycreate2","owner":"MomsFriendlyRobotCompany","description":"library for iRobot Create 2","archived":false,"fork":false,"pushed_at":"2023-01-26T02:14:45.000Z","size":8115,"stargazers_count":69,"open_issues_count":2,"forks_count":45,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-26T21:07:04.880Z","etag":null,"topics":["create2","irobot","python","python-3","robotics"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pycreate2/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MomsFriendlyRobotCompany.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-26T21:19:46.000Z","updated_at":"2024-07-01T16:45:18.000Z","dependencies_parsed_at":"2023-02-14T13:30:44.650Z","dependency_job_id":null,"html_url":"https://github.com/MomsFriendlyRobotCompany/pycreate2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Fpycreate2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Fpycreate2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Fpycreate2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Fpycreate2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyRobotCompany","download_url":"https://codeload.github.com/MomsFriendlyRobotCompany/pycreate2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232271901,"owners_count":18497768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["create2","irobot","python","python-3","robotics"],"created_at":"2024-09-24T19:29:07.302Z","updated_at":"2025-01-03T00:11:15.920Z","avatar_url":"https://github.com/MomsFriendlyRobotCompany.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://raw.githubusercontent.com/walchko/pycreate2/master/pics/create.png)\n\n# pyCreate2\n\n[![Actions Status](https://github.com/MomsFriendlyRobotCompany/pycreate2/workflows/CheckPackage/badge.svg)](https://github.com/MomsFriendlyRobotCompany/pycreate2/actions)\n![GitHub](https://img.shields.io/github/license/MomsFriendlyRobotCompany/pycreate2)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pycreate2)\n![PyPI](https://img.shields.io/pypi/v/pycreate2)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/pycreate2?color=aqua)\n\nA python library for controlling the [iRobot\nCreate 2](http://www.irobot.com/About-iRobot/STEM/Create-2.aspx). This was used\nin ECE 387 Introduction to Robotics class I taught at the US Air Force Academy.\n\n- [video](https://vimeo.com/266619301): robot could only follow the black tap road and couldn't run into anything. If anything got in the way, it had to naviage around it to its final destination\n- [video](https://vimeo.com/266619767): robot pet, follow the pink ball\n- [video](https://vimeo.com/266619636): robot pet, follow the pink ball\n\n## Install\n\n### pip\n\nThe recommended way to install this library is:\n\n```bash\npip install pycreate2\n```\n\n### Development\n\nIf you wish to develop and submit git-pulls, you can do:\n\n```bash\ngit clone https://github.com/walchko/pycreate2\ncd pycreate2\npoetry install\npoetry run pytest -v\n```\n\n## Use\n\nThere are multiple ways to command the Create to move, here are some\nexamples:\n\n```python\nfrom  pycreate2 import Create2\nimport time\n\n# Create a Create2.\nport = \"/dev/serial\"  # where is your serial port?\nbot = Create2(port)\n\n# Start the Create 2\nbot.start()\n\n# Put the Create2 into 'safe' mode so we can drive it\n# This will still provide some protection\nbot.safe()\n\n# You are responsible for handling issues, no protection/safety in\n# this mode ... becareful\nbot.full()\n\n# directly set the motor speeds ... move forward\nbot.drive_direct(100, 100)\ntime.sleep(2)\n\n# turn in place\nbot.drive_direct(200,-200)  # inputs for motors are +/- 500 max\ntime.sleep(2)\n\n# Stop the bot\nbot.drive_stop()\n\n# query some sensors\nsensors = bot.get_sensors()  # returns all data\nprint(sensors.light_bumper_left)\n\n# Close the connection\n# bot.close()\n```\n\nMore examples are found in the [examples\nfolder](https://github.com/walchko/pycreate2/tree/master/examples).\n\n## Documents\n\nAdditional notes and documents are in the [docs\nfolder](https://github.com/walchko/pycreate2/tree/master/docs/Markdown).\n\n### Modes\n\n![image](https://raw.githubusercontent.com/walchko/pycreate2/master/pics/create_modes.png)\n\nThe different modes (OFF, PASSIVE, SAFE, and FULL) can be switched\nbetween by calling different commands.\n\n  - **OFF:** The robot is off and can charge, it will accept no commands\n  - **PASSIVE:** The robot is in standbye and can charge. It will send\n    sensor packets, but will not move\n  - **SAFE:** The robot will not charge, but you full control over it\n    with a few exceptions. If the cliff sensors or wheel drop sensors\n    are triggered, the robot goes back to PASSIVE mode.\n  - **FULL:** The robot will not charge and you have full control. You\n    are responsible to handle any response due to cliff, wheel drop or\n    any other sensors.\n\n### Sensor Data\n\nSensor data is returned as a `namedtuple` from `collections`. The\ninformation can be accessed as either:\n\n```python\nsensors = bot.get_sensors()\nsensors.wall == sensors[1]  # True\n```\n\n| Sensor                       | Range             | Index |\n|------------------------------|-------------------|-------|\n| bumps\\_wheeldrops            | \\[0-15\\]          |   0   |\n| wall                         | \\[0-1\\]           |   1   |\n| cliff\\_left                  | \\[0-1\\]           |   2   |\n| cliff\\_front\\_left           | \\[0-1\\]           |   3   |\n| cliff\\_front\\_right          | \\[0-1\\]           |   4   |\n| cliff\\_right                 | \\[0-1\\]           |   5   |\n| virtual\\_wall                | \\[0-1\\]           |   6   |\n| overcurrents                 | \\[0-29\\]          |   7   |\n| dirt\\_detect                 | \\[0-255\\]         |   8   |\n| ir\\_opcode                   | \\[0-255\\]         |   9   |\n| buttons                      | \\[0-255\\]         |   10  |\n| distance                     | \\[-322768-32767\\] |   11  |\n| angle                        | \\[-322768-32767\\] |   12  |\n| charger\\_state               | \\[0-6\\]           |   13  |\n| voltage                      | \\[0-65535\\]       |   14  |\n| current                      | \\[-322768-32767\\] |   15  |\n| temperature                  | \\[-128-127\\]      |   16  |\n| battery\\_charge              | \\[0-65535\\]       |   17  |\n| battery\\_capacity            | \\[0-65535\\]       |   18  |\n| wall\\_signal                 | \\[0-1023\\]        |   19  |\n| cliff\\_left\\_signal          | \\[0-4095\\]        |   20  |\n| cliff\\_front\\_left\\_signal   | \\[0-4095\\]        |   21  |\n| cliff\\_front\\_right\\_signal  | \\[0-4095\\]        |   22  |\n| cliff\\_right\\_signal         | \\[0-4095\\]        |   23  |\n| charger\\_available           | \\[0-3\\]           |   24  |\n| open\\_interface\\_mode        | \\[0-3\\]           |   25  |\n| song\\_number                 | \\[0-4\\]           |   26  |\n| song\\_playing                | \\[0-1\\]           |   27  |\n| oi\\_stream\\_num\\_packets     | \\[0-108\\]         |   28  |\n| velocity                     | \\[-500-500\\]      |   29  |\n| radius                       | \\[-322768-32767\\] |   30  |\n| velocity\\_right              | \\[-500-500\\]      |   31  |\n| velocity\\_left               | \\[-500-500\\]      |   32  |\n| encoder\\_counts\\_left        | \\[-322768-32767\\] |   33  |\n| encoder\\_counts\\_right       | \\[-322768-32767\\] |   34  |\n| light\\_bumper                | \\[0-127\\]         |   35  |\n| light\\_bumper\\_left          | \\[0-4095\\]        |   36  |\n| light\\_bumper\\_front\\_left   | \\[0-4095\\]        |   37  |\n| light\\_bumper\\_center\\_left  | \\[0-4095\\]        |   38  |\n| light\\_bumper\\_center\\_right | \\[0-4095\\]        |   39  |\n| light\\_bumper\\_front\\_right  | \\[0-4095\\]        |   40  |\n| light\\_bumper\\_right         | \\[0-4095\\]        |   41  |\n| ir\\_opcode\\_left             | \\[0-255\\]         |   42  |\n| ir\\_opcode\\_right            | \\[0-255\\]         |   43  |\n| left\\_motor\\_current         | \\[-322768-32767\\] |   44  |\n| right\\_motor\\_current        | \\[-322768-32767\\] |   45  |\n| main\\_brush\\_current         | \\[-322768-32767\\] |   46  |\n| side\\_brush\\_current         | \\[-322768-32767\\] |   47  |\n| statis                       | \\[0-3\\]           |   48  |\n\n\n## Change Log\n\n|            |       |                               |\n| ---------- | ----- | ----------------------------- |\n| 2021-02-22 | 0.8.1 | Cleaned up code               |\n| 2020-02-16 | 0.8.0 | Simplified interface and bug fixes |\n| 2020-02-16 | 0.7.7 | Fixed typo with poetry        |\n| 2020-02-16 | 0.7.6 | Fixed typo erro in `bin`      |\n| 2020-02-16 | 0.7.5 | Switched to toml and poetry   |\n| 2019-06-30 | 0.7.4 | Midi sounds working           |\n| 2017-08-26 | 0.7.3 | code clean up and doc updates |\n| 2017-08-26 | 0.7.2 | updates and fixes             |\n| 2017-05-26 | 0.5.0 | init and published to pypi    |\n\n# The MIT License\n\n**Copyright (c) 2007 Damon Kohler**\n\n**Copyright (c) 2015 Jonathan Le Roux (Modifications for Create 2)**\n\n**Copyright (c) 2015 Brandon Pomeroy**\n\n**Copyright (c) 2017 Kevin Walchko**\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlyrobotcompany%2Fpycreate2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlyrobotcompany%2Fpycreate2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlyrobotcompany%2Fpycreate2/lists"}