夾爪機構 <<
Previous Next >> 小組影片
遊樂設施
測試人員:40823232 日期:2021/05/14
成功驅動
import sim as vrep
import math
import random
import time
print ('Start')
# Close eventual old connections
vrep.simxFinish(-1)
# Connect to V-REP remote server
clientID = vrep.simxStart('192.168.192.115', 19997, True, True, 5000, 5)
if clientID != -1:
print ('Connected to remote API server')
res = vrep.simxAddStatusbarMessage(
clientID, "40823232",
vrep.simx_opmode_oneshot)
if res not in (vrep.simx_return_ok, vrep.simx_return_novalue_flag):
print("Could not add a message to the status bar.")
# Communication operating mode with the remote API : wait for its answer before continuing (blocking mode)
# http://www.coppeliarobotics.com/helpFiles/en/remoteApiConstants.htm
opmode = vrep.simx_opmode_oneshot_wait
# Try to retrieve motors and robot handlers
# http://www.coppeliarobotics.com/helpFiles/en/remoteApiFunctionsPython.htm#simxGetObjectHandle
vrep.simxStartSimulation(clientID,opmode)
ret1,front_handle = vrep.simxGetObjectHandle(clientID, "Revolute_joint", opmode)
else:
print ('Failed connecting to remote API server')
夾爪機構 <<
Previous Next >> 小組影片