Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anla-xu committed Sep 24, 2024
2 parents 50eb6cf + 1ae8415 commit f644ab0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pymycobot/mycobotpro630.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,16 @@ def _init_hal_gpio(self):
for i in range(MAX_JOINTS * 2):
self.g.newpin("U32-in-" + str(i).zfill(2), hal.HAL_U32, hal.HAL_IN)

# joint limits
for i in range(MAX_JOINTS):
self.g.newpin(str(i) + ".min_limit", hal.HAL_FLOAT, hal.HAL_OUT)
self.g.newpin(str(i) + ".max_limit", hal.HAL_FLOAT, hal.HAL_OUT)

# axes limits
for i in Axis:
self.g.newpin(i.name + ".min_limit", hal.HAL_FLOAT, hal.HAL_IN)
self.g.newpin(i.name + ".max_limit", hal.HAL_FLOAT, hal.HAL_IN)

self.g.newpin("esp32-btn", hal.HAL_BIT, hal.HAL_IN)
self.g.newpin("esp32-led", hal.HAL_U32, hal.HAL_OUT)

Expand Down Expand Up @@ -743,11 +749,6 @@ def start_robot(self, power_on_only=False):
print("state_on_ok is false")
return False

for i in range(6):
if self.get_joint_error_mask(Joint(i)) & (1 << 16):
self._servo_init_can_output(Joint(i))
self._servo_clear_encoder_error(Joint(i))

os.system("halcmd setp or2.0.in1 1")
return True

Expand Down Expand Up @@ -1896,9 +1897,10 @@ def get_axis_limits(self):
"""
self.s.poll()
limits = []
for i, limit in enumerate(self.s.limit):
if self.s.axis_mask & (1 << i):
limits.append(limit)
for i in Axis:
limits.append(self.g[i.name + ".min_limit"])
limits.append(self.g[i.name + ".max_limit"])

return limits

def set_mdi_mode(self):
Expand Down

0 comments on commit f644ab0

Please sign in to comment.