1313
1414from .cri_errors import CRICommandTimeOutError , CRIConnectionError
1515
16- logger = logging .getLogger (__name__ )
16+ logger = logging .getLogger (__name__ )
17+
1718
1819class CRIController :
1920 """
@@ -110,7 +111,9 @@ def connect(self, host: str, port: int = 3920) -> bool:
110111
111112 except ConnectionRefusedError :
112113 logger .error (
113- "Connection refused: Unable to connect to %s:%i" , self .ip_address , self .port
114+ "Connection refused: Unable to connect to %s:%i" ,
115+ self .ip_address ,
116+ self .port ,
114117 )
115118 return False
116119 except Exception as e :
@@ -598,6 +601,7 @@ def move_joints(
598601 velocity : float ,
599602 wait_move_finished : bool = False ,
600603 move_finished_timeout : float | None = 300.0 ,
604+ acceleration : float | None = None ,
601605 ) -> bool :
602606 """Absolute joint move
603607
@@ -615,10 +619,22 @@ def move_joints(
615619
616620 move_finished_timeout : float
617621 timout in seconds for waiting for the move to finish, `None` will wait indefinetly
622+
623+ acceleration : float | None
624+ optional acceleration of move in percent of maximum acceleration of robot. Controller defaults to 40%
625+ requires igus Robot Control version >= V14-004-1 on robot controller
618626 """
619627 command = (
620628 f"CMD Move Joint { A1 } { A2 } { A3 } { A4 } { A5 } { A6 } { E1 } { E2 } { E3 } { velocity } "
621629 )
630+
631+ if (
632+ (acceleration is not None )
633+ and (acceleration >= 0.0 )
634+ and (acceleration <= 100.0 )
635+ ):
636+ command = f"{ command } { acceleration } "
637+
622638 if wait_move_finished :
623639 self ._register_answer ("EXECEND" )
624640
@@ -657,6 +673,7 @@ def move_joints_relative(
657673 velocity : float ,
658674 wait_move_finished : bool = False ,
659675 move_finished_timeout : float | None = 300.0 ,
676+ acceleration : float | None = None ,
660677 ) -> bool :
661678 """Relative joint move
662679 Parameters
@@ -673,8 +690,20 @@ def move_joints_relative(
673690
674691 move_finished_timeout : float
675692 timout in seconds for waiting for the move to finish, `None` will wait indefinetly
693+
694+ acceleration : float | None
695+ optional acceleration of move in percent of maximum acceleration of robot. Controller defaults to 40%
696+ requires igus Robot Control version >= V14-004-1 on robot controller
676697 """
677698 command = f"CMD Move RelativeJoint { A1 } { A2 } { A3 } { A4 } { A5 } { A6 } { E1 } { E2 } { E3 } { velocity } "
699+
700+ if (
701+ (acceleration is not None )
702+ and (acceleration >= 0.0 )
703+ and (acceleration <= 100.0 )
704+ ):
705+ command = f"{ command } { acceleration } "
706+
678707 if wait_move_finished :
679708 self ._register_answer ("EXECEND" )
680709
@@ -716,6 +745,7 @@ def move_cartesian(
716745 frame : str = "#base" ,
717746 wait_move_finished : bool = False ,
718747 move_finished_timeout : float | None = 300.0 ,
748+ acceleration : float | None = None ,
719749 ) -> bool :
720750 """Cartesian move
721751 Parameters
@@ -735,11 +765,22 @@ def move_cartesian(
735765
736766 move_finished_timeout : float
737767 timout in seconds for waiting for the move to finish, `None` will wait indefinetly
768+
769+ acceleration : float | None
770+ optional acceleration of move in percent of maximum acceleration of robot. Controller defaults to 40%
771+ requires igus Robot Control version >= V14-004-1 on robot controller
738772 """
739773 command = (
740774 f"CMD Move Cart { X } { Y } { Z } { A } { B } { C } { E1 } { E2 } { E3 } { velocity } { frame } "
741775 )
742776
777+ if (
778+ (acceleration is not None )
779+ and (acceleration >= 0.0 )
780+ and (acceleration <= 100.0 )
781+ ):
782+ command = f"{ command } { acceleration } "
783+
743784 if wait_move_finished :
744785 self ._register_answer ("EXECEND" )
745786
@@ -778,6 +819,7 @@ def move_base_relative(
778819 velocity : float ,
779820 wait_move_finished : bool = False ,
780821 move_finished_timeout : float | None = 300.0 ,
822+ acceleration : float | None = None ,
781823 ) -> bool :
782824 """Relative cartesian move in base coordinate system
783825 Parameters
@@ -797,11 +839,22 @@ def move_base_relative(
797839
798840 move_finished_timeout : float
799841 timout in seconds for waiting for the move to finish, `None` will wait indefinetly
842+
843+ acceleration : float | None
844+ optional acceleration of move in percent of maximum acceleration of robot. Controller defaults to 40%
845+ requires igus Robot Control version >= V14-004-1 on robot controller
800846 """
801847 command = (
802848 f"CMD Move RelativeBase { X } { Y } { Z } { A } { B } { C } { E1 } { E2 } { E3 } { velocity } "
803849 )
804850
851+ if (
852+ (acceleration is not None )
853+ and (acceleration >= 0.0 )
854+ and (acceleration <= 100.0 )
855+ ):
856+ command = f"{ command } { acceleration } "
857+
805858 if wait_move_finished :
806859 self ._register_answer ("EXECEND" )
807860
@@ -842,6 +895,7 @@ def move_tool_relative(
842895 velocity : float ,
843896 wait_move_finished : bool = False ,
844897 move_finished_timeout : float | None = 300.0 ,
898+ acceleration : float | None = None ,
845899 ) -> bool :
846900 """Relative cartesian move in tool coordinate system
847901 Parameters
@@ -861,11 +915,22 @@ def move_tool_relative(
861915
862916 move_finished_timeout : float
863917 timout in seconds for waiting for the move to finish, `None` will wait indefinetly
918+
919+ acceleration : float | None
920+ optional acceleration of move in percent of maximum acceleration of robot. Controller defaults to 40%
921+ requires igus Robot Control version >= V14-004-1 on robot controller
864922 """
865923 command = (
866924 f"CMD Move RelativeTool { X } { Y } { Z } { A } { B } { C } { E1 } { E2 } { E3 } { velocity } "
867925 )
868926
927+ if (
928+ (acceleration is not None )
929+ and (acceleration >= 0.0 )
930+ and (acceleration <= 100.0 )
931+ ):
932+ command = f"{ command } { acceleration } "
933+
869934 if wait_move_finished :
870935 self ._register_answer ("EXECEND" )
871936
@@ -1369,16 +1434,18 @@ def can_receive(
13691434
13701435 return item
13711436
1372- def get_board_temperatures (self , blocking : bool = True , timeout : float | None = None ) -> bool :
1437+ def get_board_temperatures (
1438+ self , blocking : bool = True , timeout : float | None = None
1439+ ) -> bool :
13731440 """Receive motor controller PCB temperatures and save in robot state
13741441
1375- Parameters
1376- ----------
1377- blocking: bool
1378- wait for response, always returns True if not waiting
1379-
1380- timeout: float | None
1381- timeout for waiting in seconds or None for infinite waiting
1442+ Parameters
1443+ ----------
1444+ blocking: bool
1445+ wait for response, always returns True if not waiting
1446+
1447+ timeout: float | None
1448+ timeout for waiting in seconds or None for infinite waiting
13821449 """
13831450 if (
13841451 self ._send_command ("SYSTEM GetBoardTemp" , True , "info_boardtemp" )
@@ -1395,17 +1462,19 @@ def get_board_temperatures(self, blocking: bool = True, timeout: float | None =
13951462 return True
13961463 else :
13971464 return False
1398-
1399- def get_motor_temperatures (self , blocking : bool = True , timeout : float | None = None ) -> bool :
1465+
1466+ def get_motor_temperatures (
1467+ self , blocking : bool = True , timeout : float | None = None
1468+ ) -> bool :
14001469 """Receive motor temperatures and save in robot state
14011470
1402- Parameters
1403- ----------
1404- blocking: bool
1405- wait for response, always returns True if not waiting
1406-
1407- timeout: float | None
1408- timeout for waiting in seconds or None for infinite waiting
1471+ Parameters
1472+ ----------
1473+ blocking: bool
1474+ wait for response, always returns True if not waiting
1475+
1476+ timeout: float | None
1477+ timeout for waiting in seconds or None for infinite waiting
14091478 """
14101479 if (
14111480 self ._send_command ("SYSTEM GetMotorTemp" , True , "info_motortemp" )
@@ -1421,4 +1490,4 @@ def get_motor_temperatures(self, blocking: bool = True, timeout: float | None =
14211490 else :
14221491 return True
14231492 else :
1424- return False
1493+ return False
0 commit comments