Skip to content

Commit 95fad2c

Browse files
committed
[UPDATE]0.3.0正式版本
1 parent f59c875 commit 95fad2c

Some content is hidden

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

59 files changed

+1814
-1597
lines changed

CHANGELOG(ZH).MD

Lines changed: 458 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.MD

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1+
# CHANGELOG(EN)
2+
3+
[Click to switch ZH](CHANGELOG(ZH).MD)
4+
=============
15

26
Version 0.3.0
37
=============
48

59
Features
610
--------
711

8-
- Added the teaching pendant friction coefficient parameter to the gripper/teaching pendant parameter feedback command (both feedback and sending) and adapted the protocol(1.5-8 frimware).
9-
- Added `ModeCtrl` and `EmergencyStop` functions to set modes and perform emergency stops (future updates will introduce dictionary-based parameter matching for all functions).
10-
- Renamed all data reading files in the demo to start with "read" for easier searching.
11-
- Initialized `rx_message` as an empty `Message()` in the `C_STD_CAN` encapsulation class
12-
- Added `piper_param_manager` file, which includes angle and gripper range limits, applying constraints to both feedback and control messages.
13-
- If feedback or control messages exceed the set limits, the values will be clamped to the boundary values.
14-
- To configure limit ranges, use the `SetSDKJointLimitParam` and `SetSDKGripperRangeParam` functions to set software constraints.
15-
Refer to the `piper_sdk_param.py` file in the demo for examples.
16-
- Slightly reduced joint limits to prevent exceeding the robotic arm's angle limits when converting radians to degrees using math.degrees. The new limits are:
12+
- Added interface parameters `start_sdk_joint_limit`, `start_sdk_gripper_limit`, the default parameter is `False`
13+
- Added `utils` path, which contains tools for fps calculation and quaternion Euler angle calculation (external rotation sxyz)
14+
- Convert quaternion to Euler angle through `quat_convert_euler`
15+
- Convert Euler angle to quaternion through `euler_convert_quat`
16+
- Added functions `EnableFkCal` and `DisableFkCal` to enable/disable sdk calculation fk. `isCalFk` is used to get whether to enable fk calculation, and then read it through `GetFK` function. After enabling fk calculation, the reading thread will occupy a high CPU, please enable it as needed
17+
- Added function `get_connect_status` to get the call status of `ConnectPort` function
18+
- Reduced the frequency (20hz) of `CanMonitor` thread enabled in the interface and the length of the queue for storing frame rate values ​​(5)
19+
- Added the friction coefficient parameter of the teach pendant in the gripper/teach pendant parameter feedback command (feedback and send)
20+
- Added `ModeCtrl` and `EmergencyStop` functions to set the mode and perform emergency stop (replace `MotionCtrl_1` and `MotionCtrl_2`)
21+
- Will get CAN_ID=0x151 - Renamed the function of the arm mode control command from `GetArmCtrlCode151` to `GetArmModeCtrl`
22+
- Added enum in the robot status feedback. When you use the `piper_read_status.py` in the demo to print the current status of the robot, you can see an explicit formatted string representing the current status of the robot (the actual variable value is still int)
23+
- Renamed the demo file to be standardized
24+
- Initialized `rx_message` to `Message()` type in the `C_STD_CAN` class
25+
- Modified the location of obtaining the timestamp of the feedback information, from obtaining the current system time from the interface to obtaining the timestamp in the decoding function to increase the accuracy of the data timestamp
26+
- Added the `piper_param_manager` file, which contains the angle and gripper range limits and applies constraints to feedback and control messages
27+
- Use the parameters in the interface to turn on the sdk limit function: `piper = C_PiperInterface_V2("can0", start_sdk_joint_limit=True, start_sdk_gripper_limit=True)`
28+
- If the feedback or control message exceeds the set limit, the value will be clamped within the boundary value
29+
- Default limits already exist in the program. To customize the configuration limit range, use the `SetSDKJointLimitParam` and `SetSDKGripperRangeParam` functions to set software constraints
30+
31+
See the `piper_set_sdk_param.py` file in the demo for examples.
32+
- Slightly reduced the joint limits to prevent exceeding the angle limit of the robot when converting radians to degrees using math.degrees. The new limits are as follows:
1733

1834
| joint_name | limit(rad) | limit(angle) | limit(rad/s) |
1935
|------------|----------------------|--------------------|--------------------|
@@ -25,23 +41,22 @@ Features
2541
| joint6 | [-2.09439, 2.09439]| [-120.0, 120.0] | [0, 3.0] |
2642

2743
Note: The conversion factor from radians to degrees is 57.2957795 (180/3.1415926).
28-
29-
- Renamed the method for retrieving arm mode control command with ID=151 from `GetArmCtrlCode151` to `GetArmModeCtrl`.
30-
- Added `piper_set_load.py` demo for setting load conditions (no load/full load).
44+
45+
- Added `piper_set_load.py` demo for setting load conditions (empty/half/full)
46+
- Added `detect_arm.py` in the demo path to monitor various information of the robot arm in the terminal. Note that this file is not backward compatible
3147

3248
Bug Fixes
3349
---------
3450

35-
- Fixed the issue where the gripper feedback timestamp was of type `int`. Now, a unified timestamp retrieval function is used.
51+
- Fixed the issue where the gripper feedback timestamp was of type `int`.
3652

3753
Miscellaneous
3854
---------
3955

40-
- Currently, messages in the range 0x481~0x486 have not been adapted for feedback. These messages provide feedback on the current end velocity/acceleration of each joint.
41-
- CPV mode has not been adapted.
42-
- Refactored the documentation structure:
43-
- Most documents have been rewritten in English.
44-
- Simplified the documentation, focusing only on interface usage.
56+
- Modified the folder structure, put `fps.py` into the `utils` path, the `monitor` path will be deleted after the next version
57+
- Restructured the documentation:
58+
- Most of the documentation has been rewritten in English
59+
- Simplified the documentation to focus only on interface usage
4560

4661
Version 0.2.19
4762
=============
@@ -107,7 +122,7 @@ Features
107122
- Modified the comments in the `SearchAllMotorMaxAngleSpd` and `SearchAllMotorMaxAccLimit` functions to include CAN ID descriptions.
108123
- Added a demo file to set and print the robotic arm's collision level `piper_read_crash_protectation.py`.
109124
- Modified the `arm_high_spd_feedback` to set the `motor_speed` unit to 0.001 rad/s and the `current` unit to 0.001 A.
110-
- Modified the shell script. Since the `sh` command does not support `==` for equality comparison, but `bash` does, changed it to use `=` for equality comparison. This allows the script to be used in `zsh`.
125+
- Modified the shell script. Since the `sh` command does not support `==` for equality comparison, but `bash` does, it is changed to use `=` for equality comparison so that it can be used by `zsh`
111126

112127
Bug Fixes
113128
---------
@@ -424,16 +439,16 @@ Version 0.0.12
424439
Features
425440
--------
426441

427-
- Modified the CAN bus class to make the data reading section compatible with Ubuntu 18.04 and Python 3.6.
428-
- Updated the protocol_base to simplify the function that converts values to a list by using struct and ctypes.
429-
- Added singleton pattern support in the interface class.
430-
- Added thread protection to the `ConnectPort` function in the interface class.
431-
- Added a `DisconnectPort` function to the interface class to stop the data reading process.
432-
- Changed the `Update` function and some variables in the interface class to private.
433-
- Fixed erroneous comments to make them more readable.
434-
- Optimized the document structure and descriptions.
435-
- Added an interface to query the robotic arm's firmware.
436-
- Added all demos (e.g., moveC).
442+
- Modified the CAN bus class to make its data reading part compatible with Python 3.6 in Ubuntu 18.04
443+
- Updated protocol_base to simplify the function of converting values ​​to lists using struct and ctypes
444+
- Added singleton mode support in the interface class
445+
- Added thread protection to the `ConnectPort` function in the interface class
446+
- Added a `DisconnectPort` function to the interface class to stop the data reading process
447+
- Changed the `Update` function and some variables in the interface class to private variables
448+
- Fixed incorrect comments to make it more readable
449+
- Optimized the document structure and description
450+
- Added the interface `SearchPiperFirmwareVersion` for querying the robot firmware, and the acquisition function is `GetPiperFirmwareVersion`
451+
- Added many demos (such as moveC)
437452

438453
Bug Fixes
439454
---------

README(ZH).MD

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,20 +263,20 @@ from piper_sdk import *
263263

264264
if __name__ == "__main__":
265265
# 实例化interface,形参的默认参数如下
266-
# can_name(str): can port name
267-
# judge_flag(bool): 创建该实例时是否开启判断can模块,若使用的是非官方模块,请将其设置False
266+
# can_name(str -> default 'can0'): can port name
267+
# judge_flag(bool -> default True): 创建该实例时是否开启判断can模块,若使用的是非官方模块,请将其设置False
268268
# can_auto_init(bool): 创建该实例时是否自动进行初始化来打开can bus,如果设置为False,请在ConnectPort参数中将can_init形参设置为True
269-
# dh_is_offset([0,1] -> default 0x01): 使用的dh参数是新版dh还是旧版dh,S-V1.6-3以前的为旧版,S-V1.6-3固件及以后的为新版
269+
# dh_is_offset([0,1] -> default 0x01): 使用的dh参数是新版dh还是旧版dh,S-V1.6-3以前的为旧版,S-V1.6-3固件及以后的为新版,对应fk的计算
270270
# 0 -> old
271271
# 1 -> new
272-
# start_sdk_joint_limit(bool -> False):是否开启SDK的关节角度限位,会对反馈消息和控制消息都做限制
273-
# start_sdk_gripper_limit(bool -> False):是否开启SDK的夹爪位置限位,会对反馈消息和控制消息都做限制
274-
piper = C_PiperInterface_V1(can_name="can0",
275-
judge_flag=False,
276-
can_auto_init=True,
277-
dh_is_offset=1,
278-
start_sdk_joint_limit=False,
279-
start_sdk_gripper_limit=False)
272+
# start_sdk_joint_limit(bool -> default False):是否开启SDK的关节角度限位,会对反馈消息和控制消息都做限制
273+
# start_sdk_gripper_limit(bool -> default False):是否开启SDK的夹爪位置限位,会对反馈消息和控制消息都做限制
274+
piper = C_PiperInterface(can_name="can0",
275+
judge_flag=False,
276+
can_auto_init=True,
277+
dh_is_offset=1,
278+
start_sdk_joint_limit=False,
279+
start_sdk_gripper_limit=False)
280280
# 开启can收发线程
281281
piper.ConnectPort()
282282
# 循环打印消息,注意所有的消息第一帧都是默认数值,比如关节角消息第一帧的消息内容默认为0

asserts/V1/INTERFACE_V1.MD

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ Inner class identifies instances based on `can_port`, preventing the creation of
2121

2222
### Connection Methods
2323

24+
#### get_connect_status
25+
26+
```python
27+
def get_connect_status(self)
28+
```
29+
30+
Get connection status
31+
32+
Used to feedback whether the ConnectPort function has been called, You need to call ConnectPort again for the function feedback to become `True`
33+
34+
`False` if DisconnectPort was called
35+
2436
#### ConnectPort
2537

2638
```python
@@ -327,6 +339,8 @@ Manual unit conversion of data is required.
327339
def GetFK(mode: Literal["feedback", "control"] = "feedback")
328340
```
329341

342+
**Note: Normal data will be obtained only after the `EnableFkCal` function is called, otherwise all data will be 0**
343+
330344
Returns the forward kinematics solution for each joint of the robotic arm.
331345

332346
Parameters:
@@ -532,6 +546,30 @@ Returns whether the CAN data reading thread is functioning normally.
532546

533547
### Configuration Methods
534548

549+
#### EnableFkCal
550+
551+
```python
552+
def EnableFkCal(self)
553+
```
554+
555+
Enable forward kinematics calculations in SDK internal threads
556+
557+
#### DisableFkCal
558+
559+
```python
560+
def DisableFkCal(self)
561+
```
562+
563+
Disable forward kinematics calculations in SDK internal threads
564+
565+
#### isCalFk
566+
567+
```python
568+
def isCalFk(self)
569+
```
570+
571+
Whether the forward kinematics calculation is turned on, feedback `True` or `False`
572+
535573
#### MasterSlaveConfig
536574

537575
```python

asserts/V2/INTERFACE_V2.MD

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ Inner class identifies instances based on `can_port`, preventing the creation of
2121

2222
### Connection Methods
2323

24+
#### get_connect_status
25+
26+
```python
27+
def get_connect_status(self)
28+
```
29+
30+
Get connection status
31+
32+
Used to feedback whether the ConnectPort function has been called, You need to call ConnectPort again for the function feedback to become `True`
33+
34+
`False` if DisconnectPort was called
35+
2436
#### ConnectPort
2537

2638
```python
@@ -327,6 +339,8 @@ Manual unit conversion of data is required.
327339
def GetFK(mode: Literal["feedback", "control"] = "feedback")
328340
```
329341

342+
**Note: Normal data will be obtained only after the `EnableFkCal` function is called, otherwise all data will be 0**
343+
330344
Returns the forward kinematics solution for each joint of the robotic arm.
331345

332346
Parameters:
@@ -532,6 +546,30 @@ Returns whether the CAN data reading thread is functioning normally.
532546

533547
### Configuration Methods
534548

549+
#### EnableFkCal
550+
551+
```python
552+
def EnableFkCal(self)
553+
```
554+
555+
Enable forward kinematics calculations in SDK internal threads
556+
557+
#### DisableFkCal
558+
559+
```python
560+
def DisableFkCal(self)
561+
```
562+
563+
Disable forward kinematics calculations in SDK internal threads
564+
565+
#### isCalFk
566+
567+
```python
568+
def isCalFk(self)
569+
```
570+
571+
Whether the forward kinematics calculation is turned on, feedback `True` or `False`
572+
535573
#### MasterSlaveConfig
536574

537575
```python

piper_sdk/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11

22
from .hardware_port.can_encapsulation import C_STD_CAN
3-
from .api import *
4-
from .monitor.fps import C_FPSCounter
3+
from .utils.fps import C_FPSCounter
4+
from .utils.tf import (
5+
quat_convert_euler,
6+
euler_convert_quat,
7+
)
58
from .protocol.piper_protocol_base import C_PiperParserBase
69
from .piper_msgs.msg_v1 import *
710
from .protocol.protocol_v1 import *
@@ -12,10 +15,8 @@
1215
from .interface.piper_interface_v1 import C_PiperInterface_V1
1316
from .interface.piper_interface_v2 import C_PiperInterface_V2
1417
from .version import PiperSDKVersion
15-
from .param_map import PiperParamMap
1618

1719
__all__ = [
18-
'PiperRobot',
1920
'C_PiperParserBase',
2021
'C_FPSCounter',
2122
'C_PiperForwardKinematics',
@@ -24,5 +25,6 @@
2425
'C_PiperInterface_V1',
2526
'C_PiperInterface_V2',
2627
'PiperSDKVersion',
27-
'PiperParamMap'
28+
'quat_convert_euler',
29+
'euler_convert_quat',
2830
]

piper_sdk/api/__init__.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

piper_sdk/api/base.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)