pantilt
This is a tool kit containing Python utils
- for driving servos,
- for controlling camera at a two-servos pan tilt by widgets in jupyter notebook and a PS4 Joystick.
Quick Guide
1. To Initiate a Servo
from pantilt import Servo
s1 = Servo(channel=14, bus=0, max_angle=180, min_angle=0)
channel is number that servo has connected to PCA9685 board;
bus can be 0 or 1 or even 2;
max_angle min_angle is upper and lower limit we set for the servo.
s1.to_angle(45)
s1.reset()
s1.change_reset(0)
s1.add()
s1.sub(3)
s1.read()
s1.change_unit(30)
s1.to_min()
s1.to_max()
.to_angle() will turn to a angle;
.reset() will turn servo back to the default angle, which is (max_angle+min_angle)/2 as default;
.change_reset() This will change the default reset angle to input number.
Leaving bracket blank as .change_reset() will apply the current angle.
.add() changes the servo by adding one unit of angle, which is 10 degree as default.
.sub() changes the servo by subtracting one unit of angle;
An integer in its bracket means how many unit it will act on.
.change_unit() will change how many degree it turn for one unit.
.read() can read the current angle of the servo.
.to_min() will turn to the minimum angle.
.to_max() will turn to the maximum angle.
You can open a jupyter notebook file, servo_demo.ipynb, to have a try on this tool kit.
2. To Initiate a Pan Tilt
Its methods to control two servos at a pan tilt is similar to control a servo, here is a jupyter notebook file pan_tilt_demo.ipynb
3. Camera Pan Tilt
Walkthrough is here cam_pan_tilt_demo.ipynb
Install
- Clone the project, please rememeber to clone with parameter —recurse-submodules, because pantilt project referene another submodule bcam.
git clone --recurse-submodules https://github.com/youyoubilly/pantilt.git
- Install pantilt
STL 3D Model
You are welcome to download the stl file I designed for this simple pan tilt of CSI camera, and 3D print it out.
You may adjust the stl model for different use.
Other Languages
English document is available here: GitHub - pantilt
Chinese document is available here: 中文传送门; 国内仓库:Gitee传送门
It would be appreciated if you can contribute to write this document in other languages!
Donate
This project is developed on a non-commercial basis by Open Source enthusiasts.
If you find pantilt useful, you can support the lead developer by donating a few dollars via PayPal.
With this money, we will be able to buy new hardware to test and do more such project for open source and for free education, and generally devote significantly more time to these projects.
Notes
If you find an issue, please let us know!
Sorry that I may have some typos or inaccurate expression in English, help me to correct them if you found one! Big Thanks!
Enjoy!
Useful Links
-
Project: billiocar
Let's learn and play an robotic car with AI technology -
Project: pantilt
This is a tool kit for controlling two servos at a pan tilt in jupyter notebook. -
Project: bcam
bcam is an easy to use Python camera interface for NVIDIA Jetson and Raspberry Pi.
Billy Wang
BillioTech Team
Metadata
Release files for pantilt 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pantilt-0.0.2.tar.gz | 6.6 kB | Without provenance | Details for pantilt-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pantilt-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for pantilt-0.0.2-py3-none-any.whl |
Total release size: 15.1 kB
Release files / pantilt-0.0.2.tar.gz
| Download URL | pantilt-0.0.2.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f7525befb74c8c3cea43e3c3f1df542b4357826a6d6f619704fd802a1181b84
|
|
BLAKE2b-256 checksum How to use checksums |
95d18ef82be180bf24eae5f3fbe1ce7434ede0eaee62ba5241c2fb7d78cc597d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
|
Release files / pantilt-0.0.2-py3-none-any.whl
| Download URL | pantilt-0.0.2-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a626fcc977ab0f53391b5659922029015f8a0fbf370e1c614a7d6b5623586be9
|
|
BLAKE2b-256 checksum How to use checksums |
62acb9926191892eee3761d0e7e69165693f86d03240e567866755f76d3cceff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
|
Security for pantilt 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.