carm 0.1.20251010__tar.gz → 0.1.20251017__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- carm-0.1.20251017/PKG-INFO +47 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/README.md +4 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm/carm.py +23 -18
- {carm-0.1.20251010 → carm-0.1.20251017}/carm/carm_dds.py +3 -3
- carm-0.1.20251017/carm.egg-info/PKG-INFO +47 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/pyproject.toml +2 -1
- carm-0.1.20251010/PKG-INFO +0 -10
- carm-0.1.20251010/carm.egg-info/PKG-INFO +0 -10
- {carm-0.1.20251010 → carm-0.1.20251017}/carm/__init__.py +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm/carm_ros2.py +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm.egg-info/SOURCES.txt +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm.egg-info/dependency_links.txt +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm.egg-info/entry_points.txt +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm.egg-info/requires.txt +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/carm.egg-info/top_level.txt +0 -0
- {carm-0.1.20251010 → carm-0.1.20251017}/setup.cfg +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: carm
|
|
3
|
+
Version: 0.1.20251017
|
|
4
|
+
Summary: Python interface for cvte arm.
|
|
5
|
+
Author-email: Yong Zhao <zhaoyong11933@cvte.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
8
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: websocket-client
|
|
12
|
+
|
|
13
|
+
# pycarm
|
|
14
|
+
|
|
15
|
+
Python interface for cvte arm.
|
|
16
|
+
|
|
17
|
+
# Install
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install carm
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
# Usage
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
import carm
|
|
27
|
+
|
|
28
|
+
arm = carm.Carm("ws://localhost:8090")
|
|
29
|
+
|
|
30
|
+
print("version:",carm.version)
|
|
31
|
+
print("limits:", carm.limit)
|
|
32
|
+
print("state:", carm.state)
|
|
33
|
+
|
|
34
|
+
carm.track_joint(carm.joint_pos)
|
|
35
|
+
|
|
36
|
+
carm.move_joint(carm.joint_pos)
|
|
37
|
+
|
|
38
|
+
carm.track_pose(carm.cart_pose)
|
|
39
|
+
|
|
40
|
+
carm.move_pose(carm.cart_pose)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
# Version update to pypy
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
python3 -m build
|
|
47
|
+
```
|
|
@@ -21,7 +21,7 @@ class Carm:
|
|
|
21
21
|
"onCarmError": lambda msg: print("Error:", msg)
|
|
22
22
|
}
|
|
23
23
|
self.res_pool = {}
|
|
24
|
-
self.
|
|
24
|
+
self.task_event = threading.Event()
|
|
25
25
|
|
|
26
26
|
self.reader = threading.Thread(target=self.__recv_loop, daemon=True).start()
|
|
27
27
|
self.open_ready = threading.Event()
|
|
@@ -279,7 +279,7 @@ class Carm:
|
|
|
279
279
|
joints[i] = self.__clip(v, lower[i], upper[i])
|
|
280
280
|
return joints
|
|
281
281
|
|
|
282
|
-
def track_joint(self, pos, end_effector =
|
|
282
|
+
def track_joint(self, pos, end_effector = None):
|
|
283
283
|
"""
|
|
284
284
|
关节轨迹跟踪.
|
|
285
285
|
Args:
|
|
@@ -295,12 +295,14 @@ class Carm:
|
|
|
295
295
|
"point_type":{"space":0},
|
|
296
296
|
"data":{"way_point": pos}}
|
|
297
297
|
|
|
298
|
-
if end_effector
|
|
299
|
-
req["data"]["
|
|
298
|
+
if not end_effector is None:
|
|
299
|
+
#req["data"]["grp_point"] = end_effector
|
|
300
|
+
tau = (0.1 - end_effector) * 20
|
|
301
|
+
self.set_end_effector(end_effector, tau)
|
|
300
302
|
|
|
301
303
|
return self.request(req)
|
|
302
304
|
|
|
303
|
-
def track_pose(self, pos, end_effector =
|
|
305
|
+
def track_pose(self, pos, end_effector =None):
|
|
304
306
|
"""
|
|
305
307
|
笛卡尔轨迹跟踪.
|
|
306
308
|
Args:
|
|
@@ -315,9 +317,11 @@ class Carm:
|
|
|
315
317
|
"point_type":{"space":1},
|
|
316
318
|
"data":{"way_point": pos}}
|
|
317
319
|
|
|
318
|
-
if end_effector
|
|
319
|
-
req["data"]["
|
|
320
|
-
|
|
320
|
+
if not end_effector is None:
|
|
321
|
+
#req["data"]["grp_point"] = end_effector
|
|
322
|
+
tau = (0.1 - end_effector) * 20
|
|
323
|
+
self.set_end_effector(end_effector, tau)
|
|
324
|
+
|
|
321
325
|
return self.request(req)
|
|
322
326
|
|
|
323
327
|
def move_joint(self, pos, tm=-1, sync=True, user=0, tool=0):
|
|
@@ -402,10 +406,8 @@ class Carm:
|
|
|
402
406
|
return res
|
|
403
407
|
|
|
404
408
|
def __wait_task(self, task_key):
|
|
405
|
-
|
|
406
|
-
self.
|
|
407
|
-
event.wait()
|
|
408
|
-
self.task_pool.pop(task_key)
|
|
409
|
+
self.task_event= threading.Event()
|
|
410
|
+
self.task_event.wait()
|
|
409
411
|
|
|
410
412
|
def move_joint_traj(self, target_traj, gripper_pos = [], stamps = [], is_sync=True):
|
|
411
413
|
if len(stamps) != len(target_traj): # as soon as possible
|
|
@@ -478,22 +480,25 @@ class Carm:
|
|
|
478
480
|
self.ws.send(json.dumps(msg))
|
|
479
481
|
|
|
480
482
|
def __cbk_status(self, message):
|
|
481
|
-
self.state = message
|
|
482
|
-
|
|
483
483
|
if not "arm" in message:
|
|
484
484
|
return
|
|
485
|
+
|
|
486
|
+
self.state = message
|
|
487
|
+
|
|
488
|
+
if message["errMsg"] != "":
|
|
489
|
+
print(message["errMsg"] )
|
|
485
490
|
|
|
486
491
|
arm_json = message["arm"][0]
|
|
487
|
-
if "
|
|
492
|
+
if "task" not in arm_json:
|
|
488
493
|
return
|
|
494
|
+
running = arm_json["task"]["exe_flag"]
|
|
489
495
|
|
|
490
|
-
|
|
491
|
-
|
|
496
|
+
if not running:
|
|
497
|
+
self.task_event.set()
|
|
492
498
|
|
|
493
499
|
|
|
494
500
|
def __cbk_taskfinish(self, message):
|
|
495
501
|
task = message["task_key"]
|
|
496
|
-
self.task_pool[task]["event"].set()
|
|
497
502
|
|
|
498
503
|
def __on_open(self, ws):
|
|
499
504
|
self.open_ready.set()
|
|
@@ -29,7 +29,7 @@ class ArmDriver:
|
|
|
29
29
|
if type(position) != tuple:
|
|
30
30
|
position = np.frombuffer(msg["position"],dtype=np.float64).tolist()
|
|
31
31
|
|
|
32
|
-
if position > 7:
|
|
32
|
+
if len(position) > 7:
|
|
33
33
|
self.arm.track_pose(position[:7], position[7])
|
|
34
34
|
else:
|
|
35
35
|
self.arm.track_pose(position)
|
|
@@ -49,7 +49,7 @@ class ArmDriver:
|
|
|
49
49
|
if type(position) != tuple:
|
|
50
50
|
position = np.frombuffer(msg["position"],dtype=np.float64).tolist()
|
|
51
51
|
|
|
52
|
-
if position > 6:
|
|
52
|
+
if len(position) > 6:
|
|
53
53
|
self.arm.track_joint(position[:6], position[6])
|
|
54
54
|
else:
|
|
55
55
|
self.arm.track_joint(position)
|
|
@@ -139,4 +139,4 @@ def main():
|
|
|
139
139
|
if __name__ == "__main__":
|
|
140
140
|
main()
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: carm
|
|
3
|
+
Version: 0.1.20251017
|
|
4
|
+
Summary: Python interface for cvte arm.
|
|
5
|
+
Author-email: Yong Zhao <zhaoyong11933@cvte.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
8
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: websocket-client
|
|
12
|
+
|
|
13
|
+
# pycarm
|
|
14
|
+
|
|
15
|
+
Python interface for cvte arm.
|
|
16
|
+
|
|
17
|
+
# Install
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install carm
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
# Usage
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
import carm
|
|
27
|
+
|
|
28
|
+
arm = carm.Carm("ws://localhost:8090")
|
|
29
|
+
|
|
30
|
+
print("version:",carm.version)
|
|
31
|
+
print("limits:", carm.limit)
|
|
32
|
+
print("state:", carm.state)
|
|
33
|
+
|
|
34
|
+
carm.track_joint(carm.joint_pos)
|
|
35
|
+
|
|
36
|
+
carm.move_joint(carm.joint_pos)
|
|
37
|
+
|
|
38
|
+
carm.track_pose(carm.cart_pose)
|
|
39
|
+
|
|
40
|
+
carm.move_pose(carm.cart_pose)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
# Version update to pypy
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
python3 -m build
|
|
47
|
+
```
|
|
@@ -4,11 +4,12 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "carm"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.20251017"
|
|
8
8
|
authors = [
|
|
9
9
|
{name = "Yong Zhao", email = "zhaoyong11933@cvte.com"},
|
|
10
10
|
]
|
|
11
11
|
description = "Python interface for cvte arm."
|
|
12
|
+
readme = "README.md"
|
|
12
13
|
requires-python = ">=3.6"
|
|
13
14
|
dependencies = ["websocket-client"]
|
|
14
15
|
classifiers = [
|
carm-0.1.20251010/PKG-INFO
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: carm
|
|
3
|
-
Version: 0.1.20251010
|
|
4
|
-
Summary: Python interface for cvte arm.
|
|
5
|
-
Author-email: Yong Zhao <zhaoyong11933@cvte.com>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
8
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
9
|
-
Requires-Python: >=3.6
|
|
10
|
-
Requires-Dist: websocket-client
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: carm
|
|
3
|
-
Version: 0.1.20251010
|
|
4
|
-
Summary: Python interface for cvte arm.
|
|
5
|
-
Author-email: Yong Zhao <zhaoyong11933@cvte.com>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
8
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
9
|
-
Requires-Python: >=3.6
|
|
10
|
-
Requires-Dist: websocket-client
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|