Skip to main content

Communicates data between dopl and devices

Project description

Data Communicator Client

Sends a 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.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

doplcommunicator-1.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: doplcommunicator-1.0.1.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

Hashes for doplcommunicator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 af6f504badfe61ff8f0379595b623f7057d7c17e5ed8a67e5ec21f68fc81eff5
MD5 b69f8cca084b02c2e45c775b2bf8e850
BLAKE2b-256 f3449a080a6f4b35470f0b3f56faf157a649a3fd82ecf479a4d113dd74d21e77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for doplcommunicator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16bcbc66e65ca154f0f0e91875e4cf930330f172f4a5e3fc571ae8c654c01122
MD5 e0f8c2526341953e8dc27741e11eb940
BLAKE2b-256 f48b8eb506a9cbf41396e2f5db27ae130b06677e92e7add1fb48115c358f2dd6

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