Skip to content

Commit 6715a6c

Browse files
Define MotionType and module level
1 parent 7c82699 commit 6715a6c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

cri_lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. include:: ../README.md
33
"""
44

5-
from .cri_controller import CRIController
5+
from .cri_controller import CRIController, MotionType
66
from .cri_errors import CRICommandTimeOutError, CRIConnectionError, CRIError
77
from .cri_protocol_parser import CRIProtocolParser
88
from .robot_state import (

cri_lib/cri_controller.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
logger = logging.getLogger(__name__)
1616

1717

18+
class MotionType(Enum):
19+
"""Robot Motion Type for Jogging"""
20+
21+
Joint = "Joint"
22+
CartBase = "CartBase"
23+
CartTool = "CartTool"
24+
Platform = "Platform"
25+
26+
1827
class CRIController:
1928
"""
2029
Class implementing the CRI network protocol for igus Robot Control.
@@ -25,14 +34,6 @@ class CRIController:
2534
RECEIVE_TIMEOUT_SEC = 5
2635
DEFAULT_ANSWER_TIMEOUT = 10.0
2736

28-
class MotionType(Enum):
29-
"""Robot Motion Type for Jogging"""
30-
31-
Joint = "Joint"
32-
CartBase = "CartBase"
33-
CartTool = "CartTool"
34-
Platform = "Platform"
35-
3637
def __init__(self) -> None:
3738
self.robot_state: RobotState = RobotState()
3839
self.robot_state_lock = threading.Lock()
@@ -1512,3 +1513,7 @@ def get_motor_temperatures(
15121513
return True
15131514
else:
15141515
return False
1516+
1517+
1518+
# Monkey patch to maintain backward compatibility
1519+
CRIController.MotionType = MotionType # type: ignore

0 commit comments

Comments
 (0)