Communicates data between dopl and devices
Project description
Data Communicator Client
Sends and receives data between clients connected to Dopl
Usage
# Robot
from doplcommunicator import DoplCommunicator
from doplcommunicator.controllerdata import ControllerData
def on_joined_session(session_id: int):
print('Joined session id', session_id)
def on_controller_data(controller_data: ControllerData):
print('Controller data received', controller_data.toJSON())
# Apply the controller data to the robot
communicator = DoplCommunicator("http://localhost:3000")
communicator.on_joined_session(on_joined_session)
communicator.on_controller_data(on_controller_data)
communicator.connect()
# Robot Controller
import time
from doplcommunicator import DoplCommunicator
from doplcommunicator.controllerdata import ControllerData
def on_joined_session(session_id: int):
print('Joined session id', session_id)
communicator = DoplCommunicator("http://localhost:3000")
communicator.on_joined_session(on_joined_session)
communicator.connect()
while(True):
x = y = z = rx = ry = rz = rw = 0
communicator.controller_data = ControllerData(x, y, z, rx, ry, rz, rw)
time.sleep(0.01)
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 doplcommunicator-1.0.4.tar.gz
.
File metadata
- Download URL: doplcommunicator-1.0.4.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4efbfbc84fd1942b97da2100a1fbab58e55d314e4e74bfd58eb02100d85a32cb |
|
MD5 | 180df034bea82c76c519c35656006823 |
|
BLAKE2b-256 | 786265a5c3d9b5990edaa0040d8dc8b6516570d11dfbf65214a4c84ff74e5646 |
File details
Details for the file doplcommunicator-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: doplcommunicator-1.0.4-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ba594e96380ea3417dd1a5e819b0f473e55430e52bd4513be12e916273d5b9 |
|
MD5 | 924ac6ad0b2d91320fbcb61b57dd7234 |
|
BLAKE2b-256 | dff35232a2f3c645c06c9f4a835d54a4a73acc2c0155d28a182f33403d0a5c67 |