Python "API" for interacting with The Quadrangles FRC 3494's potential-engine
Project description
upgraded-engineer
upgraded-engineer
is a Python library for interacting with FRC 3494's potential-engine
.
Installation
pip install upgraded-engineer
Dependencies
- GStreamer (base and bad plugins required for
upgraded-engineer
, more required bypotential-engine
) - Open CV (known working with >= 4.0.0, must be compiled with GStreamer support)
Usage
Importing is simple:
import engine
To simply start a new potential-engine
process, create an instance of the engine.Engine
class. You will have to figure out how to write frames into the shared memory yourself. (Note that potential-engine
is expecting I420 color, and cannot determine what is being written for itself.)
Alternatively, using engine.EngineWriter
provides the write_frame
method to write "normal" Open CV BGR color frames into shared memory for streaming.
ew = engine.EngineWriter()
# alternately, if we wanted smaller video
ew = engine.EngineWriter(video_size=(426, 240, 30)) # width, height, framerate
Now, writing frames into shared memory is simple.
def on_new_frame_whenever_that_is_for_you(frame):
ew.write_frame(frame) # ew.write_frame handles the BGR to I420 conversion automagically
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
Hashes for upgraded_engineer-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3a305124ff43a5280221aba98dacf7bd23f95082d7983567cf1bec040064e1 |
|
MD5 | 863369679145dbb32642bbbb351558d0 |
|
BLAKE2b-256 | 402b0066cf5f7cebacff9733a3848ae83fd957f82b38de4384c4e3c880a6b877 |