From 6d8670cdf39106a1442e43ac48b75fa6ee8da1d7 Mon Sep 17 00:00:00 2001 From: liufang Date: Wed, 11 Jan 2023 11:25:17 +0000 Subject: [PATCH 01/23] fix: Add a multi thread example, add windows cpp action file, add a cmake option ENABLE_TSAN for thread sanitizerr --- .github/workflows/windows_cpp_build.yml | 24 +++++++++ CMakeLists.txt | 13 +++-- README.md | 1 + cmake/cpp.cmake | 1 + examples/example.cs | 62 +++++++++++------------ examples/multi_thread.cc | 65 +++++++++++++++++++++++++ sdk/src/jsonrpc_connector.cc | 2 + sdk/src/robot.cc | 4 +- sdk/src/websocket.hh | 12 +++-- 9 files changed, 145 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/windows_cpp_build.yml create mode 100644 examples/multi_thread.cc diff --git a/.github/workflows/windows_cpp_build.yml b/.github/workflows/windows_cpp_build.yml new file mode 100644 index 0000000..d10c480 --- /dev/null +++ b/.github/workflows/windows_cpp_build.yml @@ -0,0 +1,24 @@ +name: Windows cpp build +run-name: ${{ github.actor }} Windows cpp pr build +on: + workflow_dispatch: + pull_request: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + pull-requests: read + +jobs: + windows_cpp_pr_build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check cmake + run: cmake --version + - name: Configure + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" + - name: Build + run: cmake --build build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 4abb28e..05c6a5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,14 @@ else() endforeach() endif() +option(ENABLE_TSAN "Enable thread sanitier" ON) +if(UNIX) + if(ENABLE_TSAN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -g") + set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=thread") + endif() +endif() + # By default only the C++ library is built. option(BUILD_CXX "Build C++ library" ON) message(STATUS "Build C++ library: ${BUILD_CXX}") @@ -134,11 +142,10 @@ add_subdirectory(examples) -find_package(Doxygen QUIET) -option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) +option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ON) if(BUILD_DOCUMENTATION) - # find_package(Doxygen) + find_package(Doxygen) if(NOT DOXYGEN_FOUND) message(FATAL_ERROR "Doxygen is needed to build the documentation.") endif() diff --git a/README.md b/README.md index f279577..dd5550c 100755 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ cpack - TEST_ROBOT_IP: 测试程序的机器人IP地址,正确的设置该值用于单元测试 默认为127.0.0.1 - BUILD_EXAMPLES: 是否编译示例程序 默认为ON - BUILD_DEB: 是否生成DEB包的构建 默认为OFF + - ENABLE_TSAN: 编译是否启用Thread sanitizer检查 默认为OFF ## 使用 您可以通过docs目录下的文档了解更多各语言的信息。 diff --git a/cmake/cpp.cmake b/cmake/cpp.cmake index e8b4de7..a7983b0 100755 --- a/cmake/cpp.cmake +++ b/cmake/cpp.cmake @@ -9,6 +9,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) configure_file("${PROJECT_SOURCE_DIR}/sdk/config.hh.in" "${PROJECT_SOURCE_DIR}/sdk/include/lebai/config.hh") include(GNUInstallDirs) + add_subdirectory(sdk) # Install install(EXPORT ${PROJECT_NAME}Targets diff --git a/examples/example.cs b/examples/example.cs index e419ff2..b275118 100644 --- a/examples/example.cs +++ b/examples/example.cs @@ -1,36 +1,36 @@ using System; using lebai.l_master; -namespace lebai.app -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine($"Enter example"); - Robot robot = new Robot("192.168.1.100", true); - robot.stop_sys(); - Console.WriteLine($"stop..."); - robot.start_sys(); - Console.WriteLine($"start..."); - DoubleVector jp1 = new DoubleVector(); - jp1.Add(0.0); - jp1.Add(-60.0 / 180.0 * 3.14); - jp1.Add(80.0 / 180.0 * 3.14); - jp1.Add(-10.0 / 180.0 * 3.14); - jp1.Add(-60.0 / 180.0 * 3.14); - jp1.Add(0.0); - robot.movej(jp1, 1.0, 1.0, 0.0, 0.0); - DoubleVector jp2 = new DoubleVector(); - jp2.Add(0.0); - jp2.Add(0.0); - jp2.Add(0.0); - jp2.Add(0.0); - jp2.Add(0.0); - jp2.Add(0.0); - robot.movej(jp2, 1.0, 1.0, 0.0, 0.0); - robot.wait_move(); - Console.WriteLine($"Exit example"); - } +namespace lebai.app +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine($"Enter example"); + Robot robot = new Robot("192.168.1.100", true); + robot.stop_sys(); + Console.WriteLine($"stop..."); + robot.start_sys(); + Console.WriteLine($"start..."); + DoubleVector jp1 = new DoubleVector(); + jp1.Add(0.0); + jp1.Add(-60.0 / 180.0 * 3.14); + jp1.Add(80.0 / 180.0 * 3.14); + jp1.Add(-10.0 / 180.0 * 3.14); + jp1.Add(-60.0 / 180.0 * 3.14); + jp1.Add(0.0); + robot.movej(jp1, 1.0, 1.0, 0.0, 0.0); + DoubleVector jp2 = new DoubleVector(); + jp2.Add(0.0); + jp2.Add(0.0); + jp2.Add(0.0); + jp2.Add(0.0); + jp2.Add(0.0); + jp2.Add(0.0); + robot.movej(jp2, 1.0, 1.0, 0.0, 0.0); + robot.wait_move(); + Console.WriteLine($"Exit example"); + } } } diff --git a/examples/multi_thread.cc b/examples/multi_thread.cc new file mode 100644 index 0000000..3cd9427 --- /dev/null +++ b/examples/multi_thread.cc @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include +#include + +void Thread1(lebai::l_master::Robot * robot){ + while(1) + { + robot->start_task("10017"); + robot->wait_move(); + std::cout<<"move done"<get_target_joint_speed(); + robot->get_actual_joint_positions(); + robot->get_actual_tcp_pose(); + robot->get_actual_joint_positions(); + auto jp = robot->get_actual_joint_positions(); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + return; +} + +int main() { + // 172.17.0.4 + lebai::l_master::Robot robot("192.168.1.100", true); + // lebai::l_master::Robot robot("172.17.0.4", true); + std::thread t1(Thread1, &robot); + std::thread t2(Thread2, &robot); + t1.join(); + t2.join(); + +} + + +// #include +// #include + +// int Global; + +// void *Thread1(void *x) { +// Global++; +// return NULL; +// } + +// void *Thread2(void *x) { +// Global--; +// return NULL; +// } + +// int main() { +// pthread_t t[2]; +// pthread_create(&t[0], NULL, Thread1, NULL); +// pthread_create(&t[1], NULL, Thread2, NULL); +// pthread_join(t[0], NULL); +// pthread_join(t[1], NULL); +// } \ No newline at end of file diff --git a/sdk/src/jsonrpc_connector.cc b/sdk/src/jsonrpc_connector.cc index d22ab99..f9a2668 100755 --- a/sdk/src/jsonrpc_connector.cc +++ b/sdk/src/jsonrpc_connector.cc @@ -111,6 +111,8 @@ JSONRpcConnector::~JSONRpcConnector(){} // } // } + + int JSONRpcConnector::CallRpc(const std::string & method, const std::string & req_data_str, std::string * resp_data_str) { int call_jsonrpc_id = jsonrpc_id_++; diff --git a/sdk/src/robot.cc b/sdk/src/robot.cc index f620a5a..d3d105b 100644 --- a/sdk/src/robot.cc +++ b/sdk/src/robot.cc @@ -471,7 +471,7 @@ std::vector Robot::get_target_joint_speed() CartesianPose Robot::get_actual_tcp_pose() { - const auto & pose = impl_->getKinData().actual_tcp_pose(); + auto pose = impl_->getKinData().actual_tcp_pose(); CartesianPose cart_pose; cart_pose["x"] = pose.position().x(); cart_pose["y"] = pose.position().y(); @@ -486,7 +486,7 @@ CartesianPose Robot::get_actual_tcp_pose() } CartesianPose Robot::get_target_tcp_pose() { - const auto & pose = impl_->getKinData().target_tcp_pose(); + auto pose = impl_->getKinData().target_tcp_pose(); CartesianPose cart_pose; cart_pose["x"] = pose.position().x(); cart_pose["y"] = pose.position().y(); diff --git a/sdk/src/websocket.hh b/sdk/src/websocket.hh index 106abf2..628b0f0 100644 --- a/sdk/src/websocket.hh +++ b/sdk/src/websocket.hh @@ -35,6 +35,7 @@ #include #include "protos/utils.hh" + namespace lebai { typedef websocketpp::client WSClient; @@ -53,14 +54,15 @@ namespace lebai void onOpen(WSClient *c, websocketpp::connection_hdl hdl) { + std::lock_guard guard(status_mutex_); status_ = "Open"; - WSClient::connection_ptr con = c->get_con_from_hdl(hdl); server_ = con->get_response_header("Server"); } void onFail(WSClient *c, websocketpp::connection_hdl hdl) { + std::lock_guard guard(status_mutex_); status_ = "Failed"; WSClient::connection_ptr con = c->get_con_from_hdl(hdl); server_ = con->get_response_header("Server"); @@ -69,6 +71,7 @@ namespace lebai void onClose(WSClient *c, websocketpp::connection_hdl hdl) { + std::lock_guard guard(status_mutex_); status_ = "Closed"; WSClient::connection_ptr con = c->get_con_from_hdl(hdl); std::stringstream s; @@ -115,7 +118,10 @@ namespace lebai int getID() const { return id_; } - std::string getStatus() const { return status_; } + std::string getStatus() { + std::lock_guard guard(status_mutex_); + return status_; + } // void record_sent_message(std::string message) { // m_messages.push_back(">> " + message); @@ -142,6 +148,7 @@ namespace lebai std::string server_; std::string error_reason_; std::mutex promises_map_mutex_; + std::mutex status_mutex_; }; // std::ostream& operator<<(std::ostream& out, ConnectionMetadata const& data) { @@ -259,7 +266,6 @@ namespace lebai bool send(int id, std::string message) { - websocketpp::lib::error_code ec; ConList::iterator metadata_it = connection_list_.find(id); From edbf13c2e0f553e287ad6e3eed2f68a01cdea83f Mon Sep 17 00:00:00 2001 From: liufang Date: Wed, 11 Jan 2023 11:33:30 +0000 Subject: [PATCH 02/23] fix: Do not build doc on windows. --- .github/workflows/windows_cpp_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_cpp_build.yml b/.github/workflows/windows_cpp_build.yml index d10c480..4ff8474 100644 --- a/.github/workflows/windows_cpp_build.yml +++ b/.github/workflows/windows_cpp_build.yml @@ -19,6 +19,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_DOCUMENTATION=OFF - name: Build run: cmake --build build \ No newline at end of file From 63b01f575c63c6c83cad988df782f102e4e6c24d Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 04:03:30 +0000 Subject: [PATCH 03/23] fix: Add linux_cpp_build.yml --- .github/workflows/linux_cpp_build.yml | 57 +++++++ .github/workflows/windows_cpp_build.yml | 4 +- .github/workflows/windows_python_build.yml | 24 +++ CMakeLists.txt | 2 + README.md | 16 +- TODO.md | 13 +- cmake/python.cmake | 2 +- python/setup.py.in | 2 +- sdk/include/lebai/discovery.hh | 10 +- sdk/include/lebai/lebai.hh | 14 +- sdk/include/lebai/robot.hh | 188 ++++++++++----------- 11 files changed, 203 insertions(+), 129 deletions(-) create mode 100644 .github/workflows/linux_cpp_build.yml create mode 100644 .github/workflows/windows_python_build.yml diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml new file mode 100644 index 0000000..381f7b1 --- /dev/null +++ b/.github/workflows/linux_cpp_build.yml @@ -0,0 +1,57 @@ +name: Linux cpp build +run-name: ${{ github.actor }} Linux cpp build +on: + workflow_dispatch: + pull_request: +jobs: + linux_cpp_build: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: install components + run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev + + - name: install dependencies + run: pip3 install -r requirements.txt + + - name: configure + run: cmake -S. -Bbuild -DBUILD_DEB=ON + + - name: build + run: cmake --build build + + test: + needs: build + runs-on: ubuntu-latest + container: registry.cn-shanghai.aliyuncs.com/lebai/l-master:latest + steps: + - name: start nginx + run: nginx + + - name: start daemon + run: | + systemctl start l-master-rc + systemctl start l-master-ds + + - name: Checkout + uses: actions/checkout@v3 + + - name: install components + run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev + + - name: install dependencies + run: pip3 install -r requirements.txt + + - name: configure + run: cmake -S. -Bbuild -DBUILD_TESTING=ON + + - name: build + run: cmake --build build + + - name: test + run: cmake --build build --target test diff --git a/.github/workflows/windows_cpp_build.yml b/.github/workflows/windows_cpp_build.yml index 4ff8474..cc7d259 100644 --- a/.github/workflows/windows_cpp_build.yml +++ b/.github/workflows/windows_cpp_build.yml @@ -1,5 +1,5 @@ name: Windows cpp build -run-name: ${{ github.actor }} Windows cpp pr build +run-name: ${{ github.actor }} Windows cpp build on: workflow_dispatch: pull_request: @@ -11,7 +11,7 @@ permissions: pull-requests: read jobs: - windows_cpp_pr_build: + windows_cpp_build: runs-on: windows-latest steps: - name: Checkout diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml new file mode 100644 index 0000000..d8b1571 --- /dev/null +++ b/.github/workflows/windows_python_build.yml @@ -0,0 +1,24 @@ +name: Windows python build +run-name: ${{ github.actor }} Windows python build +on: + workflow_dispatch: + pull_request: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + pull-requests: read + +jobs: + windows_cpp_pr_build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check cmake + run: cmake --version + - name: Configure + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_DOCUMENTATION=OFF + - name: Build + run: cmake --build build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 05c6a5a..1277fab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,8 @@ else() add_compile_definitions(NOMINMAX) add_compile_definitions(_DEBUG) add_compile_definitions(_WEBSOCKETPP_CPP11_RANDOM_DEVICE_) + add_compile_options("$<$:/utf-8>") + add_compile_options("$<$:/utf-8>") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) diff --git a/README.md b/README.md index dd5550c..67e9b2c 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -lebai-sdk的源代码仓库,可以用于控制乐白机械臂。 +lebai-sdk的源代码仓库,可以用于控制乐白机械臂. | OS | C++ | Python | C# | Java | |:-------|-----|--------|----|------| @@ -15,7 +15,7 @@ lebai-sdk的源代码仓库,可以用于控制乐白机械臂。 # 包管理直接安装 -python开发可以直接从[PyPI](https://pypi.org/project/pylebai/)安装。 +python开发可以直接从[PyPI](https://pypi.org/project/pylebai/)安装. ``` pip install pylebai ``` @@ -41,9 +41,9 @@ pip install pylebai ```bash sudo apt install build-essential python3-pip dpkg-dev sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt -# 如果需要生成文档,还需要安装doxygen。 +# 如果需要生成文档,还需要安装doxygen sudo apt install doxygen graphviz -# 如果需要生成python的wrapper包。 +# 如果需要生成python的wrapper包 sudo apt install python3-dev ``` @@ -69,9 +69,9 @@ cpack 安装python库时,选择 `Download debug binaries` -在Visual Studio中载入CMake工程,即可以生成构建运行测试等。 +在Visual Studio中载入CMake工程,即可以生成构建运行测试等. -目前Windows平台下python的binding部分还存在问题无法工作。 +目前Windows平台下python的binding部分还存在问题无法工作. @@ -88,7 +88,7 @@ cpack - ENABLE_TSAN: 编译是否启用Thread sanitizer检查 默认为OFF ## 使用 -您可以通过docs目录下的文档了解更多各语言的信息。 +您可以通过docs目录下的文档了解更多各语言的信息. ### Python build目录下会生成python的whl包,可以直接使用: @@ -96,7 +96,7 @@ build目录下会生成python的whl包,可以直接使用: cd build/python/dist ## 安装 pip3 install pylebai-xxx.whl -### XXX取决于您的sdk版本,python版本,操作系统平台。 +### XXX取决于您的sdk版本,python版本,操作系统平台. ## 卸载 pip3 uninstall pylebai ``` diff --git a/TODO.md b/TODO.md index fb65cb1..828278b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,13 +1,4 @@ # TODO -## v1.0.9 - -- [x] SDK版本 -- [x] 系统控制-reboot -- [x] 配置-从资源库加载TCP -- [x] 位置-从资源库加载路点位姿 -- [x] 运动-关节跟随运动 -- [x] 运动-圆弧运动 -- [x] ModBus -- [x] 把IO相关的API整合一致(类型通过参数传入) -- [x] 获取任务状态 +- [] Windows平台python不能运行(GIL锁)的问题 +- [] Python, C#, C++的测试程序 diff --git a/cmake/python.cmake b/cmake/python.cmake index 337b21e..8f78eff 100755 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -20,7 +20,7 @@ endif() # Find Python 3 find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) -list(APPEND CMAKE_SWIG_FLAGS "-threads" "-py3" "-DPY3") +list(APPEND CMAKE_SWIG_FLAGS "-threads" "-py3" "-DPY3") # Find if the python module is available, # otherwise install it (PACKAGE_NAME) to the Python3 user install directory. diff --git a/python/setup.py.in b/python/setup.py.in index a2a0669..8df0266 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -13,7 +13,7 @@ class InstallPlatlib(install): install.finalize_options(self) self.install_lib=self.install_platlib -with open(r"../../README.md", "r") as fh: +with open(r"../../README.md", "r", encoding='UTF-8') as fh: long_description = fh.read() setup( diff --git a/sdk/include/lebai/discovery.hh b/sdk/include/lebai/discovery.hh index 169bd50..26664c8 100755 --- a/sdk/include/lebai/discovery.hh +++ b/sdk/include/lebai/discovery.hh @@ -25,7 +25,7 @@ namespace lebai namespace zeroconf { /** - * \brief Lebai机械臂控制器的信息数据结构 + * \brief Lebai机械臂控制器的信息数据结构. * */ class ControllerInfo @@ -48,7 +48,7 @@ namespace lebai }; /** - * @brief 自动发现局域网内lebai机械臂。 + * @brief 自动发现局域网内lebai机械臂. * */ class Discovery @@ -71,14 +71,14 @@ namespace lebai virtual ~Discovery(); /** - * @brief 获取局域网内lebai机械臂的信息数据,可以用来自动发现局域网内的所有机械臂控制器 + * @brief 获取局域网内lebai机械臂的信息数据,可以用来自动发现局域网内的所有机械臂控制器. * - * @return std::vector 所有的机械臂的信息数据 + * @return std::vector 所有的机械臂的信息数据. */ std::vector resolve(); protected: - std::unique_ptr impl_; /*!< 内部实现数据结构,用户无需关注。 */ + std::unique_ptr impl_; /*!< 内部实现数据结构,用户无需关注. */ }; } diff --git a/sdk/include/lebai/lebai.hh b/sdk/include/lebai/lebai.hh index 167e9b2..0eb96d1 100644 --- a/sdk/include/lebai/lebai.hh +++ b/sdk/include/lebai/lebai.hh @@ -3,22 +3,22 @@ /*! \mainpage lebai * [TOC] * # 概述 - * Lebai机械臂All in one开发包。开发包通过C++实现和机械臂的通讯,提供和机械臂控制器交互的接口,并且通过[SWIG](https://www.swig.org/ "SWIG")生成其它各种语言的接口库。 + * Lebai机械臂All in one开发包。开发包通过C++实现和机械臂的通讯,提供和机械臂控制器交互的接口,并且通过[SWIG](https://www.swig.org/ "SWIG")生成其它各种语言的接口库. * - * 您可以通过项目的README文档来了解如何构建和安装本开发包。 + * 您可以通过项目的README文档来了解如何构建和安装本开发包. * - * 您也可以基于本开发包创建使用其它语言的开发包。 + * 您也可以基于本开发包创建使用其它语言的开发包. * * # 如何开始 - * 查阅 \ref README.md "README" 文档,了解如何构建和安装本开发包。 + * 查阅 \ref README.md "README" 文档,了解如何构建和安装本开发包. * * # ChangeLog - * 查阅 \ref doc/changelog.md 。 + * 查阅 \ref doc/changelog.md. * * # Python - * 查看 \ref doc/python.md 来获取使用python相关的内容。 + * 查看 \ref doc/python.md 来获取使用python相关的内容. * * # Develop - * 如果需要开发sdk,添加新的功能,可以参考 \ref doc/develop.md 。 + * 如果需要开发sdk,添加新的功能,可以参考 \ref doc/develop.md. */ diff --git a/sdk/include/lebai/robot.hh b/sdk/include/lebai/robot.hh index 907608c..ab7cfff 100644 --- a/sdk/include/lebai/robot.hh +++ b/sdk/include/lebai/robot.hh @@ -273,12 +273,12 @@ namespace lebai * @brief 通过坐标位置发送机械臂直线移动 * @note 该接口为异步接口,仅向控制器内部的运动缓冲区写入一个关节移动即返回,不会等待运动结束. * @param cart_pose: 目标位置在机器人基座标系下的坐标数据(目前不支持在其它坐标系下的坐标数据),CartesianPose = std::map,应当包括键为x,y,z,rz,ry,rx的值. - * @param a: 加速度 - * @param v: 速度 + * @param a: 加速度. + * @param v: 速度. * @param t: 时间参数,如果设置时间不为零,则按照时间计算出速度,而不使用速度参数. * @param r: 交融半径,设置为0,则无交融半径. - * @return >0 发送成功 - * @return <=0 发送失败 + * @return >0 发送成功. + * @return <=0 发送失败. */ int movel(const CartesianPose & cart_pose, double a, double v, double t, double r); /** @@ -288,16 +288,16 @@ namespace lebai * {-28/ 180.0 * M_PI, -59.0/ 180.0 * M_PI, 96.0/ 180.0 * M_PI, -2.0/ 180.0 * M_PI, -92.0/ 180.0 * M_PI, 16.0/ 180.0 * M_PI}, * 0.0, 1.0, 0.5, 0.0, 0.0); * - * @brief 通过关节位置发送机械臂圆弧运动 * + * @brief 通过关节位置发送机械臂圆弧运动. * @param[in] joint_via 圆弧上途径点关节位置,为关节的角度值构成的数组.为圆上三点中的一点. * @param[in] joint 圆弧目标点关节位置,为关节的角度值构成的数组.如果编程rad不为零,则为圆上三点中的一点. * @param[in] rad 圆弧角度值,单位为弧度,如果为零,则走到目标点,正负值用来确定圆弧方向. - * @param[in] a 加速度 - * @param[in] v 速度 + * @param[in] a 加速度. + * @param[in] v 速度. * @param[in] t: 时间参数,如果设置时间不为零,则按照时间计算出速度,而不使用速度参数. * @param[in] r: 交融半径,设置为0,则无交融半径. - * @return >0 发送成功 - * @return <=0 发送失败 + * @return >0 发送成功. + * @return <=0 发送失败. */ int movec(const std::vector & joint_via, const std::vector & joint, double rad, double a, double v, double t, double r); /** @@ -306,12 +306,12 @@ namespace lebai * @param[in] cart_via 圆弧上途径点坐标位置,应当包括键为x,y,z,rz,ry,rx的值.为圆上三点中的一点. * @param[in] cart 圆弧目标点坐标位置,应当包括键为x,y,z,rz,ry,rx的值.如果编程rad不为零,则为圆上三点中的一点. * @param[in] rad 圆弧角度值,单位为弧度,如果为零,则走到目标点,正负值用来确定圆弧方向. - * @param[in] a 加速度 - * @param[in] v 速度 + * @param[in] a 加速度. + * @param[in] v 速度. * @param[in] t: 时间参数,如果设置时间不为零,则按照时间计算出速度,而不使用速度参数. * @param[in] r: 交融半径,设置为0,则无交融半径. - * @return >0 发送成功 - * @return <=0 发送失败 + * @return >0 发送成功. + * @return <=0 发送失败. */ int movec(const CartesianPose & cart_via, const CartesianPose & cart, double rad, double a, double v, double t, double r); /** @@ -321,50 +321,50 @@ namespace lebai * robot.toawrdj(joint_positions, 3.0, 1.0, 0.0, 0.0); * * - * @brief 通过关节位置发送机械臂关节自由移动 + * @brief 通过关节位置发送机械臂关节自由移动. * @note 该接口为异步接口,仅向控制器内部的运动缓冲区写入一个关节自由移动即返回,不会等待运动结束. * @param[in] joint_positions: 目标位置的关节数据,为关节的角度值构成的数组. * @param[in] a: 加速度. * @param[in] v: 速度. * @param[in] t: 时间参数,如果设置时间不为零,则按照时间计算出速度,而不使用速度参数. * @param[in] r: 交融半径,设置为0,则无交融半径. - * @return >0 发送成功 - * @return <=0 发送失败 + * @return >0 发送成功. + * @return <=0 发送失败. * */ int towardj(const std::vector & joint_positions, double a, double v, double t, double r); /** * @brief 伺服运动PVAT * - * @param p 关节位置,或者坐标位置(将通过运动学反解转为关节位置) - * @param v 每个关节的速度 (rad/s)。如该值为数字,则表示所有关节速度相同。 - * @param a 每个关节的加速度 (rad/s2)。如该值为数字,则表示所有关节加速度相同。 + * @param p 关节位置,或者坐标位置(将通过运动学反解转为关节位置). + * @param v 每个关节的速度 (rad/s)。如该值为数字,则表示所有关节速度相同. + * @param a 每个关节的加速度 (rad/s2)。如该值为数字,则表示所有关节加速度相同. * @param t 运动时间 (s) */ void move_pvat(std::vector p, std::vector v, std::vector a, double t); /** - * @brief 等待运动完成 + * @brief 等待运动完成. * - * @param id 指定运动的id(0为等待全部任务) + * @param id 指定运动的id(0为等待全部任务). */ void wait_move(unsigned int id); /** - * @brief 等待所有运动完成 + * @brief 等待所有运动完成. * */ void wait_move(); /** - * @brief 查询当前正在运动的MotionId(无运动时返回上次MotionId) + * @brief 查询当前正在运动的MotionId(无运动时返回上次MotionId). */ unsigned int get_running_motion(); /** - * @brief 查询指定MotionId的运动状态 + * @brief 查询指定MotionId的运动状态. * - * @param id 指定的运动id + * @param id 指定的运动id. */ std::string get_motion_state(unsigned int id); /** - * @brief 停止所有运动 + * @brief 停止所有运动. */ void stop_move(); /** @}*/ @@ -670,15 +670,15 @@ namespace lebai */ void resume_task(unsigned int id); /** - * @brief 取消任务与运动 + * @brief 取消任务与运动. * - * @param id 任务的ID + * @param id 任务的ID. */ void cancel_task(unsigned int id); /** - * @brief 获取任务状态 + * @brief 获取任务状态. * - * @param id 任务的ID + * @param id 任务的ID. */ std::string get_task_state(unsigned int id); /** @}*/ @@ -735,10 +735,10 @@ namespace lebai /** * @brief 重命名文件 * - * @param from_dir: 源文件所在的文件夹 - * @param from_name: 源文件名称 - * @param to_dir: 目标文件文件夹 - * @param to_name: 目标文件文件名 + * @param from_dir: 源文件所在的文件夹. + * @param from_name: 源文件名称. + * @param to_dir: 目标文件文件夹. + * @param to_name: 目标文件文件名. */ void rename_file(const std::string &from_dir,const std::string &from_name,const std::string &to_dir,const std::string &to_name); @@ -753,42 +753,42 @@ namespace lebai std::tuple load_file(const std::string &dir,const std::string &name); /** - * @brief 查询文件列表 + * @brief 查询文件列表. * - * @param dir: 文件的目录 - * @param prefix: 前缀 - * @param suffix: 后缀 + * @param dir: 文件的目录. + * @param prefix: 前缀. + * @param suffix: 后缀. * - * @return 文件列表 + * @return 文件列表. */ std::vector> load_file_list(const std::string &dir,const std::string &prefix,const std::string &suffix); /** - * @brief 将文件从文件系统中压缩到zip文件 + * @brief 将文件从文件系统中压缩到zip文件. * - * @param from_dir 源文件的目录 - * @param files 源文件的文件名 - * @param to_dir 压缩后文件的路径 - * @param name 压缩后文件的名称 + * @param from_dir 源文件的目录. + * @param files 源文件的文件名. + * @param to_dir 压缩后文件的路径. + * @param name 压缩后文件的名称. */ // void zip(const std::string &from_dir, std::vector files, const std::string &to_dir, const std::string &name); // /** - // * @brief 将zip文件解压到文件系统 + // * @brief 将zip文件解压到文件系统. // * - // * @param from_dir zip文件的路径 - // * @param name zip文件的名称 - // * @param files zip文件内的文件名 - // * @param to_dir 解压到的路径 + // * @param from_dir zip文件的路径. + // * @param name zip文件的名称. + // * @param files zip文件内的文件名. + // * @param to_dir 解压到的路径. // */ // void unzip(const std::string &from_dir, const std::string &name, std::vector files, const std::string &to_dir); // /** - // * @brief 查询文件列表 + // * @brief 查询文件列表. // * - // * @brief 目标zip文件名 - // * @param dir 文件的目录 - // * @param prefix 前缀 - // * @param suffix 后缀 + // * @brief 目标zip文件名. + // * @param dir 文件的目录. + // * @param prefix 前缀. + // * @param suffix 后缀. // * - // * @return 文件列表 + // * @return 文件列表. // */ // //std::vector> load_zip_list(const std::string &zip,const std::string &dir,const std::string &prefix,const std::string &suffix); @@ -798,59 +798,59 @@ namespace lebai * @{ */ /** - * @brief 设置工具中心点(TCP)坐标,坐标值相对于工具坐标系 + * @brief 设置工具中心点(TCP)坐标,坐标值相对于工具坐标系. * - * @param tcp 参数为六元组,表示一个空间位置变换 + * @param tcp 参数为六元组,表示一个空间位置变换. */ void set_tcp(std::array tcp); /** - * @brief 获取当前机器人工具中心点设置 + * @brief 获取当前机器人工具中心点设置. * - * @return 当前机器人的工具中心点参数,为六元组 + * @return 当前机器人的工具中心点参数,为六元组. */ std::array get_tcp(); /** - * @brief 设置速度因子 + * @brief 设置速度因子. * - * @param factor 速度因子百分比,范围0-100 + * @param factor 速度因子百分比,范围0-100. */ void set_velocity_factor(int factor); /** - * @brief 获取当前的速度因子 + * @brief 获取当前的速度因子. * - * @return 速度因子百分比 + * @return 速度因子百分比. */ int get_velocity_factor(); /** - * @brief 设置机器人末端负载 + * @brief 设置机器人末端负载. * - * @param mass 末端负载的质量(kg) - * @param cog 质心相对于TCP坐标系的偏移 + * @param mass 末端负载的质量(kg). + * @param cog 质心相对于TCP坐标系的偏移. */ void set_payload(double mass, std::map cog); /** - * @brief 获取末端负载设置 + * @brief 获取末端负载设置. * - * @return 由负载质量mass和负载偏移组成的元组 + * @return 由负载质量mass和负载偏移组成的元组. */ std::tuple> get_payload(); /** - * @brief 设置机器人重力加速度方向 + * @brief 设置机器人重力加速度方向. * - * @param gravity 相对于机器人基座标的重力方向 + * @param gravity 相对于机器人基座标的重力方向. */ void set_gravity(std::map gravity); /** - * @brief 获取机器人重力加速度的方向 + * @brief 获取机器人重力加速度的方向. * - * @return 相对于机器人基座标的重力方向 + * @return 相对于机器人基座标的重力方向. */ std::map get_gravity(); /** - * @brief 从资源库加载tcp + * @brief 从资源库加载tcp. * - * @param name 点位名称 - * @param dir 点位目录 + * @param name 点位名称. + * @param dir 点位目录. */ CartesianPose load_tcp(std::string name, std::string dir = ""); /** @}*/ @@ -861,54 +861,54 @@ namespace lebai */ /** - * @brief 写单个线圈 + * @brief 写单个线圈. * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param value 待设置的值 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param value 待设置的值. */ void write_single_coil(std::string device, std::string addr, bool value); /** * @brief 写多个线圈 * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param values 待设置的值 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param values 待设置的值. */ void wirte_multiple_coils(std::string device, std::string addr, std::vector values); /** * @brief 读线圈 * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param num 连续数量 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param num 连续数量. */ std::vector read_coils(std::string device, std::string addr, unsigned int num); /** * @brief 读离散输入 * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param num 连续数量 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param num 连续数量. */ std::vector read_discrete_inputs(std::string device, std::string addr, unsigned int num); /** * @brief 写单个寄存器 * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param value 待设置的值 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param value 待设置的值. */ void write_single_register(std::string device, std::string addr, unsigned int value); /** * @brief 写多个寄存器 * - * @param device 设备名称 - * @param addr 寄存器地址 - * @param values 待设置的值 + * @param device 设备名称. + * @param addr 寄存器地址. + * @param values 待设置的值. */ void write_multiple_registers(std::string device, std::string addr, std::vector values); From ff39285b994ca58c29ca1205f1e7e645a5f3b046 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 04:06:43 +0000 Subject: [PATCH 04/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3linux=5Fcpp=5Fbu?= =?UTF-8?q?ild.yml=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_cpp_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml index 381f7b1..3ce9aac 100644 --- a/.github/workflows/linux_cpp_build.yml +++ b/.github/workflows/linux_cpp_build.yml @@ -25,8 +25,8 @@ jobs: - name: build run: cmake --build build - test: - needs: build + linux_cpp_test: + needs: linux_cpp_build runs-on: ubuntu-latest container: registry.cn-shanghai.aliyuncs.com/lebai/l-master:latest steps: From e052912880a6429083b8b95df40f17404afd91d5 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 05:05:34 +0000 Subject: [PATCH 05/23] fix: Add linux_python_build.yml --- .github/workflows/linux_python_build.yml | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/linux_python_build.yml diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml new file mode 100644 index 0000000..cc397ca --- /dev/null +++ b/.github/workflows/linux_python_build.yml @@ -0,0 +1,40 @@ +name: Linux python build +run-name: ${{ github.actor }} Linux python build +on: + workflow_dispatch: + pull_request: +jobs: + linux_python_build: + runs-on: ubuntu-latest + container: quay.io/pypa/manylinux2010_x86_64 + steps: + - name: Checkout + uses: actions/checkout@v1 + + - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; + - run: /opt/python/cp310-cp310/bin/pip install twine==2.0.0 + + - name: configure + run: cmake -S. -Bbuild -DBUILD_PYTHON=ON + + - name: build + run: cmake --build build + + - name: create-whl-dir + run: mkdir -p whl + + - name: build with python + run: for PY in /opt/python/*;do + rm -rf build; + cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake --build build; + cp build/python/dist/*.whl whl/; + done; + + - name: repair + run: for PYWHL in whl/*.whl;do + auditwheel repair ${PYWHL}; + done; + + - name: list Pypi + run: ls wheelhouse/* From 7dcbb8f295f8d0e9681daa53e944f0c65ce98e1b Mon Sep 17 00:00:00 2001 From: liufang-robot <61956285+liufang-robot@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:09:43 +0800 Subject: [PATCH 06/23] fix: fix linux_python_build yml format problems. --- .github/workflows/linux_python_build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index cc397ca..f75b1b6 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -25,16 +25,16 @@ jobs: - name: build with python run: for PY in /opt/python/*;do - rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; - cmake --build build; - cp build/python/dist/*.whl whl/; - done; + rm -rf build; + cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake --build build; + cp build/python/dist/*.whl whl/; + done; - name: repair run: for PYWHL in whl/*.whl;do - auditwheel repair ${PYWHL}; - done; + auditwheel repair ${PYWHL}; + done; - name: list Pypi run: ls wheelhouse/* From ab4e70a635656d1a3319797a561872ae64fee0cf Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 06:47:50 +0000 Subject: [PATCH 07/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3linux=5Fpython?= =?UTF-8?q?=5Fbuild=E9=85=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index f75b1b6..f2ceaac 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -10,7 +10,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 - + + - name: install component + run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev + - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; - run: /opt/python/cp310-cp310/bin/pip install twine==2.0.0 From de11b7aaf87248e17e0812621f81ec2ad4f53e49 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:07:17 +0000 Subject: [PATCH 08/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3linux=5Fpython?= =?UTF-8?q?=5Fbuild=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_cpp_build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml index 3ce9aac..4d2493d 100644 --- a/.github/workflows/linux_cpp_build.yml +++ b/.github/workflows/linux_cpp_build.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v3 - name: install components - run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev + run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev - name: install dependencies run: pip3 install -r requirements.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5f7614..a2879bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: python-version: ${{ matrix.py-version }} - name: install component - run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev + run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev - name: install dependencies run: pip3 install -r requirements.txt From 8feb4cc6b0d8ae921494ed517de01942c6dfd473 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:09:36 +0000 Subject: [PATCH 09/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3linux=5Fpython?= =?UTF-8?q?=5Fbuild=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index f2ceaac..90b139a 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v1 - name: install component - run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev + run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; - run: /opt/python/cp310-cp310/bin/pip install twine==2.0.0 From 8fd250d6dfa0d94ca458dcb12ffe5e371b611b7c Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:18:29 +0000 Subject: [PATCH 10/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_cpp_build.yml | 2 +- .github/workflows/linux_python_release.yml | 64 ++++++++++------------ .github/workflows/release.yml | 2 +- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml index 4d2493d..3ce9aac 100644 --- a/.github/workflows/linux_cpp_build.yml +++ b/.github/workflows/linux_cpp_build.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v3 - name: install components - run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev + run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev - name: install dependencies run: pip3 install -r requirements.txt diff --git a/.github/workflows/linux_python_release.yml b/.github/workflows/linux_python_release.yml index 0073b56..06d0c64 100644 --- a/.github/workflows/linux_python_release.yml +++ b/.github/workflows/linux_python_release.yml @@ -1,5 +1,5 @@ name: Linux python release -run-name: ${{ github.actor }} released page +run-name: ${{ github.actor }} Linux python release on: workflow_dispatch: push: @@ -14,36 +14,32 @@ permissions: jobs: linux_python_build_and_release: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux2010_x86_64 - steps: - - name: Checkout - uses: actions/checkout@v1 - - - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; - - run: /opt/python/cp310-cp310/bin/pip install twine==2.0.0 - - - name: configure - run: cmake -S. -Bbuild -DBUILD_PYTHON=ON - - - name: build - run: cmake --build build - - - name: create-whl-dir - run: mkdir -p whl - - - name: build with python - run: for PY in /opt/python/*;do - rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; - cmake --build build; - cp build/python/dist/*.whl whl/; - done; - - - name: repair - run: for PYWHL in whl/*.whl;do - auditwheel repair ${PYWHL}; - done; - - - name: upload Pypi - run: /opt/python/cp310-cp310/bin/twine upload -u ${{ secrets.USRNAME }} -p ${{ secrets.PASSWD }} wheelhouse/*.whl \ No newline at end of file + runs-on: ubuntu-latest + container: quay.io/pypa/manylinux2010_x86_64 + steps: + - name: Checkout + uses: actions/checkout@v1 + + - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; + - run: /opt/python/cp310-cp310/bin/pip install twine==2.0. + - name: configure + run: cmake -S. -Bbuild -DBUILD_PYTHON=O + - name: build + run: cmake --build buil + - name: create-whl-dir + run: mkdir -p wh + - name: build with python + run: for PY in /opt/python/*;do + rm -rf build; + cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake --build build; + cp build/python/dist/*.whl whl/; + done; + + - name: repair + run: for PYWHL in whl/*.whl;do + auditwheel repair ${PYWHL}; + done; + + - name: upload Pypi + run: /opt/python/cp310-cp310/bin/twine upload -u ${{ secrets.USRNAME }} -p ${{ secrets.PASSWD }} wheelhouse/*.whl \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2879bb..e5f7614 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: python-version: ${{ matrix.py-version }} - name: install component - run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev + run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev - name: install dependencies run: pip3 install -r requirements.txt From f02adff1c69d11d721e764400f210e74a5a1f8eb Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:21:27 +0000 Subject: [PATCH 11/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux_python_release.yml b/.github/workflows/linux_python_release.yml index 06d0c64..b02822f 100644 --- a/.github/workflows/linux_python_release.yml +++ b/.github/workflows/linux_python_release.yml @@ -30,16 +30,16 @@ jobs: run: mkdir -p wh - name: build with python run: for PY in /opt/python/*;do - rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; - cmake --build build; - cp build/python/dist/*.whl whl/; - done; + rm -rf build; + cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake --build build; + cp build/python/dist/*.whl whl/; + done; - name: repair run: for PYWHL in whl/*.whl;do - auditwheel repair ${PYWHL}; - done; + auditwheel repair ${PYWHL}; + done; - name: upload Pypi run: /opt/python/cp310-cp310/bin/twine upload -u ${{ secrets.USRNAME }} -p ${{ secrets.PASSWD }} wheelhouse/*.whl \ No newline at end of file From 33375f7e6980d8a014bae9b83781fac99d3ecc8a Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:28:40 +0000 Subject: [PATCH 12/23] =?UTF-8?q?fix:=20workflow=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_build.yml | 3 --- CMakeLists.txt | 9 ++++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index 90b139a..61014c7 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -11,9 +11,6 @@ jobs: - name: Checkout uses: actions/checkout@v1 - - name: install component - run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev dpkg-dev - - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; - run: /opt/python/cp310-cp310/bin/pip install twine==2.0.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1277fab..45215ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,13 +143,12 @@ message(STATUS "Build examples: ${BUILD_EXAMPLES}") add_subdirectory(examples) - -option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ON) +find_package(Doxygen) +option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) if(BUILD_DOCUMENTATION) - find_package(Doxygen) - if(NOT DOXYGEN_FOUND) - message(FATAL_ERROR "Doxygen is needed to build the documentation.") + if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is needed to build the documentation.") endif() set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ) From adbaadbfdcb3e60dc8c9fb39104c28200f027898 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:33:44 +0000 Subject: [PATCH 13/23] fix: change ENABLE_TSAN default to OFF --- .github/workflows/windows_cpp_build.yml | 2 +- .github/workflows/windows_python_build.yml | 2 +- CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows_cpp_build.yml b/.github/workflows/windows_cpp_build.yml index cc7d259..f3a1aa8 100644 --- a/.github/workflows/windows_cpp_build.yml +++ b/.github/workflows/windows_cpp_build.yml @@ -19,6 +19,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_DOCUMENTATION=OFF + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" - name: Build run: cmake --build build \ No newline at end of file diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml index d8b1571..abce0dd 100644 --- a/.github/workflows/windows_python_build.yml +++ b/.github/workflows/windows_python_build.yml @@ -19,6 +19,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_DOCUMENTATION=OFF + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" - name: Build run: cmake --build build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 45215ae..2997313 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,8 @@ else() endforeach() endif() -option(ENABLE_TSAN "Enable thread sanitier" ON) -if(UNIX) +option(ENABLE_TSAN "Enable thread sanitier" OFF) +if(UNIX) if(ENABLE_TSAN) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -g") set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=thread") From e1d9ba2858304dc7cd38d28f09c55701061609d1 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 07:59:26 +0000 Subject: [PATCH 14/23] fix: set BUILD_DOCUMENTATION default to OFF --- .github/workflows/build.yml | 10 +++++----- .github/workflows/linux_cpp_build.yml | 2 +- .github/workflows/linux_cpp_release.yml | 2 +- .github/workflows/linux_python_release.yml | 4 ++-- .github/workflows/release.yml | 10 +++++----- CMakeLists.txt | 6 +++--- CMakeSettings.json | 4 ++-- Doxyfile | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eea1d3c..b10a5c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ -name: Building and checking -run-name: ${{ github.actor }} Building +name: build +run-name: ${{ github.actor }} build on: workflow_dispatch: - push: - pull_request: + # push: + # pull_request: jobs: build: @@ -31,7 +31,7 @@ jobs: run: pip3 install -r requirements.txt - name: configure - run: cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON + run: cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON -DBUILD_DOCUMENTATION=ON - name: build run: cmake --build build diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml index 3ce9aac..e65c464 100644 --- a/.github/workflows/linux_cpp_build.yml +++ b/.github/workflows/linux_cpp_build.yml @@ -48,7 +48,7 @@ jobs: run: pip3 install -r requirements.txt - name: configure - run: cmake -S. -Bbuild -DBUILD_TESTING=ON + run: cmake -S. -Bbuild -DBUILD_TESTING=ON -DBUILD_DOCUMENTATION=ON - name: build run: cmake --build build diff --git a/.github/workflows/linux_cpp_release.yml b/.github/workflows/linux_cpp_release.yml index d308e34..80854f9 100644 --- a/.github/workflows/linux_cpp_release.yml +++ b/.github/workflows/linux_cpp_release.yml @@ -38,7 +38,7 @@ jobs: run: pip3 install -r requirements.txt - name: configure - run: cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON + run: cmake -S. -Bbuild -DBUILD_DEB=ON -DBUILD_DOCUMENTATION=ON - name: build run: cmake --build build diff --git a/.github/workflows/linux_python_release.yml b/.github/workflows/linux_python_release.yml index b02822f..2efe7e7 100644 --- a/.github/workflows/linux_python_release.yml +++ b/.github/workflows/linux_python_release.yml @@ -23,9 +23,9 @@ jobs: - run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done; - run: /opt/python/cp310-cp310/bin/pip install twine==2.0. - name: configure - run: cmake -S. -Bbuild -DBUILD_PYTHON=O + run: cmake -S. -Bbuild -DBUILD_PYTHON=ON - name: build - run: cmake --build buil + run: cmake --build build - name: create-whl-dir run: mkdir -p wh - name: build with python diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5f7614..7ff4442 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,10 @@ name: release -run-name: ${{ github.actor }} released page +run-name: ${{ github.actor }} release on: workflow_dispatch: - push: - tags: - - v1.*.* + # push: + # tags: + # - v1.*.* # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -38,7 +38,7 @@ jobs: run: pip3 install -r requirements.txt - name: configure - run: cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON + run: cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_DEB=ON -DBUILD_DOCUMENTATION=ON - name: build run: cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 2997313..b4ac2ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile command" TRUE) -project(lebai VERSION 1.0.12 LANGUAGES CXX) +project(lebai VERSION 1.0.13 LANGUAGES CXX) set(PROJECT_NAMESPACE lebai) message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}") # message(STATUS "major: ${PROJECT_VERSION_MAJOR}") @@ -144,9 +144,9 @@ add_subdirectory(examples) find_package(Doxygen) -option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) +option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF) -if(BUILD_DOCUMENTATION) +if(BUILD_DOCUMENTATION AND DOXYGEN_FOUND) if(NOT DOXYGEN_FOUND) message(FATAL_ERROR "Doxygen is needed to build the documentation.") endif() diff --git a/CMakeSettings.json b/CMakeSettings.json index 89648ee..c2f03d0 100755 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -28,7 +28,7 @@ }, { "name": "BUILD_PYTHON", - "value": "False", + "value": "True", "type": "BOOL" }, { @@ -38,7 +38,7 @@ }, { "name": "BUILD_DOTNET", - "value": "True", + "value": "False", "type": "BOOL" } ] diff --git a/Doxyfile b/Doxyfile index fe551de..d8b0cb6 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "lebai sdk" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0.12 +PROJECT_NUMBER = 1.0.13 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 8ae3ff82f018607567d440eab6ee2c08493492f0 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 08:04:58 +0000 Subject: [PATCH 15/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3windows=5Fpython?= =?UTF-8?q?=5Fbuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows_python_build.yml | 4 ++-- CMakeSettings.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml index abce0dd..869c345 100644 --- a/.github/workflows/windows_python_build.yml +++ b/.github/workflows/windows_python_build.yml @@ -11,7 +11,7 @@ permissions: pull-requests: read jobs: - windows_cpp_pr_build: + windows_python_build: runs-on: windows-latest steps: - name: Checkout @@ -19,6 +19,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_PYTHON=ON - name: Build run: cmake --build build \ No newline at end of file diff --git a/CMakeSettings.json b/CMakeSettings.json index c2f03d0..cf8740e 100755 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -40,6 +40,11 @@ "name": "BUILD_DOTNET", "value": "False", "type": "BOOL" + }, + { + "name": "BUILD_DOCUMENTATION", + "value": "False", + "type": "BOOL" } ] } From 608c8275a420e07bbd7bcd13387fcb0d5c9c4042 Mon Sep 17 00:00:00 2001 From: liufang Date: Thu, 12 Jan 2023 08:22:11 +0000 Subject: [PATCH 16/23] add python-setup in windows_python_build --- .github/workflows/windows_python_build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml index 869c345..799d0e0 100644 --- a/.github/workflows/windows_python_build.yml +++ b/.github/workflows/windows_python_build.yml @@ -2,7 +2,7 @@ name: Windows python build run-name: ${{ github.actor }} Windows python build on: workflow_dispatch: - pull_request: + # pull_request: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -16,6 +16,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Check cmake run: cmake --version - name: Configure From 11cb6302f6901d48b91635e6632133944255c543 Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 11:25:42 +0000 Subject: [PATCH 17/23] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0dotnet=E7=9A=84w?= =?UTF-8?q?orkflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_dotnet_build.yml | 28 +++++++++++++++++ .github/workflows/linux_dotnet_release.yml | 35 ++++++++++++++++++++++ .github/workflows/windows_cpp_build.yml | 2 +- .github/workflows/windows_python_build.yml | 2 +- CMakeLists.txt | 2 +- TODO.md | 1 + 6 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/linux_dotnet_build.yml create mode 100644 .github/workflows/linux_dotnet_release.yml diff --git a/.github/workflows/linux_dotnet_build.yml b/.github/workflows/linux_dotnet_build.yml new file mode 100644 index 0000000..08a0ef8 --- /dev/null +++ b/.github/workflows/linux_dotnet_build.yml @@ -0,0 +1,28 @@ +name: Linux dotnet build +run-name: ${{ github.actor }} Linux dotnet build +on: + workflow_dispatch: + pull_request: +jobs: + linux_dotnet_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v3.0.3 + + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + + - name: Check dotnet + run: dotnet --info + + - name: configure + run: cmake -S. -Bbuild -DBUILD_DOTNET=ON + + - name: build + run: cmake --build build diff --git a/.github/workflows/linux_dotnet_release.yml b/.github/workflows/linux_dotnet_release.yml new file mode 100644 index 0000000..3b78853 --- /dev/null +++ b/.github/workflows/linux_dotnet_release.yml @@ -0,0 +1,35 @@ +name: Linux dotnet release +run-name: ${{ github.actor }} Linux dotnet release +on: + workflow_dispatch: + push: + tags: + - v1.*.* +jobs: + linux_dotnet_build_and_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v3.0.3 + + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + + - name: Check dotnet + run: dotnet --info + + - name: configure + run: cmake -S. -Bbuild -DBUILD_DOTNET=ON + + - name: build + run: cmake --build build + + - name: upload pacakges + run: + cd ./build/dotnet/packages + dotnet nuget push lebai.1.0.*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/.github/workflows/windows_cpp_build.yml b/.github/workflows/windows_cpp_build.yml index f3a1aa8..cc7d259 100644 --- a/.github/workflows/windows_cpp_build.yml +++ b/.github/workflows/windows_cpp_build.yml @@ -19,6 +19,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_DOCUMENTATION=OFF - name: Build run: cmake --build build \ No newline at end of file diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml index 799d0e0..a2dc0bd 100644 --- a/.github/workflows/windows_python_build.yml +++ b/.github/workflows/windows_python_build.yml @@ -22,6 +22,6 @@ jobs: - name: Check cmake run: cmake --version - name: Configure - run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_PYTHON=ON + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_PYTHON=ON -DBUILD_DOCUMENTATION=OFF - name: Build run: cmake --build build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e6e5d41..23603d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,7 +143,7 @@ add_subdirectory(examples) find_package(Doxygen) -option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF) +option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ON) if(BUILD_DOCUMENTATION AND DOXYGEN_FOUND) if(NOT DOXYGEN_FOUND) diff --git a/TODO.md b/TODO.md index 828278b..9ab320f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,5 @@ # TODO +- [] 把workflow拆分成平台+语言的结构,分成build和release - [] Windows平台python不能运行(GIL锁)的问题 - [] Python, C#, C++的测试程序 From 292f72ea9ea68a8800e481d4f1d24aec859f9c0b Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 11:57:31 +0000 Subject: [PATCH 18/23] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0java=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_java_build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/linux_java_build.yml diff --git a/.github/workflows/linux_java_build.yml b/.github/workflows/linux_java_build.yml new file mode 100644 index 0000000..44b6a5e --- /dev/null +++ b/.github/workflows/linux_java_build.yml @@ -0,0 +1,22 @@ +name: Linux java build +run-name: ${{ github.actor }} Linux java build +on: + workflow_dispatch: + pull_request: +jobs: + linux_java_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: configure + run: cmake -S. -Bbuild -DBUILD_JAVA=ON + + - name: build + run: cmake --build build + From 70a92226879559e1d24b02ba95434f4ee0d045ae Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 12:12:06 +0000 Subject: [PATCH 19/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9python=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=B0=9D=E8=AF=95windows=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_build.yml | 2 +- CMakeLists.txt | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index 61014c7..b105d03 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -26,7 +26,7 @@ jobs: - name: build with python run: for PY in /opt/python/*;do rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake -S. -Bbuild -DBUILD_PYTHON=ON cmake --build build; cp build/python/dist/*.whl whl/; done; diff --git a/CMakeLists.txt b/CMakeLists.txt index 23603d8..1af1535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,10 +89,12 @@ option(BUILD_JAVA "Build Java Library" OFF) message(STATUS "Build Java: ${BUILD_JAVA}") if(BUILD_PYTHON) - if(DEFINED PYTHONPATH) - message(STATUS "Python path: ${PYTHONPATH}") - set(Python3_ROOT_DIR ${PYTHONPATH}) - endif() + option(FETCH_PYTHON_DEPS "Install python required modules if not available" ON) + message(STATUS "Python fetch dependencies: ${FETCH_PYTHON_DEPS}") + # if(DEFINED PYTHONPATH) + # message(STATUS "Python path: ${PYTHONPATH}") + # set(Python3_ROOT_DIR ${PYTHONPATH}) + # endif() endif() # Disable CTest targets From 7b7ce4b6bea7812fc8b0fdc542ad5f9b18ea3612 Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 12:37:38 +0000 Subject: [PATCH 20/23] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3linux=5Fpython?= =?UTF-8?q?=5Fbuild=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_python_build.yml | 2 +- .github/workflows/linux_python_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index b105d03..0a3bd39 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -26,7 +26,7 @@ jobs: - name: build with python run: for PY in /opt/python/*;do rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON + cmake -S. -Bbuild -DBUILD_PYTHON=ON; cmake --build build; cp build/python/dist/*.whl whl/; done; diff --git a/.github/workflows/linux_python_release.yml b/.github/workflows/linux_python_release.yml index 2efe7e7..34d2442 100644 --- a/.github/workflows/linux_python_release.yml +++ b/.github/workflows/linux_python_release.yml @@ -31,7 +31,7 @@ jobs: - name: build with python run: for PY in /opt/python/*;do rm -rf build; - cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY}; + cmake -S. -Bbuild -DBUILD_PYTHON=ON; cmake --build build; cp build/python/dist/*.whl whl/; done; From c07ec873d75250f7097c0f58d9e50890c61fc8fc Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 12:53:47 +0000 Subject: [PATCH 21/23] =?UTF-8?q?fix:=20=E4=BF=AECMakeLists.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/python/CMakeLists.txt | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/sdk/python/CMakeLists.txt b/sdk/python/CMakeLists.txt index 9cdd93b..f1da554 100755 --- a/sdk/python/CMakeLists.txt +++ b/sdk/python/CMakeLists.txt @@ -15,16 +15,7 @@ target_include_directories(l_master ) set_property(TARGET l_master PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) -# note: macOS is APPLE and also UNIX ! -if(APPLE) - set_target_properties(l_master PROPERTIES - SUFFIX ".so" - INSTALL_RPATH "@loader_path;@loader_path/../../${PYTHON_PROJECT}/.libs" - ) - set_property(TARGET l_master APPEND PROPERTY - LINK_FLAGS "-flat_namespace -undefined suppress" - ) -elseif(UNIX) +if(UNIX) set_target_properties(l_master PROPERTIES INSTALL_RPATH "$ORIGIN:$ORIGIN/../${PYTHON_PROJECT}/.libs" ) @@ -58,16 +49,7 @@ target_include_directories(zeroconf ) set_property(TARGET zeroconf PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) -# note: macOS is APPLE and also UNIX ! -if(APPLE) - set_target_properties(zeroconf PROPERTIES - SUFFIX ".so" - INSTALL_RPATH "@loader_path;@loader_path/../../${PYTHON_PROJECT}/.libs" - ) - set_property(TARGET zeroconf APPEND PROPERTY - LINK_FLAGS "-flat_namespace -undefined suppress" - ) -elseif(UNIX) +if(UNIX) set_target_properties(zeroconf PROPERTIES INSTALL_RPATH "$ORIGIN:$ORIGIN/../${PYTHON_PROJECT}/.libs" ) From c2096ee638217c512016b1ff8f7f100bf147dd12 Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 13:39:23 +0000 Subject: [PATCH 22/23] =?UTF-8?q?fix:=20v1.0.14=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- Doxyfile | 2 +- doc/changelog.md | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1af1535..275f9bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile command" TRUE) -project(lebai VERSION 1.0.13 LANGUAGES CXX) +project(lebai VERSION 1.0.14 LANGUAGES CXX) set(PROJECT_NAMESPACE lebai) message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}") # message(STATUS "major: ${PROJECT_VERSION_MAJOR}") diff --git a/Doxyfile b/Doxyfile index d8b0cb6..8a0e534 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "lebai sdk" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0.13 +PROJECT_NUMBER = 1.0.14 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/doc/changelog.md b/doc/changelog.md index 769579c..a18b69e 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -1,5 +1,9 @@ # ChangeLog +## 1.0.14 + +文档更新,持续集成更新,修正程序的错误 + ## 1.0.11 文档更新,持续集成更新 From 027ec192687571f828650d168b94782234fb5437 Mon Sep 17 00:00:00 2001 From: liufang Date: Sat, 14 Jan 2023 13:54:27 +0000 Subject: [PATCH 23/23] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0dotnet=E7=9A=84g?= =?UTF-8?q?ithub=20action=E6=9E=84=E5=BB=BA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- README.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 275f9bb..173045a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(isMultiConfig) if(NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING - "Choose the type of builds, options are: Debug Release RelWithDebInfo MinSizeRel. (default: Release;Debug)" + "Choose the type ofgi builds, options are: Debug Release RelWithDebInfo MinSizeRel. (default: Release;Debug)" FORCE) endif() message(STATUS "Configuration types: ${CMAKE_CONFIGURATION_TYPES}") diff --git a/README.md b/README.md index 67e9b2c..75140d7 100755 --- a/README.md +++ b/README.md @@ -2,13 +2,15 @@ lebai-sdk的源代码仓库,可以用于控制乐白机械臂. | OS | C++ | Python | C# | Java | |:-------|-----|--------|----|------| -| Linux | [![Status][cpp_linux_svg]][cpp_linux_link] | [![Status][python_linux_svg]][python_linux_link] | TODO | TODO | +| Linux | [![Status][cpp_linux_svg]][cpp_linux_link] | [![Status][python_linux_svg]][python_linux_link] | [![Status][dotnet_linux_svg]][dotnet_linux_link] | TODO | | Windows | TODO | TODO | TODO | TODO | [cpp_linux_svg]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_cpp_release.yml/badge.svg [cpp_linux_link]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_cpp_release.yml [python_linux_svg]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_python_release.yml/badge.svg [python_linux_link]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_python_release.yml +[dotnet_linux_svg]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_dotnet_release.yml/badge.svg +[dotnet_linux_link]: https://github.com/lebai-robotics/lebai-sdk/actions/workflows/linux_dotnet_release.yml [SDK在线文档](http://help.lebai.ltd/sdk/)