A Python driver for driving the Rover Robotics Rover Pro robot
Project description
Rover Pro Python Suite
This is the official Python driver for the Rover Robotics "Rover Pro" robot. Use this as a starting point to get up and running quickly.
Included in this package are:
- A Python library for programmatically interfacing with the Rover over USB
- A command line application "
pitstop
" for upgrading and configuring the Rover firmware - A test suite that confirms the Firmware and hardware are operating as expected.
Setup
To install official releases from PyPi:
python3 -m pip install -U pip setuptools
python3 -m pip install -U roverpro --no-cache-dir
On Linux, you may not have permission to access USB devices. If this is the case, run the following then restart your computer:
sudo usermod -a -G dialout $(whoami)
pitstop
Pitstop is a helper program to bootload your rover and set options. After installing the roverpro package, you can invoke it with pitstop
or python3 -m roverpro.pitstop
.
> pitstop --help
usage: pitstop [-h] [-p port] action ...
Rover Pro companion utility to upgrade firmware, configure settings, and test hardware health.
positional arguments:
action
flash write the given firmware hex file onto the rover
checkversion Check the version of firmware installed
test Run tests on the rover
config Update rover persistent settings
optional arguments:
-h, --help show this help message and exit
-p port, --port port Which device to use. If omitted, we will search for a possible rover device
tests
To run tests, first attach the rover via breakout cable then run pitstop test
.
By default, tests that involve running the motors will be skipped, since you may not want a rover ripping cables out of your computer. If you have made sure running the motors will not damage anything, these tests can be opted in with the flag --motorok
.
> pitstop test --motorok
Scanning for possible rover devices
Using device /dev/ttyUSB0
========================== test session starts ============================
platform linux -- Python 3.8.2, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /home/dan/Documents/roverpro-python/roverpro
plugins: trio-0.6.0
collected 73 items
tests/test_bootloader.py .s [ 2%]
tests/test_find_device.py ..... [ 9%]
tests/test_roverpro_protocol.py .... [ 15%]
tests/test_rover.py ..................x.x.........x................Xxxx.......... [ 98%]
tests/burnin/test_burnin.py s [100%]
===== 64 passed, 2 skipped, 6 xfailed, 1 xpassed in 83.94s (0:01:23) =====
Development setup
Manual Prerequisites:
- Python3 (recommended to install Python3.6, Python3.7, and Python3.8 if you plan on using tox for all):
- On Ubuntu:
sudo apt install python3 python3-venv python3-pip
- On another OS: https://www.python.org/downloads/
- On Ubuntu:
- Poetry:
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | (python3 || python)
Then to get and initialize the project:
git clone https://github.com/RoverRobotics/roverpro-python.git
cd roverpro-python
poetry install
poetry run githooks setup
To run a single command: poetry run pitstop --help
Useful commands
Note that you haven't called poetry shell
, you must prepend the following with poetry run
pytest
- Test on current Python interpreter
tox
- Test across multiple versions of Python
black .
- Reformat code to a uniform style
- Update all dependencies to the latest released version
poetry update
Caveats
- When running in PyCharm in debug mode, you will get a warning like "RuntimeWarning: You seem to already have a custom sys.excepthook handler installed ..." https://github.com/python-trio/trio/issues/1553
- Note this is a pyproject (PEP-517) project so it will NOT work to
pip install --editable ...
for development. Instead usepoetry install
as above.
Project details
Release history Release notifications | RSS feed
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 roverpro-1.0.1.tar.gz
.
File metadata
- Download URL: roverpro-1.0.1.tar.gz
- Upload date:
- Size: 121.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.2 Linux/5.4.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 191a02ff2c1ba4c15366f2a0a0066469e9ab0b623066e2c994bc571091e65699 |
|
MD5 | be88ec31c12569b726f5b863ed152351 |
|
BLAKE2b-256 | cb264e91e5dbf083f0615e89eec09ee8967285cf87612f3c399ca8e6426b310b |
File details
Details for the file roverpro-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: roverpro-1.0.1-py3-none-any.whl
- Upload date:
- Size: 125.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.2 Linux/5.4.0-47-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a24b98a240f72e39a10329986e68700892adb339e60fadd3e84b5a70235d5fb |
|
MD5 | 6ae85fbd0f73c55ed9b8eb2df02a45a4 |
|
BLAKE2b-256 | 1039ee3ac12561bd33a12e1d38198ba3e26281430a5b2c088fb55bb75db47029 |