Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doplcommunicator-1.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

doplcommunicator-1.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file doplcommunicator-1.0.3.tar.gz.

File metadata

  • Download URL: doplcommunicator-1.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for doplcommunicator-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3b3d6fd27efb901122b016eb5bf75220cec373de9a62d22fdbbdd2791014e276
MD5 50102f19e4279ceb7c97f8a9554e2062
BLAKE2b-256 ffc6743a210a10592692d1bf938e608e35e7ded7889c9365d5e945c177cd37a8

See more details on using hashes here.

File details

Details for the file doplcommunicator-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for doplcommunicator-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ab0abb3cb01e9df55fdb9a3b06c2387ad7f763e775132c96607570d1827fe1
MD5 39650550958bccc4526283edfb8ece16
BLAKE2b-256 13273619fb02dcbb906a4440874d35eefd03bc1a402d311e0e17676cf8f7e46f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page