Skip to content

Commit

Permalink
Merge pull request #70 from liufang-robot/master
Browse files Browse the repository at this point in the history
fix: 修正python不能捕获异常的问题
  • Loading branch information
liufang-robot authored Mar 31, 2024
2 parents 22bf0bb + 5681648 commit 722e98f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile command" TRUE)


project(lebai VERSION 1.1.16 LANGUAGES CXX)
project(lebai VERSION 1.1.17 LANGUAGES CXX)
set(PROJECT_NAMESPACE lebai)
message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}")
# message(STATUS "major: ${PROJECT_VERSION_MAJOR}")
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.16
PROJECT_NUMBER = 1.1.17

# 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
Expand Down
4 changes: 4 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## 1.1.17

修正python不能捕获异常的问题。

## 1.1.16

添加接口`get_claw_data`返回数据结构而不是tuple。
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
swig==4.0.2
cmake==3.18.2
readme-renderer==34.0
markdown
markdown==2.6.11
12 changes: 12 additions & 0 deletions sdk/python/l_master.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
#include "lebai/lua_robot.hh"
%}

%exception {
try {
$action
} catch (const std::exception &e) {
PyErr_SetString(PyExc_Exception, e.what());
return NULL;
} catch (...) {
PyErr_SetString(PyExc_Exception, "An unknown exception occurred");
return NULL;
}
}

%extend lebai::l_master::KinematicsForwardResp {
std::string __repr__() {
std::string repr = "{pose: {{x: ";
Expand Down

0 comments on commit 722e98f

Please sign in to comment.