@@ -519,10 +519,16 @@ def _init_hal_gpio(self):
519519 for i in range (MAX_JOINTS * 2 ):
520520 self .g .newpin ("U32-in-" + str (i ).zfill (2 ), hal .HAL_U32 , hal .HAL_IN )
521521
522+ # joint limits
522523 for i in range (MAX_JOINTS ):
523524 self .g .newpin (str (i ) + ".min_limit" , hal .HAL_FLOAT , hal .HAL_OUT )
524525 self .g .newpin (str (i ) + ".max_limit" , hal .HAL_FLOAT , hal .HAL_OUT )
525526
527+ # axes limits
528+ for i in Axis :
529+ self .g .newpin (i .name + ".min_limit" , hal .HAL_FLOAT , hal .HAL_IN )
530+ self .g .newpin (i .name + ".max_limit" , hal .HAL_FLOAT , hal .HAL_IN )
531+
526532 self .g .newpin ("esp32-btn" , hal .HAL_BIT , hal .HAL_IN )
527533 self .g .newpin ("esp32-led" , hal .HAL_U32 , hal .HAL_OUT )
528534
@@ -743,11 +749,6 @@ def start_robot(self, power_on_only=False):
743749 print ("state_on_ok is false" )
744750 return False
745751
746- for i in range (6 ):
747- if self .get_joint_error_mask (Joint (i )) & (1 << 16 ):
748- self ._servo_init_can_output (Joint (i ))
749- self ._servo_clear_encoder_error (Joint (i ))
750-
751752 os .system ("halcmd setp or2.0.in1 1" )
752753 return True
753754
@@ -1896,9 +1897,10 @@ def get_axis_limits(self):
18961897 """
18971898 self .s .poll ()
18981899 limits = []
1899- for i , limit in enumerate (self .s .limit ):
1900- if self .s .axis_mask & (1 << i ):
1901- limits .append (limit )
1900+ for i in Axis :
1901+ limits .append (self .g [i .name + ".min_limit" ])
1902+ limits .append (self .g [i .name + ".max_limit" ])
1903+
19021904 return limits
19031905
19041906 def set_mdi_mode (self ):
0 commit comments