Skip to main content

Lebai Robot Python SDK

Project description

乐白机器人 Python SDK

使用说明

pip install lebai

API文档

提供基于 async/await 的异步 API。

安装依赖(Python 3.7+):

pip install grpcio asyncio protobuf

示例:

import asyncio
import math

from lebai import LebaiRobot, CartesianPose, JointPose

async def run():
    rb = LebaiRobot("192.168.3.218")

    await rb.start_sys()

    await rb.movej(JointPose(0, -1.2, math.pi/6, 0, math.pi/4, 0), 0, 0, 1, 0)

    base = await rb.get_actual_tcp_pose()
    p2 = CartesianPose(0.1, 0, 0, 0, 0, 0, base=base)
    await rb.movel(p2, 0, 0, 1, 0)

    await rb.stop_sys()

if __name__ == '__main__':
    asyncio.run(run())

安装 Python 和 pip

查看 Python 版本:

python --version

如果 Python 版本小于 3.7:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9 python3.9-distutils

Ubunutu 16.04

sudo apt remove python3-pip
sudo python3.9 -m easy_install pip

如果 Python 环境配置有问题:

sudo ln -sf /usr/bin/python3.9 /usr/bin/python3
sudo ln -sf /usr/bin/python3 /usr/bin/python
sudo ln -sf /usr/bin/pip3 /usr/bin/pip
python -m pip install --upgrade pip setuptools wheel

开发人员指南

安装项目依赖

安装依赖:

pip install -r requirements.txt

运行

GRPC_TRACE=all GRPC_VERBOSITY=debug ./main.py

构建和发布

python -m pip install --user pipenv
python3 -m pip install --user --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine upload --repository testpypi dist/*

python3 -m twine upload --repository pypi dist/*

从 PyPI 安装

python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps lebai

pip install lebai

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

lebai-0.1.4.tar.gz (60.6 kB view hashes)

Uploaded Source

Built Distribution

lebai-0.1.4-py3-none-any.whl (63.8 kB view hashes)

Uploaded Python 3

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