Skip to main content

robusdk

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.4.tar.gz (13.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: robusdk-0.4.4.tar.gz
  • Upload date:
  • Size: 13.5 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.4.tar.gz
Algorithm Hash digest
SHA256 c56db1f48ac7c5cefc59dda51c10d31f20bc48461d9c3d6ded5fd8706660a325
MD5 e049c24e338864f44998ad06833137ce
BLAKE2b-256 8ea23491ce9fc8c433005ea4bd023f3204415b324a748706d8d92cd30df34c96

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