In [2]:
import vrep
In [3]:
clientID=vrep.simxStart('127.0.0.1',19997,True,True,5000,5)
clientID
Out[3]:
In [4]:
res,objs=vrep.simxGetObjects(clientID,
vrep.sim_handle_all,
vrep.simx_opmode_oneshot_wait)
# res, objs
In [5]:
errcode, handle = vrep.simxGetObjectHandle(clientID,
'Vision_sensor',
vrep.simx_opmode_oneshot_wait)
handle
Out[5]:
In [6]:
%%timeit
errorcode, res, image = vrep.simxGetVisionSensorImage(clientID,
handle,
0,
vrep.simx_opmode_streaming)
In [7]:
%%timeit
ec, pos = vrep.simxGetObjectPosition(clientID, handle, -1, vrep.simx_opmode_streaming)
In [12]:
%%timeit
ec, orientation = vrep.simxGetObjectOrientation(clientID, handle, -1, vrep.simx_opmode_streaming)
In [15]:
ec, orientation = vrep.simxGetObjectOrientation(clientID, handle, -1, vrep.simx_opmode_streaming)
In [16]:
orientation
Out[16]:
In [19]:
errcode, handle = vrep.simxGetObjectHandle(clientID,
'Neck',
vrep.simx_opmode_oneshot_wait)
handle
Out[19]:
In [22]:
import math
In [25]:
vrep.simxSetJointTargetPosition(clientID,
handle,
-math.pi/2,
vrep.simx_opmode_streaming)
Out[25]:
In [1]:
errcode, handle = vrep.simxGetObjectHandle(clientID,
'leftMotor0',
vrep.simx_opmode_oneshot_wait)
handle
In [48]:
vrep.simxSetJointTargetVelocity(clientID,
handle,
0,
vrep.simx_opmode_oneshot)
Out[48]:
In [ ]: