Skip to main content

lebai controller python sdk

Project description

Languages

zh en

lebai-sdk的源代码仓库,可以用于控制乐白机械臂.

OS C++ Python C# Java
Linux Status Status Status TODO
Windows TODO TODO Status TODO

上图中显示TODO的地方表示该平台该语言的实现还存在问题,没有完全测试通过,后续会陆续完成。

SDK使用需要乐白机械臂的控制器软件版本大于等于3.1.5,您可以在机械臂WEB界面左上方查看当前版本号.

SDK在线文档中包含了lua语言的接口(本项目参考了lua语言进行接口设置,但是本项目和lua语言的接口无直接关系)

包管理直接安装

python

python开发可以直接从PyPI安装.

目前python仅支持linux平台,windows平台还存在问题.

pip install pylebai

目前支持的Python版本有

  • 3.6
  • 3.7
  • 3.8
  • 3.9
  • 3.10

python开发可以直接从PyPI安装.

.net

.net平台开发可以直接从Nuget安装,使用C#进行开发.

dotnet add package lebai

目前支持的.net版本有

  • 6.0

从源代码构建安装

Ubuntu&&Debian平台

依赖

  • gcc or clang support c++14
  • cmake >= 3.18
  • swig >= 4.0
  • python3 >= 3.5 (可选,如果需要生成python的接口库)
  • doxygen (可选,如果需要C++文档)
  • jdk, maven(可选,如果需要生成java的接口库)

相对旧的发行版系统cmake和swig版本过低,不能使用,可以通过pip安装较新的版本:

sudo apt install build-essential python3-pip dpkg-dev
sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
# 如果需要生成文档,还需要安装doxygen
sudo apt install doxygen graphviz
# 如果需要生成python3的wrapper包
sudo apt install python3-dev python3-setuptools
# 如果需要生成python2的wrapper包
sudo apt install python-dev python-setuptools

编译

# 生成编译配置
cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF
# 生成编译配置,只C++,同时生成DEB包
cmake -S. -Bbuild -DBUILD_PYTHON=OFF -DBUILD_DEB=ON -DBUILD_TESTING=OFF 
# 编译
cmake --build build
# 运行单元测试
cmake --build build --target test
## 生成DEB包
cd build
cpack

Windows平台 Visual Studio

依赖

  • Visual Studio(C++ Support)
  • CMake >= 3.18
  • python3 >= 3.5 (可选,如果需要生成python的接口库)

安装python库时,选择 Download debug binaries

在Visual Studio中载入CMake工程,即可以生成构建运行测试等.

目前Windows平台下python的binding部分还存在问题无法工作.

编译选项

  • BUILD_PYTHON: 是否编译python3接口 默认为OFF
  • BUILD_PYTHON2: 是否编译python2接口 默认为OFF
  • PYTHONPATH: PYTHON的安装目录
  • BUILD_DOTNET: 是否编译.NET接口 默认为OFF(请先安装好.NET的开发环境)
  • BUILD_JAVA: 是否编译JAVA接口 默认为OFF(请先安装好JDK和Maven)
  • BUILD_TESTING: 是否编译C++测试程序 默认为ON
  • TEST_ROBOT_IP: 测试程序的机器人IP地址,正确的设置该值用于单元测试 默认为127.0.0.1
  • BUILD_EXAMPLES: 是否编译示例程序 默认为ON
  • BUILD_DEB: 是否生成DEB包的构建 默认为OFF
  • ENABLE_TSAN: 编译是否启用Thread sanitizer检查 默认为OFF

使用

您可以通过docs目录下的文档了解更多各语言的信息.

Python

build目录下会生成python的whl包,可以直接使用:

cd build/python/dist
## 安装
pip3 install pylebai-xxx.whl
### XXX取决于您的sdk版本,python版本,操作系统平台.
## 卸载
pip3 uninstall pylebai

第三方库

lebai-sdk使用如下第三方软件:

软件名 协议 官方网站
Asio MPL2 https://think-async.com/Asio/
rapidjson MIT https://rapidjson.org/
websocketpp BSD https://www.zaphoyd.com/websocketpp
mdns public domain https://github.com/mjansson/mdns

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pylebai-1.1.7-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pylebai-1.1.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

File details

Details for the file pylebai-1.1.7-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a9c98c284c91bab73468a40e32bd3687efaf557991a15460493aabc41158ef4f
MD5 d1b46de0c98a59e4bff209840e08e618
BLAKE2b-256 c117fafee8f1fcce9ce7627c908c6f61ef1bbbcd9e0863df8832a861383b66d9

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9858e649af79b7c99eb79dfa7d053ccd300469b6e6babe81142f1bc33b9f8b86
MD5 fd9f16a7bee8610f5f12c647ba639a2f
BLAKE2b-256 177ea089ed43448cb3ba9958d7a7c5928656cf8bd72c8e4a09334c42e12c7413

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 708e9b84b29278c7877a9182c8ee5d7a986de03cab541a24b0b493b52751aeb0
MD5 774449c62a948df92bbba69101c0aa1b
BLAKE2b-256 808a7426976fecdeb8346bed88cb3e8ffc6ebd782531331efa6b7b2dd7e544c9

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2e4d9e6549bbcebd169d93a483db6ab6f128e3029d7b392c674cfe182c9baeab
MD5 b12fec88fe8c632d14431f7330583900
BLAKE2b-256 b0871033133796cffabf5ca318b1fce7bf2bb3e3c752f5e09e9e6f0d933ceda2

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d5f765c8cb6a1682cd1657976442331f02b3614e7191153efe3dda3ac5afe6c0
MD5 5673aaffb3090ebb38610d0b7f95921a
BLAKE2b-256 ae9bcfac51a3f4705b4c4c585a24a810a74185a59e08e4b269a283cbb0c23230

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 408f208c37b68cd7f733e48bb0d80916aa502001dbf5a74dfafeec6e233611bd
MD5 18cb7663b21e0a02c6a14f258fde48b1
BLAKE2b-256 fdbe84a61ed28db9e441c1db9df1bf8371fda2e91bd0e4edd441dbea047203f7

See more details on using hashes here.

File details

Details for the file pylebai-1.1.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pylebai-1.1.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c0f4a5bd5f93f5c9032fa39617f6c592e57e511d303d9a51608d2f7430f39187
MD5 cd5ca3d65c31e9a6fb2875292393a4d3
BLAKE2b-256 557840d702df866f0371ebd6baff886c37adc6e4deb7cf365b0ceccabbc25371

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