W14 << 
Previous Next >> fanuc_m710ic_50_pick_and_place add suction ped
fanuc_m710ic_50_pick_and_place
機械手臂組裝完,並且操作一個軸
ttt檔案
ttm
操控一個軸的程式碼
import sim as vrep
 import sys
i zmport keyboard
import math
import time
# child threaded script: 
#simExtRemoteApiStart(19999)
 
vrep.simxFinish(-1)
 
clientID = vrep.simxStart('127.0.0.1', 19999, True, True, 5000, 5)
errorCode,left_motor_handle=vrep.simxGetObjectHandle(clientID,'Revolute_joint',vrep.simx_opmode_oneshot_wait)
if clientID!= -1:
    print("Connected to remote server")
    while True: 
        try:
            if keyboard.is_pressed('up'):
                  vrep.simxSetJointTargetVelocity(clientID,left_motor_handle,-0.1, vrep.simx_opmode_oneshot_wait)
                  print('up')
            if keyboard.is_pressed('down'):     
                  vrep.simxSetJointTargetVelocity(clientID,left_motor_handle,0.1, vrep.simx_opmode_oneshot_wait)
                  print('down')
            if keyboard.is_pressed('space'):
                  vrep.simxSetJointTargetVelocity(clientID,left_motor_handle,0 , vrep.simx_opmode_oneshot_wait)
                  print('space')
            if keyboard.is_pressed('z'):
                 vrep.simxSetJointTargetVelocity(clientID,left_motor_handle,0 , vrep.simx_opmode_oneshot_wait)
                 print('break ')
                 break 
            else:
                pass
        except:
            break
else: 
    print('Connection not successful')
    sys.exit('Could not connect')
 
 
  
 
if errorCode == -1:  
    print('Can not find left or right motor')
    sys.exit()
     
參考影片:
W14 << 
Previous Next >> fanuc_m710ic_50_pick_and_place add suction ped