Local Control

Use the controller locally rather than through a server, primarily for debugging.

Controlling COBOTTA directly with CobottaCtrl

Call the control class directly instead of using a device server. Since the device-server API exposes the control class transparently, usage is largely the same.

from cobotta2 import Config, CobottaCtrl
from x_logger import XLogger

async def main():
    Config.load_yaml("config_cobotta1.yaml")
    logger = XLogger(log_level="info", logger_name=Config.CLIENT_LOGGER_NAME)
    client = CobottaCtrl(cobotta_ip=Config.COBOTTA_IP, logger=logger)
    result = client.get_current_position()
    print(result)
    client.disconnect()

if __name__ == "__main__":
    main()

Author

  • Kengo NAKADA