Skip to main content

No project description provided

Project description

async def future():
  from robusdk import robusdk, Logger, Sequence, Coroutine, Awaitable
  Client = await robusdk(
    url='http://192.168.192.168:6680/',
    username='admin',
    password='elite2014',
  )
  rpc = Client('RPC')
  pipeline = Client('PIPELINE')
  options = {'repeat': 4, 'delay': 1000}

  Logger.info(await anext(rpc.get_joint_pos()))

  Logger.info(await anext(pipeline.machinePos()))

  async for result in rpc.get_joint_pos():
      Logger.info(result)

  async for result in pipeline.machinePos():
      Logger.info(result)

  Logger.info(await Coroutine([
    Sequence(lambda: rpc.get_joint_pos(), Logger.debug, Logger.error, options),
    Sequence(lambda: pipeline.machinePos(), Logger.debug, Logger.error, options),
    Sequence(lambda: pipeline.motorSpeed(), Logger.debug, Logger.error, options),
  ]))

  Logger.info(await Coroutine([
    *list(map(lambda addr: Sequence(lambda: rpc.getSysVarP(addr=addr), Logger.debug, Logger.error, options), range(4))),
    *list(map(lambda addr: Sequence(lambda: rpc.getSysVarB(addr=addr), Logger.debug, Logger.error, options), range(4))),
  ]))

  Logger.info(await Coroutine([
      Awaitable(lambda: pipeline(['machinePos', 'machinePose']), Logger.info, Logger.error),
  ]))

from asyncio import run
run(future())

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

robusdk-0.4.6.tar.gz (13.6 kB view details)

Uploaded Source

File details

Details for the file robusdk-0.4.6.tar.gz.

File metadata

  • Download URL: robusdk-0.4.6.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for robusdk-0.4.6.tar.gz
Algorithm Hash digest
SHA256 21b263ba79f8e9105ab69d6b6975178d8a9a60ca0873f46f91600d96cb68c1e0
MD5 b572a84c4bf45172952ac4897ef888b2
BLAKE2b-256 aee9447cf3845a5d3c7c14a30e1f5c0512f5d79276412c03c764745ad412071f

See more details on using hashes here.

Supported by

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