コード例 #1
0
    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)
コード例 #2
0
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)
コード例 #3
0
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)
コード例 #4
0
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())