Skip to content

Commit 4eddfcf

Browse files
committed
[FEAT]增加机械臂限位参数设定demo,修改CHANGELOG
1 parent fa9aa66 commit 4eddfcf

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

CHANGELOG.MD

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Features
88
- Added the teaching pendant friction coefficient parameter to the gripper/teaching pendant parameter feedback command (both feedback and sending) and adapted the protocol.
99
- Added `ModeCtrl` and `EmergencyStop` functions to set modes and perform emergency stops (future updates will introduce dictionary-based parameter matching for all functions).
1010
- 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.
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.
1216

1317
Bug Fixes
1418
---------

demo/V1/piper_sdk_param.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
# -*-coding:utf8-*-
3+
# 注意demo无法直接运行,需要pip安装sdk后才能运行
4+
from typing import (
5+
Optional,
6+
)
7+
import time
8+
from piper_sdk import *
9+
10+
if __name__ == "__main__":
11+
piper = C_PiperInterface("can0")
12+
piper.ConnectPort()
13+
print(piper.GetSDKJointLimitParam('j6'))
14+
print(piper.GetSDKGripperRangeParam())
15+
piper.SetSDKGripperRangeParam(0, 0.05)
16+
piper.SetSDKJointLimitParam('j6',-2.09, 2.09)
17+
print(piper.GetSDKJointLimitParam('j6'))
18+
print(piper.GetSDKGripperRangeParam())

demo/V2/piper_sdk_param.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
# -*-coding:utf8-*-
3+
# 注意demo无法直接运行,需要pip安装sdk后才能运行
4+
from typing import (
5+
Optional,
6+
)
7+
import time
8+
from piper_sdk import *
9+
10+
if __name__ == "__main__":
11+
piper = C_PiperInterface_V2("can0")
12+
piper.ConnectPort()
13+
print(piper.GetSDKJointLimitParam('j6'))
14+
print(piper.GetSDKGripperRangeParam())
15+
piper.SetSDKGripperRangeParam(0, 0.05)
16+
piper.SetSDKJointLimitParam('j6',-2.09, 2.09)
17+
print(piper.GetSDKJointLimitParam('j6'))
18+
print(piper.GetSDKGripperRangeParam())

0 commit comments

Comments
 (0)