A Python module to control Micromelon Robots over BLE, TCP, or Serial with a Raspberry Pi connected to the rover
Project description
Micromelon Python Module
This module provides an API for connecting and controlling Micromelon Rovers and simulated rovers in the Micromelon Robot Simulator.
The API is equivalent to what is available in the Micromelon Code Editor application.
Installation
pip install micromelon
Usage
After import you will need a reference to the RoverController
from micromelon import *
rc = RoverController()
The RoverController object contains all the functionality for connection and control of the robot's state.
At the start of any script that controls the rover you will need to connect and put the rover in a running state.
Once complete you will need to return the rover to the idle state and optionally you can end the Python program.
rc.connectBLE(1) # Connects over Bluetooth to rover with ID of 1
rc.startRover() # Puts in running state
# Body of script controlling rover
# eg. Motors.write(20, 20, 1)
rc.stopRover() # Returns to idle state
rc.end() # Disconnects and end Python program
Full code examples available in the examples folder.
Documentation
Generating Documentation
Full API documentation available at https://micromelon-robotics.github.io/mm-pymodule/
Documentation is generated through the python module pdoc3.
Full documentation on pdoc available here.
1. Installing pdoc
Install pdoc through pip.
Requires python 3.
pip3 install pdoc3
2. Generating HTML
pdoc --html --template-dir docs/pdoc_templates -o docs micromelon -f
3. Running docs locally
You can run the documentation as a webserver on your local machine with:
pdoc --http : micromelon
Then open http://localhost:8080/
in a browser.
Building
Get Python build tool
python -m pip install --upgrade build
Build package
python -m build
Uploading
Install twine
python -m pip install --upgrade twine
Uploading
python -m twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file micromelon-1.1.1.tar.gz
.
File metadata
- Download URL: micromelon-1.1.1.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 604a5f32fb7368b96ad0baf79ab8ce827324c0e7cc48dc452b4d1c944afd6c97 |
|
MD5 | 3473eabdb6f7ab7355c02ace98922463 |
|
BLAKE2b-256 | 444a2f4e96f0f40d0ed1b39fa10bfe87da9e3a20e71d68fa9afb1df656cebfd4 |
File details
Details for the file micromelon-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: micromelon-1.1.1-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75de25ff69b4644c6f09b8aa5861e2c59c2dc4a3af0633343fdfee11f9d1d03d |
|
MD5 | cca2c9e5ce92648fd516fc7671628c79 |
|
BLAKE2b-256 | afe406238696c7dbe2f07164515153ebe0ed2de6af9b3ad33d75b7ef63f22536 |