def publish_schunk_position_cmd(self, utime: int = 0): while True: if self.schunk_position_commanded is None: time.sleep(1 / 20) continue msg = lcmt_schunk_wsg_command() msg.utime = utime self.publish_lock.acquire() msg.target_position_mm = self.schunk_position_commanded self.publish_lock.release() msg.force = self.force_limit self.lc_pub.publish("SCHUNK_WSG_COMMAND", msg.encode()) # publish at 20Hz. time.sleep(1 / 20)
def sendGripperCommand(targetPositionMM, force): msg = lcmdrake.lcmt_schunk_wsg_command() msg.utime = int(time.time()*1e6) msg.force = force msg.target_position_mm = targetPositionMM lcmUtils.publish('SCHUNK_WSG_COMMAND', msg)
def sendGripperCommand(targetPositionMM, force): msg = lcmdrake.lcmt_schunk_wsg_command() msg.utime = int(time.time() * 1e6) msg.force = force msg.target_position_mm = targetPositionMM lcmUtils.publish('SCHUNK_WSG_COMMAND', msg)
def close_gripper(lc): cmd = drake.lcmt_schunk_wsg_command() cmd.utime = 1 cmd.target_position_mm = 5 cmd.force = 80 lc.publish("SCHUNK_WSG_COMMAND", cmd.encode())