mirobot
Description
mirobot is a python module that can be used to control the WLkata Mirobot
This library uses the G code protocol to communicate with the Mirobot over a serial connection. The official G code instruction set and driver download for the Mirobot can be found at the WLkata Download Page
Installation
mirobot requires Python >= 3.6. Use pip3 to install it:
pip3 install mirobot-py
Make sure to not install the mirobot package-- that package is unrelated to this one.
Example Usage
from mirobot import Mirobot
with Mirobot(portname='COM3', debug=True) as m:
m.home_individual()
m.go_to_zero()
And that's it! Now if you want to save keystrokes, here's a even more minimal version:
from mirobot import Mirobot
with Mirobot() as m:
m.home_simultaneous()
The Mirobot class can detect existing open serial ports and "guess" which one to use as the Mirobot. There's no need to specify a portname for most cases!
Documentation
Many of the functions and structures in this library are documented. The documentation is hosted here. If anything is unclear in the docs, please open a Github issue.
Differences from source repository
Credits
Big thanks to Mattew Wachter for laying down the framework for this library-- please check out his links below:
Reasons to fork (and not merge upstream)
While based of the same code initially, this repository has developed in a different direction with opinionated views on how one should use a robotics library. Specifically, there is the problem of 'output' when operating a gcode-programmed machine like Mirobot.
-
Matthew's library takes the traditional approach to recieving output from the robot as they appear. Basically this replicates the live terminal feedback in a client similar to Wlkata's Studio program. The original code has a thread listening the background for new messages and displays them as they appear.
-
This repository intends to take a more programmatic approach to this behavior. Specifically it narrows down the path to responsibility by explicitly pairing each command to its output. In a stream-messages-as-they-come approach to output messaging, it is not clear (or atleast easy) to determine which command failed and how to ensure scripts stop execution at exactly the point of failure (and not after). That is why each instruction in this library has a dedicated output, ensuring success and having its own message output as a return value. This approach is a lot harder to construct and relies on adapting to the idiosyncrasies of gcode and Mirobot programming.
In the end, while developing this approach to error responsibility, I realized that this would probably not suit everyone's needs-- sometimes people just want a live feed of output. That is why I think Matthew's continued work would be great for the community. I don't want this repository and its beliefs to consume another. I also do not see a way to combine both approaches-- they are inherently incompatible at the core level.
It is my belief that people who are looking to do significant scripting and logic-testing routines will benefit greatly from this library. People who are looking to use a CLI-friendly framework should instead use Matthew's py-mirobot library.
License
License: MIT
Metadata
Release files for mirobot-py 1.0.52
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mirobot-py-1.0.52.tar.gz | 23.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mirobot_py-1.0.52-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.9 kB
Release files / mirobot-py-1.0.52.tar.gz
| Download URL | mirobot-py-1.0.52.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f7c2259e28beb4329b4cdc4e593ae3ce38fb2ead98b822adf79271ad8c5e0e0
|
|
BLAKE2b-256 checksum How to use checksums |
1a41fb34d5635da743333c52f09681b6589bae6d61f96def6a8aa9d1344d9677
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / mirobot_py-1.0.52-py3-none-any.whl
| Download URL | mirobot_py-1.0.52-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
137f820e0f279961a6fec48b064ae471029fbc7db16b86aeaa869c81030ffb2c
|
|
BLAKE2b-256 checksum How to use checksums |
d10307b3cf43e809b9ab7317f21186496e60ee98b58f8581c72e62109967276f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|