motor-python 0.0.3__tar.gz → 0.0.6__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.
- {motor_python-0.0.3 → motor_python-0.0.6}/PKG-INFO +24 -6
- {motor_python-0.0.3 → motor_python-0.0.6}/README.md +21 -4
- {motor_python-0.0.3 → motor_python-0.0.6}/pyproject.toml +9 -5
- {motor_python-0.0.3 → motor_python-0.0.6}/src/motor_python/__init__.py +1 -1
- motor_python-0.0.6/src/motor_python/__main__.py +87 -0
- motor_python-0.0.6/src/motor_python/cube_mars_motor.py +469 -0
- motor_python-0.0.6/src/motor_python/definitions.py +478 -0
- motor_python-0.0.6/src/motor_python/examples.py +103 -0
- motor_python-0.0.6/src/motor_python/motor_status_parser.py +361 -0
- motor_python-0.0.3/src/motor_python/__main__.py +0 -44
- motor_python-0.0.3/src/motor_python/cube_mars_motor.py +0 -8
- motor_python-0.0.3/src/motor_python/definitions.py +0 -43
- {motor_python-0.0.3 → motor_python-0.0.6}/.gitignore +0 -0
- {motor_python-0.0.3 → motor_python-0.0.6}/LICENSE +0 -0
- {motor_python-0.0.3 → motor_python-0.0.6}/src/motor_python/utils.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: motor_python
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: CubeMars motor module for Aries exosuits.
|
|
5
5
|
Project-URL: homepage, https://github.com/TUM-Aries-Lab/motor-module
|
|
6
6
|
Author-email: Tsmorz <tony.smoragiewicz@tum.de>, Hannes <hannes.nguyen@tum.de>
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Python: <3.14,>=3.11
|
|
9
9
|
Requires-Dist: loguru>=0.7.3
|
|
10
10
|
Requires-Dist: numpy>=2.2.3
|
|
11
|
+
Requires-Dist: pyserial>=3.5
|
|
11
12
|
Description-Content-Type: text/markdown
|
|
12
13
|
|
|
13
14
|
# Motor Control Software for Soft Exoskeleton
|
|
@@ -43,11 +44,13 @@ The package can then be found at: https://pypi.org/project/motor_python
|
|
|
43
44
|
|
|
44
45
|
from loguru import logger
|
|
45
46
|
|
|
46
|
-
from motor_python import
|
|
47
|
+
from motor_python.cube_mars_motor import CubeMarsAK606v3
|
|
47
48
|
|
|
48
49
|
def main() -> None:
|
|
49
50
|
"""Run a simple demonstration."""
|
|
50
|
-
|
|
51
|
+
motor = CubeMarsAK606v3()
|
|
52
|
+
motor.get_status()
|
|
53
|
+
motor.set_position(position_degrees=0.0)
|
|
51
54
|
|
|
52
55
|
if __name__ == "__main__":
|
|
53
56
|
main()
|
|
@@ -61,17 +64,32 @@ uv run python -m motor_python
|
|
|
61
64
|
## Structure
|
|
62
65
|
<!-- TREE-START -->
|
|
63
66
|
```
|
|
67
|
+
├── Test Rig CAD files
|
|
68
|
+
│ ├── Foot.3mf
|
|
69
|
+
│ ├── Jetson_Mount.3mf
|
|
70
|
+
│ ├── Leg_with_2_IMU's.3mf
|
|
71
|
+
│ ├── Motor_Case.3mf
|
|
72
|
+
│ ├── Rod_Adapter_Jetson.3mf
|
|
73
|
+
│ ├── Rod_Adapter_Motor.3mf
|
|
74
|
+
│ └── Spool_V2.3mf
|
|
75
|
+
├── docs
|
|
76
|
+
│ ├── AK60-6 Manual.pdf
|
|
77
|
+
│ └── Jetson-Orin-Nano-DevKit.pdf
|
|
64
78
|
├── src
|
|
65
79
|
│ └── motor_python
|
|
80
|
+
│ ├── config
|
|
66
81
|
│ ├── __init__.py
|
|
67
82
|
│ ├── __main__.py
|
|
68
83
|
│ ├── cube_mars_motor.py
|
|
69
|
-
│ ├──
|
|
84
|
+
│ ├── definitions.py
|
|
85
|
+
│ ├── examples.py
|
|
86
|
+
│ ├── motor_status_parser.py
|
|
70
87
|
│ └── utils.py
|
|
71
88
|
├── tests
|
|
72
89
|
│ ├── __init__.py
|
|
73
90
|
│ ├── conftest.py
|
|
74
|
-
│ ├──
|
|
91
|
+
│ ├── cube_mars_motor_test.py
|
|
92
|
+
│ ├── motor_status_parser_test.py
|
|
75
93
|
│ └── utils_test.py
|
|
76
94
|
├── .dockerignore
|
|
77
95
|
├── .gitignore
|
|
@@ -31,11 +31,13 @@ The package can then be found at: https://pypi.org/project/motor_python
|
|
|
31
31
|
|
|
32
32
|
from loguru import logger
|
|
33
33
|
|
|
34
|
-
from motor_python import
|
|
34
|
+
from motor_python.cube_mars_motor import CubeMarsAK606v3
|
|
35
35
|
|
|
36
36
|
def main() -> None:
|
|
37
37
|
"""Run a simple demonstration."""
|
|
38
|
-
|
|
38
|
+
motor = CubeMarsAK606v3()
|
|
39
|
+
motor.get_status()
|
|
40
|
+
motor.set_position(position_degrees=0.0)
|
|
39
41
|
|
|
40
42
|
if __name__ == "__main__":
|
|
41
43
|
main()
|
|
@@ -49,17 +51,32 @@ uv run python -m motor_python
|
|
|
49
51
|
## Structure
|
|
50
52
|
<!-- TREE-START -->
|
|
51
53
|
```
|
|
54
|
+
├── Test Rig CAD files
|
|
55
|
+
│ ├── Foot.3mf
|
|
56
|
+
│ ├── Jetson_Mount.3mf
|
|
57
|
+
│ ├── Leg_with_2_IMU's.3mf
|
|
58
|
+
│ ├── Motor_Case.3mf
|
|
59
|
+
│ ├── Rod_Adapter_Jetson.3mf
|
|
60
|
+
│ ├── Rod_Adapter_Motor.3mf
|
|
61
|
+
│ └── Spool_V2.3mf
|
|
62
|
+
├── docs
|
|
63
|
+
│ ├── AK60-6 Manual.pdf
|
|
64
|
+
│ └── Jetson-Orin-Nano-DevKit.pdf
|
|
52
65
|
├── src
|
|
53
66
|
│ └── motor_python
|
|
67
|
+
│ ├── config
|
|
54
68
|
│ ├── __init__.py
|
|
55
69
|
│ ├── __main__.py
|
|
56
70
|
│ ├── cube_mars_motor.py
|
|
57
|
-
│ ├──
|
|
71
|
+
│ ├── definitions.py
|
|
72
|
+
│ ├── examples.py
|
|
73
|
+
│ ├── motor_status_parser.py
|
|
58
74
|
│ └── utils.py
|
|
59
75
|
├── tests
|
|
60
76
|
│ ├── __init__.py
|
|
61
77
|
│ ├── conftest.py
|
|
62
|
-
│ ├──
|
|
78
|
+
│ ├── cube_mars_motor_test.py
|
|
79
|
+
│ ├── motor_status_parser_test.py
|
|
63
80
|
│ └── utils_test.py
|
|
64
81
|
├── .dockerignore
|
|
65
82
|
├── .gitignore
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "motor_python"
|
|
3
|
-
version = "0.0.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.0.6"
|
|
4
|
+
description = "CubeMars motor module for Aries exosuits."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Tsmorz", email = "tony.smoragiewicz@tum.de"},{ name = "Hannes", email = "hannes.nguyen@tum.de" }]
|
|
7
7
|
requires-python = ">=3.11,<3.14"
|
|
8
8
|
|
|
9
9
|
# --- Core dependencies: NO hardware here ---
|
|
10
10
|
dependencies = [
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
"numpy>=2.2.3",
|
|
12
|
+
"loguru>=0.7.3",
|
|
13
|
+
"pyserial>=3.5",
|
|
13
14
|
]
|
|
14
15
|
|
|
15
16
|
[dependency-groups]
|
|
@@ -22,7 +23,10 @@ dev = [
|
|
|
22
23
|
"coveralls>=4.0.1",
|
|
23
24
|
"pyright>=1.1.407",
|
|
24
25
|
]
|
|
25
|
-
|
|
26
|
+
hw = [
|
|
27
|
+
]
|
|
28
|
+
no_hw = [
|
|
29
|
+
]
|
|
26
30
|
[project.urls]
|
|
27
31
|
homepage = "https://github.com/TUM-Aries-Lab/motor-module"
|
|
28
32
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Motor control main entry point using CubeMarsAK606v3 class."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
from loguru import logger
|
|
7
|
+
|
|
8
|
+
from motor_python.cube_mars_motor import CubeMarsAK606v3
|
|
9
|
+
from motor_python.definitions import DEFAULT_LOG_LEVEL, LogLevel
|
|
10
|
+
from motor_python.examples import run_motor_loop
|
|
11
|
+
from motor_python.utils import setup_logger
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main(
|
|
15
|
+
log_level: str = DEFAULT_LOG_LEVEL, stderr_level: str = DEFAULT_LOG_LEVEL
|
|
16
|
+
) -> None:
|
|
17
|
+
"""Run the main motor control loop.
|
|
18
|
+
|
|
19
|
+
:param log_level: The log level to use.
|
|
20
|
+
:param stderr_level: The std err level to use.
|
|
21
|
+
:return: None
|
|
22
|
+
"""
|
|
23
|
+
setup_logger(log_level=log_level, stderr_level=stderr_level)
|
|
24
|
+
logger.info("Starting motor control loop...")
|
|
25
|
+
|
|
26
|
+
# Use the CubeMarsAK606v3 class with context manager
|
|
27
|
+
try:
|
|
28
|
+
motor = CubeMarsAK606v3()
|
|
29
|
+
except Exception as e:
|
|
30
|
+
logger.error(f"Failed to initialize motor controller: {e}")
|
|
31
|
+
return
|
|
32
|
+
|
|
33
|
+
with motor:
|
|
34
|
+
if not motor.connected or not motor.check_communication():
|
|
35
|
+
logger.warning(
|
|
36
|
+
"Motor hardware not connected - cannot run motor test"
|
|
37
|
+
if not motor.connected
|
|
38
|
+
else "Motor is connected but not responding - hardware may be powered off or cables disconnected"
|
|
39
|
+
)
|
|
40
|
+
return
|
|
41
|
+
|
|
42
|
+
logger.info("Testing motor feedback response...")
|
|
43
|
+
|
|
44
|
+
# Query motor status at startup
|
|
45
|
+
logger.info("Initial motor status query:")
|
|
46
|
+
motor.get_status()
|
|
47
|
+
time.sleep(0.5)
|
|
48
|
+
|
|
49
|
+
# Run the motor control loop with all modes
|
|
50
|
+
try:
|
|
51
|
+
run_motor_loop(motor)
|
|
52
|
+
except KeyboardInterrupt:
|
|
53
|
+
logger.info("Interrupted by user")
|
|
54
|
+
|
|
55
|
+
# Stop motor safely
|
|
56
|
+
logger.info("Stopping motor...")
|
|
57
|
+
motor.stop()
|
|
58
|
+
|
|
59
|
+
# Final status
|
|
60
|
+
logger.info("Final motor status:")
|
|
61
|
+
motor.get_status()
|
|
62
|
+
time.sleep(0.5)
|
|
63
|
+
|
|
64
|
+
logger.info("Motor control loop complete!")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__": # pragma: no cover
|
|
68
|
+
parser = argparse.ArgumentParser("Run the pipeline.")
|
|
69
|
+
parser.add_argument(
|
|
70
|
+
"--log-level",
|
|
71
|
+
default=DEFAULT_LOG_LEVEL,
|
|
72
|
+
choices=list(LogLevel()),
|
|
73
|
+
help="Set the log level.",
|
|
74
|
+
required=False,
|
|
75
|
+
type=str,
|
|
76
|
+
)
|
|
77
|
+
parser.add_argument(
|
|
78
|
+
"--stderr-level",
|
|
79
|
+
default=DEFAULT_LOG_LEVEL,
|
|
80
|
+
choices=list(LogLevel()),
|
|
81
|
+
help="Set the std err level.",
|
|
82
|
+
required=False,
|
|
83
|
+
type=str,
|
|
84
|
+
)
|
|
85
|
+
args = parser.parse_args()
|
|
86
|
+
|
|
87
|
+
main(log_level=args.log_level)
|