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.2.tar.gz
.
File metadata
- Download URL: doplcommunicator-1.0.2.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 | 927040bc937fd2ec821e9b95d9a3a4927136594c76ce8c6dce64d1d7ad7f5b0b |
|
MD5 | 53cea5ffd4bdc5bec72b1701130b1de1 |
|
BLAKE2b-256 | fdb3b6fff4cc56801837a8aec9e55c5290bf41b25f170fa8bd44995d00978ecb |
File details
Details for the file doplcommunicator-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: doplcommunicator-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 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 | c693e47f9df3ea8d5fb28c121f58588a9859e14c120977bd77754b979818e5f5 |
|
MD5 | 2b3799e509c354da3c58970bbc637c75 |
|
BLAKE2b-256 | c84663ec6f0c2643065c5ba35a1a22a6b0b791f3777039433a85f6498032baa4 |