Example #1
0
    def sendRegrasp(self, position, force, velocity, mode):

        channel = 'ROBOTIQ_%s_STATUS' % self.side.upper()
        statusMsg = lcmUtils.captureMessage(channel, lcmrobotiq.status_t)

        avgPosition = (statusMsg.positionA + statusMsg.positionB +
                       statusMsg.positionC) / 3.0
        print avgPosition

        newPosition = avgPosition / 254.0 * 100.0
        print newPosition
        if newPosition > 5.0:
            self.sendCustom(newPosition - 5.0, force, velocity, mode)
        else:
            self.sendCustom(newPosition, force, velocity, mode)

        time.sleep(0.3)
        self.sendCustom(position, force, velocity, mode)
Example #2
0
    def sendRegrasp(self, position, force, velocity, mode):

        channel = 'ROBOTIQ_%s_STATUS' % self.side.upper()
        statusMsg = lcmUtils.captureMessage(channel, lcmrobotiq.status_t)

        avgPosition = (statusMsg.positionA +
                       statusMsg.positionB +
                       statusMsg.positionC)/3.0
        print avgPosition

        newPosition = avgPosition/254.0  * 100.0
        print newPosition
        if newPosition > 5.0:
            self.sendCustom(newPosition-5.0, force, velocity, mode)
        else:
            self.sendCustom(newPosition, force, velocity, mode)

        time.sleep(0.3)
        self.sendCustom(position, force, velocity, mode)
Example #3
0
def waitForRobotXML():
    print 'waiting for robot model...'
    msg = lcmUtils.captureMessage('ROBOT_MODEL', lcmdrc.robot_urdf_t)
    return app.loadRobotModelFromString(msg.urdf_xml_string)
Example #4
0
 def waitForRobotState(self):
     msg = lcmUtils.captureMessage('EST_ROBOT_STATE', lcmdrc.robot_state_t)
     pose = robotstate.convertStateMessageToDrakePose(msg)
     pose[:6] = np.zeros(6)
     self.initialize(pose)
Example #5
0
 def waitForRobotState(self):
     msg = lcmUtils.captureMessage('EST_ROBOT_STATE', lcmdrc.robot_state_t)
     pose = robotstate.convertStateMessageToDrakePose(msg)
     pose[:6] = np.zeros(6)
     self.initialize(pose)