File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ class ProtocolCode(object):
179179 GPIO_ON = "M22"
180180 GRIPPER_ZERO = "M24"
181181 GIRPPER_OPEN = "M25"
182- GIRPPER_CLOSE = "M26"
182+ GIRPPER_RELEASE = "M26"
183183 FAN_ON = "M27"
184184 FAN_CLOSE = "M28"
185185 SET_ANGLE = "M10"
Original file line number Diff line number Diff line change @@ -361,18 +361,23 @@ def set_gripper_zero(self):
361361 self ._debug (command )
362362 self ._respone ()
363363
364- def set_gripper_state (self , state ):
364+ def set_gripper_state (self , state , speed ):
365365 """Set gripper state.
366366
367367 Args:
368- state:
369- 0 - close
370- 1 - open
368+ state: 0 - 100
369+ 0 - full close
370+ 100 - full open
371+ speed: 0 - 1500
371372 """
372- if state :
373- command = ProtocolCode .GIRPPER_OPEN + ProtocolCode .END
374- else :
375- command = ProtocolCode .GIRPPER_CLOSE + ProtocolCode .END
373+ command = ProtocolCode .GIRPPER_OPEN + "A" + str (state ) + "F" + str (speed ) + ProtocolCode .END
374+ self ._serial_port .write (command .encode ())
375+ self ._serial_port .flush ()
376+ self ._debug (command )
377+ self ._respone ()
378+
379+ def set_gripper_release (self ):
380+ command = ProtocolCode .GIRPPER_RELEASE + ProtocolCode .END
376381 self ._serial_port .write (command .encode ())
377382 self ._serial_port .flush ()
378383 self ._debug (command )
You can’t perform that action at this time.
0 commit comments