Skip to main content

SSLVision client API in python

Project description

The MIT License (MIT)

Copyright (c) 2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: # Python SSL Vision Client

[![PyPI version](https://badge.fury.io/py/sslclient.svg)](https://badge.fury.io/py/sslclient)
[![pypi supported versions](https://img.shields.io/pypi/pyversions/sslclient.svg)](https://pypi.python.org/pypi/sslclient)

Python client for [SSL Vision](https://github.com/RoboCup-SSL/ssl-vision)



## Installation


From source:

```
git clone --recursive https://github.com/Juniorlimaivd/python-ssl-client.git
cd python-ssl-client
python setup.py install
```

From [PyPi](https://pypi.python.org/pypi/sslclient/) directly:

```
pip install sslclient
```

## Example

```Python
import sslclient

c = sslclient.client(ip='255.255.255.255', port=1234)

# Bind connection to port and IP for UDP Multicast
c.connect()

while True:
#received decoded package
data = c.receive()

if data.HasField('geometry'):
print(data.geometry)

if data.HasField('detection'):
print(data.detection)
```

The data packet may have detection or geometry data. Consult SSL Vision Docs to know when you will receive each type of package.

The formats of the geometry and detection data are de followings:


### `Detection Example`


```json
{
"detection": {
"frame_number": 377308,
"t_capture": 13977.820277,
"t_sent": 1505683703.172275,
"camera_id": 1,
"balls": [
{
"confidence": 0.930344820022583,
"area": 78,
"x": -14.979391098022461,
"y": -12.432811737060547,
"z": 0,
"pixel_x": 276.5769348144531,
"pixel_y": 225.73077392578125
}
"{... other balls ...}"
],
"robots_yellow": [
{
"confidence": 0.930344820022583,
"area": 78,
"x": -14.979391098022461,
"y": -12.432811737060547,
"z": 0,
"pixel_x": 276.5769348144531,
"pixel_y": 225.73077392578125
}
"{... other yellow robots ...}"
],
"robots_blue": [
{
"confidence": 0.930344820022583,
"area": 78,
"x": -14.979391098022461,
"y": -12.432811737060547,
"z": 0,
"pixel_x": 276.5769348144531,
"pixel_y": 225.73077392578125
}
"{... other blue robots ...}"
]
}
}
```


### `Geometry Example`

```json
{
"field": {
"field_length": 1500,
"field_width": 1300,
"goal_width": 100,
"goal_depth": 40,
"boundary_width": 3,
"field_lines": [
{
"name": "TopTouchLine",
"p1": {
"x": -750,
"y": 650
},
"p2": {
"x": 750,
"y": 650
},
"thickness": 10
},
"{... other field lines ...}"
],
"field_arcs": [
{
"name": "CenterCircle",
"center": {
"x": 0,
"y": 0
},
"radius": 150,
"a1": 10,
"a2": 0,
"thickness": 10
},
"{... other field arcs ...}"
]
},
"calib": [
{
"camera_id": 0,
"focal_length": 2.1379730701446533,
"principal_point_x": 390,
"principal_point_y": 290,
"distortion": 0,
"q0": -0.0780009999871254,
"q1": -0.9969499707221985,
"q2": 0.0014819999923929572,
"q3": 0.0017130000051110983,
"tx": -621141.125,
"ty": -459652.8125,
"tz": 3500,
"derived_camera_world_tx": -542101.5625,
"derived_camera_world_ty": 550669.6875,
"derived_camera_world_tz": -0.6016282439231873
},
"{... other cameras ...}"
]
}
```
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

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

sslclient-1.1.0.tar.gz (9.4 kB view hashes)

Uploaded source

Built Distributions

sslclient-1.1.0-py3-none-any.whl (13.6 kB view hashes)

Uploaded py3

sslclient-1.1.0-py2-none-any.whl (16.3 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page