SoftwarePilot
SoftwarePilot is an open source middleware and API that supports aerial applications. SoftwarePilot allows users to connect consumer Parrot Anafi drones to programmable pythonscripts that provide access to the drones flight controller, camera, and navigation system as well as custom rest api and dockerfile integration.
(Streaming features are currently bugged)
Getting Started
Install the library:
- Clone the repo
git clone https://github.com/boredbot2/SoftwarePilot.git
- Pip install
pip install SoftwarePilot
Examples
- Simple Start:
from SoftwarePilot import SoftwarePilot
'''
This is short demo demonstrating how to connect to the drone, and execute a few basic commands
'''
sp = SoftwarePilot()
# Setup a parrot anafi drone, connected through a controller, without a specific download directory
drone = sp.setup_drone("parrot_anafi", 1, "None")
drone.connect()
drone.piloting.takeoff()
# The drone will move forward 2 meters (x, y, z, angle)
drone.piloting.move_by(2,0,0,0, wait = True)
drone.piloting.land()
drone.disconnect()
- Handling Media
from SoftwarePilot import SoftwarePilot
import time
'''
This is short demo demonstrating how to get drone media
'''
sp = SoftwarePilot()
# Setup a parrot anafi drone, connected through a controller, without a specific download directory
drone = sp.setup_drone("parrot_anafi", 1, "None")
drone.connect()
# Without a specified directory, media will be automatically downloaded to AnafiMedia/
# Example of how to setup, take, and download photos
drone.camera.media.setup_photo()
drone.camera.media.take_photo()
drone.camera.media.download_last_media()
# Example of how to setup, take, and download recordings
drone.camera.media.setup_recording()
drone.camera.media.start_recording()
time.sleep(5)
drone.camera.media.stop_recording()
drone.camera.media.download_last_media()
# Example of how to setup and process video live feed
drone.camera.media.setup_stream(
yuv_frame_processing = "None",
yuv_frame_cb = "None",
h264_frame_cb = "None",
start_cb = "None",
end_cb = "None",
flush_cb = "None",
)
# All the callbacks are optional and are automatically set to "None"
# When set to default the stream will download all the frames and provide framerate and bitrate metadata
drone.camera.media.start_stream()
time.sleep(5)
drone.camera.media.stop_stream()
drone.disconnect()
# *Renderer is currently out of service
- Service Interaction
from SoftwarePilot import SoftwarePilot
import time
'''
This is a short demo demonstrating how to boot up a dockerized service and requesting it with SoftwarePilot
SoftwarePilot provides a python template of a Rest API which the user is meant to modify and dockerize
This API is meant to offload the image processing workload to a more capable machine
SoftwarePilot does not limit the service to which it will connect to, but the basic structure must be followed for proper behavior
'''
sp = SoftwarePilot()
sp.setup_docker()
time.sleep(5)
# REPLACE : DOCKER_IMAGE
container = sp.docker.deploy_container("DOCKER_IMAGE", detach = True, ports = {8000:8000})
ip_host = sp.get_host_ip()
service = sp.setup_service(ip_address = ip_host)
response = service.get()
print(response)
# REPLACE : IMAGE_PATH
response = service.run("IMAGE_PATH")
print(response)
- All Together
from SoftwarePilot import SoftwarePilot
import time
'''
This is a short demo combining all the utilies demonstrated
'''
sp = SoftwarePilot()
sp.setup_docker()
time.sleep(5)
# Dockerize SoftwarePilotAPITest and replace "DOCKER_IMAGE" for your custom name
container = sp.docker.deploy_container("DOCKER_IMAGE", detach = True, ports = {8000:8000})
ip_host = sp.get_host_ip()
service = sp.setup_service(ip_address = ip_host)
response = service.get()
print(response)
download_dir = service.get_download_path()
drone = sp.setup_drone("parrot_anafi", 1, download_dir)
drone.connect()
drone.camera.media.setup_photo()
drone.piloting.takeoff()
num_img = 0
while (num_img < 20):
drone.camera.media.take_photo()
image_path = drone.camera.media.download_last_media()
response = service.run(image_path)
print(response)
drone.piloting.move_by(response['x'], response['y'], response['z'], response['angle'])
num_img += 1
drone.piloting.land()
drone.disconnect()
- Async Flight
from SoftwarePilot import SoftwarePilot
'''
This is a short demo demonstrating how asynchronous flight
'''
sp = SoftwarePilot()
drone = sp.setup_drone("parrot_anafi", 1, download_dir)
drone.connect()
drone.piloting.takeoff(queue = True)
drone.piloting.move_by(2, 0, 0, 0, wait=True, queue=True)
drone.piloting.land(queue = True)
drone.piloting.execute_actions()
drone.disconnect()
Authors
Metadata
Release files for SoftwarePilot 1.2.6
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 |
|---|---|---|---|---|
| SoftwarePilot-1.2.6.tar.gz | 16.2 kB | Without provenance | Details for SoftwarePilot-1.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SoftwarePilot-1.2.6-py3-none-any.whl | Python 3 | none | any | Details for SoftwarePilot-1.2.6-py3-none-any.whl |
Total release size: 34.2 kB
Release files / SoftwarePilot-1.2.6.tar.gz
| Download URL | SoftwarePilot-1.2.6.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aaa306682f4bc220d0ed1f48fdb337af1d17971d8538d55458ded123f99df897
|
|
BLAKE2b-256 checksum How to use checksums |
cb9e95ac5e65b22c30b23c04466b8cafb065ad52686b2902e6a9feb2e8bbc52d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Release files / SoftwarePilot-1.2.6-py3-none-any.whl
| Download URL | SoftwarePilot-1.2.6-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1dce5c99e423814e0c8f1f84af1d60311d6e4324d103ce3fa3329ec0543a050
|
|
BLAKE2b-256 checksum How to use checksums |
36c5e6d166dedb7420db89b93917ef98cfa0aad6215f189b3fe0bc2246af7ed9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Security for SoftwarePilot 1.2.6
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.