Skip to content

Commit d88b6e0

Browse files
Merge branch 'main' into osx_support
2 parents 51b65d9 + 4847ac7 commit d88b6e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+640
-594
lines changed

CMakeLists.txt

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
project(elite-cs-series-sdk VERSION 1.2.0)
3+
project(elite-cs-series-sdk VERSION 1.3.0)
44

55
option(ELITE_COMPILE_TESTS "Compile tests" OFF)
66
option(ELITE_COMPILE_DOC "Compile documentation" OFF)
@@ -22,7 +22,7 @@ else()
2222
message(FATAL_ERROR "C++ standard must C++14 or higher")
2323
endif()
2424

25-
# --- MODIFIED: 使用现代化的 CONFIG 模式查找 Boost,并移除了写死的版本号 ---
25+
2626
find_package(Boost REQUIRED CONFIG COMPONENTS system thread)
2727
find_package(libssh)
2828
if(libssh_FOUND)
@@ -38,7 +38,7 @@ configure_file(
3838
# Source file list
3939
set(
4040
ELITE_LIB_SOURCE_FILE
41-
source/Common/Utils.cpp
41+
source/Common/StringUtils.cpp
4242
source/Common/TcpServer.cpp
4343
source/Common/EliteException.cpp
4444
source/Common/SshUtils.cpp
@@ -78,17 +78,31 @@ set(
7878

7979
set(
8080
ELITE_HEADER_FILES
81-
Elite/DataType.hpp Elite/VersionInfo.hpp Dashboard/DashboardClient.hpp
82-
Rtsi/RtsiClientInterface.hpp Rtsi/RtsiIOInterface.hpp Rtsi/RtsiRecipe.hpp
83-
Primary/PrimaryPackage.hpp Primary/RobotConfPackage.hpp Primary/PrimaryPortInterface.hpp
84-
EliteException.hpp Elite/EliteDriver.hpp Elite/Log.hpp Elite/RemoteUpgrade.hpp
85-
Elite/ControllerLog.hpp Elite/RobotException.hpp Common/RtUtils.hpp
81+
Elite/DataType.hpp
82+
Elite/VersionInfo.hpp
83+
Dashboard/DashboardClient.hpp
84+
Rtsi/RtsiClientInterface.hpp
85+
Rtsi/RtsiIOInterface.hpp
86+
Rtsi/RtsiRecipe.hpp
87+
Primary/PrimaryPackage.hpp
88+
Primary/RobotConfPackage.hpp
89+
Primary/PrimaryPortInterface.hpp
90+
EliteException.hpp
91+
Elite/EliteDriver.hpp
92+
Elite/Log.hpp
93+
Elite/RemoteUpgrade.hpp
94+
Elite/ControllerLog.hpp
95+
Elite/RobotException.hpp
96+
Common/RtUtils.hpp
97+
Common/SshUtils.hpp
98+
Common/Utils.hpp
99+
Common/EndianUtils.hpp
100+
Common/StringUtils.hpp
86101
)
87102

88103
set(SDK_STATIC_LIB_OUTPUT_NAME "${PROJECT_NAME}")
89104
set(SDK_SHARED_LIB_OUTPUT_NAME "${PROJECT_NAME}")
90105

91-
# --- MODIFIED: 增加对 macOS (APPLE) 的支持 ---
92106
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
93107
message(STATUS "SYSTEM: Windows")
94108
add_definitions(-D_WIN32_WINNT=0x0601)
@@ -108,7 +122,6 @@ endif()
108122
add_library(${PROJECT_NAME}_SHARED SHARED ${ELITE_LIB_SOURCE_FILE})
109123
add_library(${PROJECT_NAME}_STATIC STATIC ${ELITE_LIB_SOURCE_FILE})
110124

111-
# --- MODIFIED: 使用现代化的方式为目标添加 ELITE_EXPORT_LIBRARY 编译定义 ---
112125
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
113126
target_compile_definitions(${PROJECT_NAME}_SHARED PRIVATE ELITE_EXPORT_LIBRARY)
114127
target_compile_definitions(${PROJECT_NAME}_STATIC PRIVATE ELITE_EXPORT_LIBRARY)
@@ -151,7 +164,6 @@ endif()
151164
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" is_top_level)
152165
option(ELITE_INSTALL "Include packaging rules" "${is_top_level}")
153166

154-
# --- MODIFIED: 增加对 macOS (APPLE) 的支持 ---
155167
if((CMAKE_SYSTEM_NAME STREQUAL "Linux" OR APPLE) AND ELITE_INSTALL)
156168
include(GNUInstallDirs)
157169
install(TARGETS ${PROJECT_NAME}_SHARED ${PROJECT_NAME}_STATIC EXPORT ${PROJECT_NAME}Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

Changelog.cn.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
- 新增字符串列表构造函数。
99
- 新增判断是否连接的接口:`isConnected()`
1010
- 新增判断是否开始数据同步的接口`isStarted()`
11+
- 新增接口 `getActualTCPPose()``getActualTCPVelocity()``getActualTCPForce()`(修正原拼写错误)。
1112
- `DashboardClient`
1213
- 新增获取机器人类型接口:`robotType()`
1314
- 新增获取机器人序列号接口:`robotSerialNumber()`
1415
- 新增获取机器人ID接口:`robotID()`
16+
- 默认的日志句柄增加时间戳信息。
1517

1618
### Changed
1719
- 调整 `external_control.script` 中 “trajectory_socket” 的“timeout”值。
@@ -24,9 +26,14 @@
2426
- 修复收到30001不完整的报文后,出现的内存问题。
2527
- 修复`TcpServer`中静态资源析构顺序提前的问题。
2628
- 修复`EliteDriver::registerRobotExceptionCallback()`接口没有实现的问题。
29+
- 修复析构时会崩溃的问题。
2730

2831
### Deprecated
2932
- 弃用 `DashboardClient::robot()` 未来版本将移除,请改用 `DashboardClient::robotType()`
33+
- 由于拼写错误,以下接口已弃用,将在未来版本移除,请使用对应的新接口:
34+
- `RtsiIOInterface::getAcutalTCPPose()` -> `RtsiIOInterface::getActualTCPPose()`
35+
- `RtsiIOInterface::getAcutalTCPVelocity()` -> `RtsiIOInterface::getActualTCPVelocity()`
36+
- `RtsiIOInterface::getAcutalTCPForce()` -> `RtsiIOInterface::getActualTCPForce()`
3037

3138
## [v1.2.0] - 2025-08-14
3239

Changelog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
- Adds a string list constructor.
99
- Add an interface to determine if connected: `isConnected()`.
1010
- Add an interface to determine if data synchronization has started: `isStarted()`.
11+
- Added interfaces `getActualTCPPose()`, `getActualTCPVelocity()`, and `getActualTCPForce()` (corrected previous spelling errors).
1112
- `DashboardClient`
1213
- Added interface to get robot type: `robotType()`
1314
- Added interface to get robot serial number: `robotSerialNumber()`
1415
- Added interface to get robot ID: `robotID()`
16+
- Add timestamp information to the default log handler.
1517

1618
### Changed
1719
- Adjust the "timeout" value of "trajectory_socket" in `external_control.script`.
@@ -23,10 +25,15 @@
2325
- Fix the issue where the error level was incorrect when parsing the 30001 robot error exception message.
2426
- Fix the memory issue that occurs after receiving incomplete messages from 30001.
2527
- Fix the issue where static resources in `TcpServer` are destructed prematurely.
26-
- - Fixed the issue where the `EliteDriver::registerRobotExceptionCallback()` interface was not implemented.
28+
- Fixed the issue where the `EliteDriver::registerRobotExceptionCallback()` interface was not implemented.
29+
- Fix the crash issue during destruction.
2730

2831
### Deprecated
2932
- Deprecated `DashboardClient::robot()` it will be removed in future versions. Please use `DashboardClient::robotType()` instead.
33+
- Due to spelling errors, the following interfaces have been deprecated and will be removed in future versions. Please use the corresponding new interfaces:
34+
- `RtsiIOInterface::getAcutalTCPPose()` -> `RtsiIOInterface::getActualTCPPose()`
35+
- `RtsiIOInterface::getAcutalTCPVelocity()` -> `RtsiIOInterface::getActualTCPVelocity()`
36+
- `RtsiIOInterface::getAcutalTCPForce()` -> `RtsiIOInterface::getActualTCPForce()`
3037

3138
## [v1.2.0] - 2025-08-14
3239

doc/API/cn/RTSI.cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ vector6d_t getActualJointTemperatures()
557557

558558
### 获取实际TCP位姿
559559
```cpp
560-
vector6d_t getAcutalTCPPose()
560+
vector6d_t getActualTCPPose()
561561
```
562562
- ***功能***
563563

@@ -569,7 +569,7 @@ vector6d_t getAcutalTCPPose()
569569

570570
### 获取实际TCP速度
571571
```cpp
572-
vector6d_t getAcutalTCPVelocity()
572+
vector6d_t getActualTCPVelocity()
573573
```
574574
- ***功能***
575575

@@ -581,7 +581,7 @@ vector6d_t getAcutalTCPVelocity()
581581

582582
### 获取实际TCP力
583583
```cpp
584-
vector6d_t getAcutalTCPForce()
584+
vector6d_t getActualTCPForce()
585585
```
586586
- ***功能***
587587

doc/API/en/RTSI.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ Gets the actual joint temperatures.
457457

458458
### Get the Actual TCP Pose
459459
```cpp
460-
vector6d_t getAcutalTCPPose()
460+
vector6d_t getActualTCPPose()
461461
```
462462
- ***Function***
463463
Gets the actual Cartesian coordinates of the tool.
@@ -467,7 +467,7 @@ Gets the actual Cartesian coordinates of the tool.
467467

468468
### Get the Actual TCP Velocity
469469
```cpp
470-
vector6d_t getAcutalTCPVelocity()
470+
vector6d_t getActualTCPVelocity()
471471
```
472472
- ***Function***
473473
Gets the actual Cartesian velocity of the tool.
@@ -477,7 +477,7 @@ Gets the actual Cartesian velocity of the tool.
477477

478478
### Get the Actual TCP Force
479479
```cpp
480-
vector6d_t getAcutalTCPForce()
480+
vector6d_t getActualTCPForce()
481481
```
482482
- ***Function***
483483
Gets the generalized force of the TCP (subtracting the force data caused by the payload).

doc/UserGuide/cn/Get-Robot-State.cn.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,36 @@
88
## 背景说明
99
RTSI 是 Elite CS 系列机器人的一种通讯接口,最高可以250HZ的频率读取、写入机器人IO。SDK中提供了两种接口,第一种接口是RTSI的基础接口(RtsiClientInterface),可以操控RTSI通讯的每一个步骤。第二种接口将机器人的各种数据(RtsiIOInterface),例如关节角等,封装成了函数,可以直接调用。
1010

11-
RTSI 协议的具体说明可到官网下载RTSI说明文档。
11+
RTSI 协议的具体说明可到官网下载RTSI说明文档,下图简单展示了RTSI协议的流程。
12+
13+
```
14+
+------+
15+
| 连接 |
16+
+------+
17+
|
18+
|
19+
v
20+
+-------------+
21+
| 验证协议版本 |
22+
+-------------+
23+
|
24+
+---------+------------+
25+
| |
26+
| |
27+
+-------------------+ +------------------+
28+
| 配置输入、输出订阅 | | 获取控制器版本信息|
29+
+-------------------+ +------------------+
30+
|
31+
|
32+
+-------------+
33+
| 发送启动信号 |
34+
+-------------+
35+
|
36+
|
37+
+-------------+
38+
| 开始数据同步 |
39+
+-------------+
40+
```
1241

1342
## 任务
1443

doc/UserGuide/cn/Let-Robot-Move.cn.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TrajectoryControl {
7373
ELITE_LOG_INFO("Start releasing brake...");
7474
if (!dashboard_->brakeRelease()) {
7575
ELITE_LOG_FATAL("Brake release failed");
76-
return 1;
76+
return false;
7777
}
7878
ELITE_LOG_INFO("Brake released");
7979

@@ -109,10 +109,8 @@ class TrajectoryControl {
109109
return false;
110110
}
111111

112-
for (const auto& points : target_points) {
113-
ELITE_LOG_INFO("Moving joints to target: [%lf, %lf, %lf, %lf, %lf, %lf]", points[0], points[1], points[2], points[3], points[4], points[5]);
114-
115-
if (!driver_->writeTrajectoryPoint(points, point_time, blend_radius, is_cartesian)) {
112+
for (const auto& joints : target_points) {
113+
if (!driver_->writeTrajectoryPoint(joints, point_time, blend_radius, is_cartesian)) {
116114
ELITE_LOG_ERROR("Failed to write trajectory point");
117115
return false;
118116
}
@@ -134,20 +132,11 @@ class TrajectoryControl {
134132
auto result = move_done_future.get();
135133
ELITE_LOG_INFO("Trajectory motion completed with result: %d", result);
136134

137-
std::promise<TrajectoryMotionResult> cancel_done_promise;
138-
driver_->setTrajectoryResultCallback([&](TrajectoryMotionResult result) { cancel_done_promise.set_value(result); });
139-
140135
if(!driver_->writeIdle(0)) {
141136
ELITE_LOG_ERROR("Failed to write idle command");
142137
return false;
143138
}
144139

145-
auto cancel_done_future = cancel_done_promise.get_future();
146-
if (cancel_done_future.wait_for(std::chrono::seconds(10)) != std::future_status::ready) {
147-
ELITE_LOG_ERROR("Failed to wait for cancel done");
148-
return false;
149-
}
150-
151140
return result == TrajectoryMotionResult::SUCCESS;
152141
}
153142

@@ -460,7 +449,7 @@ int main(int argc, const char** argv) {
460449
ELITE_LOG_INFO("Joints moved to target");
461450
462451
463-
vector6d_t actual_pose = rtsi_client->getAcutalTCPPose();
452+
vector6d_t actual_pose = rtsi_client->getActualTCPPose();
464453
std::vector<vector6d_t> trajectory;
465454
466455
actual_pose[2] -= 0.2;
@@ -618,7 +607,7 @@ cp /your/path/external_control.script ./
618607

619608
3. 获取当前TCP位姿,规划一个三角形轨迹,并运行
620609
```cpp
621-
vector6d_t actual_pose = rtsi_client->getAcutalTCPPose();
610+
vector6d_t actual_pose = rtsi_client->getActualTCPPose();
622611
std::vector<vector6d_t> trajectory;
623612

624613
actual_pose[2] -= 0.2;

doc/UserGuide/cn/Servoj-Move.cn.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,28 @@ int main(int argc, char** argv) {
113113

114114
bool positive_rotation = false;
115115
bool negative_rotation = false;
116-
vector6d_t acutal_joint;
116+
vector6d_t actual_joint;
117117
vector6d_t target_joint;
118118
double increment = 0;
119119
bool first_point = true;
120120
auto next = steady_clock::now();
121121
while (!(positive_rotation && negative_rotation)) {
122-
acutal_joint = s_rtsi_client->getActualJointPositions();
122+
actual_joint = s_rtsi_client->getActualJointPositions();
123123
// If first point init target_joint
124124
if (first_point) {
125-
target_joint = acutal_joint;
125+
target_joint = actual_joint;
126126
first_point = false;
127127
}
128128

129129
// Set the increment of positive rotation and negative rotation
130130
if (positive_rotation == false) {
131131
increment = 0.0005;
132-
if (acutal_joint[5] >= 3) {
132+
if (actual_joint[5] >= 3) {
133133
positive_rotation = true;
134134
}
135135
} else if (negative_rotation == false) {
136136
increment = -0.0005;
137-
if (acutal_joint[5] <= -3) {
137+
if (actual_joint[5] <= -3) {
138138
negative_rotation = true;
139139
}
140140
}
@@ -228,31 +228,31 @@ while (!s_driver->isRobotConnected()) {
228228
```cpp
229229
bool positive_rotation = false;
230230
bool negative_rotation = false;
231-
vector6d_t acutal_joint;
231+
vector6d_t actual_joint;
232232
vector6d_t target_joint;
233233
double increment = 0;
234234
bool first_point = true;
235235
auto next = steady_clock::now();
236236

237237
while (!(positive_rotation && negative_rotation)) {
238-
acutal_joint = s_rtsi_client->getActualJointPositions();
238+
actual_joint = s_rtsi_client->getActualJointPositions();
239239

240240
if (first_point) {
241-
target_joint = acutal_joint; // 初始化目标位置
241+
target_joint = actual_joint; // 初始化目标位置
242242
first_point = false;
243243
}
244244

245245
// 正向旋转到关节 6 >= 3 rad
246246
if (!positive_rotation) {
247247
increment = 0.0005;
248-
if (acutal_joint[5] >= 3) {
248+
if (actual_joint[5] >= 3) {
249249
positive_rotation = true;
250250
}
251251
}
252252
// 反向旋转到关节 6 <= -3 rad
253253
else if (!negative_rotation) {
254254
increment = -0.0005;
255-
if (acutal_joint[5] <= -3) {
255+
if (actual_joint[5] <= -3) {
256256
negative_rotation = true;
257257
}
258258
}

doc/UserGuide/en/Get-Robot-State.en.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,36 @@ Call the relevant interfaces of the SDK to obtain the robot's joint angles and s
88
## Background
99
RTSI is a communication interface for Elite CS series robots, which can read and write robot I/O at a maximum frequency of 250Hz. The SDK provides two types of interfaces. The first is the basic RTSI interface (RtsiClientInterface), which can control every step of RTSI communication. The second interface encapsulates various robot data (RtsiIOInterface), such as joint angles, into functions that can be called directly.
1010

11-
The specific description of the RTSI protocol can be found in the RTSI documentation downloaded from the official website.
11+
The specific description of the RTSI protocol can be found in the RTSI documentation downloaded from the official website. The following diagram briefly illustrates the workflow of the RTSI protocol.
12+
13+
```
14+
+------+
15+
| 连接 |
16+
+------+
17+
|
18+
|
19+
v
20+
+-------------+
21+
| 验证协议版本 |
22+
+-------------+
23+
|
24+
+---------+------------+
25+
| |
26+
| |
27+
+-------------------+ +------------------+
28+
| 配置输入、输出订阅 | | 获取控制器版本信息|
29+
+-------------------+ +------------------+
30+
|
31+
|
32+
+-------------+
33+
| 发送启动信号 |
34+
+-------------+
35+
|
36+
|
37+
+-------------+
38+
| 开始数据同步 |
39+
+-------------+
40+
```
1241

1342
## Tasks
1443

0 commit comments

Comments
 (0)