• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python vrep.simxStopSimulation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vrep.simxStopSimulation函数的典型用法代码示例。如果您正苦于以下问题:Python simxStopSimulation函数的具体用法?Python simxStopSimulation怎么用?Python simxStopSimulation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了simxStopSimulation函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: restart

    def restart(self,earlyStop = False):
        if (self.cid != None):
            vrep.simxStopSimulation(self.cid, self.mode())
            vrep.simxSynchronousTrigger(self.cid)
        vrep.simxFinish(-1)  # just in case, close all opened connections
        time.sleep(1)
        self.connect()
        time.sleep(1)

        vrep.simxLoadScene(self.cid, '/home/elias/[email protected]/_Winter2015/CSC494/Scenes/Base_Quad.ttt', 0, self.mode())
        if earlyStop:
            vrep.simxStopSimulation(self.cid, self.mode())
            vrep.simxSynchronousTrigger(self.cid)
            vrep.simxFinish(-1)  # just in case, close all opened connections
            return
        vrep.simxStartSimulation(self.cid, self.mode())
        self.runtime = 0
        err, self.copter = vrep.simxGetObjectHandle(self.cid, "Quadricopter_base",
                                               vrep.simx_opmode_oneshot_wait)
        err, self.target = vrep.simxGetObjectHandle(self.cid, "Quadricopter_target",
                                               vrep.simx_opmode_oneshot_wait)

        err, self.front_camera = vrep.simxGetObjectHandle(self.cid, 'Quadricopter_frontCamera', vrep.simx_opmode_oneshot)

        err, lin, ang = vrep.simxGetObjectVelocity(self.cid, self.copter, vrep.simx_opmode_streaming)
        self.getTargetStart()
        for i in range(4):
            self.propellerScripts[i] = vrep.simxGetObjectHandle(self.cid,
                                                            'Quadricopter_propeller_respondable' + str(i) + str(1),
                                                            self.mode())
开发者ID:Etragas,项目名称:GPSDrone,代码行数:30,代码来源:Simulation.py


示例2: cleanUp

 def cleanUp(self):
     print "About to stop simulation connected to self.simulID: ", self.simulID
     vrep.simxStopSimulation(self.simulID, vrep.simx_opmode_oneshot)
     vrep.simxSynchronousTrigger(self.simulID)                    
     vrep.simxFinish(self.simulID)
     vrep.simxFinish(-1)
     print "Disconnected from V-REP"
开发者ID:dtbinh,项目名称:Homeo,代码行数:7,代码来源:ProxSensorTest.py


示例3: close

 def close(self, kill=False):
     if self.connected:
         remote_api.simxStopSimulation(self.api_id, remote_api.simx_opmode_oneshot_wait)
         remote_api.simxFinish(self.api_id)
     self.connected = False
     if kill and self.vrep_proc is not None:
         os.killpg(self.vrep_proc.pid, signal.SIGTERM)
开发者ID:humm,项目名称:dovecot,代码行数:7,代码来源:vrepcom.py


示例4: reset_simulation

def reset_simulation(clientID):
    vrep.simxStopSimulation(clientID, vrep.simx_opmode_oneshot)
    time.sleep(1) # um pequeno sleep entre o stop e o start
    vrep.simxStartSimulation(clientID, vrep.simx_opmode_oneshot)
    for move in startMoves:
        JointControl(clientID, 0, Body, move)
        time.sleep(0.1)
开发者ID:TomasSQ,项目名称:vrepSimulation,代码行数:7,代码来源:algoritmos_geneticos_v1_runner.py


示例5: disconnection

 def disconnection(self):
     """
     Make disconnection with v-rep simulator
     """
     # stop the simulation:
     vrep.simxStopSimulation(self.clientID,vrep.simx_opmode_oneshot_wait)
     
     # Now close the connection to V-REP:	
     vrep.simxFinish(self.clientID)
开发者ID:bchappet,项目名称:dnfpy,代码行数:9,代码来源:vRepSimulator.py


示例6: finishSimulation

def finishSimulation(clientID):
    errorStop=vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)
    errorClose=vrep.simxCloseScene(clientID,vrep.simx_opmode_oneshot_wait)
    error=errorStop or errorClose
    errorFinish=vrep.simxFinish(clientID)
    error=error or errorFinish
    return error
开发者ID:PatriciaPolero,项目名称:lucy,代码行数:7,代码来源:simpleTestBioloidSet.py


示例7: restart_simulation

 def restart_simulation(self):
     mode = vrep.simx_opmode_oneshot_wait
     assert vrep.simxStopSimulation(self.clientID, mode) == 0, \
                                    "StopSim Error"
     time.sleep(0.1)
     self.start_simulation()
     self.num_sim_steps = 0
开发者ID:hughhugh,项目名称:dqn-vrep,代码行数:7,代码来源:env_vrep.py


示例8: stop

 def stop( self ):
     """
     Stops the simulation
     """
     err = vrep.simxStopSimulation( self.cid, vrep.simx_opmode_oneshot_wait )
     time.sleep(0.01) # Maybe this will prevent V-REP from crashing as often
     return hasattr(self, 'failed') # Returns true if this is a failed run
开发者ID:Etragas,项目名称:GPSDrone,代码行数:7,代码来源:quadcopter.py


示例9: finishSimulation

 def finishSimulation(self, clientID):
     self.getObjectPositionFirstTime = True
     errorStop=vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)
     errorClose=vrep.simxCloseScene(clientID,vrep.simx_opmode_oneshot_wait)
     error=errorStop or errorClose
     errorFinish=vrep.simxFinish(clientID)
     error=error or errorFinish
     return error
开发者ID:PatriciaPolero,项目名称:lucy,代码行数:8,代码来源:Simulator.py


示例10: __init__

    def __init__(self, n_robots, base_name):
        self.name = "line follower tester"
        self.n_robots = n_robots
        self.base_name = base_name

        self.robot_names = [self.base_name]
        for i in range(self.n_robots-1):
            self.robot_names.append(self.base_name+'#'+str(i))

        # Establish connection to V-REP
        vrep.simxFinish(-1)  # just in case, close all opened connections

        # Connect to the simulation using V-REP's remote API (configured in V-REP, not scene specific)
        # http://www.coppeliarobotics.com/helpFiles/en/remoteApiServerSide.htm
        self.clientID = vrep.simxStart('127.0.0.1', 19997, True, True, 5000, 5)

        # Use port 19999 and add simExtRemoteApiStart(19999) to some child-script in your scene for scene specific API
        # (requires the simulation to be running)

        if self.clientID != -1:
            print ('Connected to remote API server')
        else:
            print ('Failed connecting to remote API server')
            sys.exit('Could not connect')

        # Reset running simulation
        vrep.simxStopSimulation(self.clientID, vrep.simx_opmode_oneshot)
        time.sleep(0.2)

        # Get initial robots' positions
        self.robot_handles = []
        self.robot_pos0 = []
        for rbt_name in self.robot_names:
            res, rbt_tmp = vrep.simxGetObjectHandle(self.clientID, rbt_name, vrep.simx_opmode_oneshot_wait)
            self.robot_handles.append(rbt_tmp)
            # Initialize data stream
            vrep.simxGetObjectPosition(self.clientID, self.robot_handles[-1], -1, vrep.simx_opmode_streaming)
            vrep.simxGetFloatSignal(self.clientID, rbt_name+'_1', vrep.simx_opmode_streaming)
            vrep.simxGetFloatSignal(self.clientID, rbt_name+'_2', vrep.simx_opmode_streaming)
            vrep.simxGetFloatSignal(self.clientID, rbt_name+'_3', vrep.simx_opmode_streaming)

        time.sleep(0.2)
        for rbt in self.robot_handles:
            res, pos = vrep.simxGetObjectPosition(self.clientID, rbt, -1, vrep.simx_opmode_buffer)
            self.robot_pos0.append(pos)
开发者ID:dtbinh,项目名称:vrep-python-ai,代码行数:45,代码来源:LineFolTester.py


示例11: reset

 def reset(self):
     """In VREP we reset a simulation by stopping and restarting it"""
     eCode = vrep.simxStopSimulation(self._VREP_clientId, vrep.simx_opmode_oneshot_wait)  
     if eCode != 0:
         raise Exception("Could not stop VREP simulation")
     eCode = vrep.simxStartSimulation(self._VREP_clientId, vrep.simx_opmode_oneshot_wait)   
     if eCode != 0:
         raise Exception("Could not start VREP simulation")
     vrep.simxSynchronousTrigger(self._VREP_clientId)
开发者ID:dtbinh,项目名称:Homeo,代码行数:9,代码来源:SimulatorBackend.py


示例12: reset_vrep

def reset_vrep():
    print 'Start to connect vrep'
    # Close eventual old connections
    vrep.simxFinish(-1)
    # Connect to V-REP remote server
    clientID = vrep.simxStart('127.0.0.1', 19997, True, True, 5000, 5)
    opmode = vrep.simx_opmode_oneshot_wait
    # Try to retrieve motors and robot handlers
    # http://www.coppeliarobotics.com/helpFiles/en/remoteApiFunctionsPython.htm#simxGetObjectHandle
    ret_l, LMotorHandle = vrep.simxGetObjectHandle(clientID, "Pioneer_p3dx_leftMotor", opmode)
    ret_r, RMotorHandle = vrep.simxGetObjectHandle(clientID, "Pioneer_p3dx_rightMotor", opmode)
    ret_a, RobotHandle = vrep.simxGetObjectHandle(clientID, "Pioneer_p3dx", opmode)
    vrep.simxSetJointTargetVelocity(clientID, LMotorHandle, 0, vrep.simx_opmode_blocking)
    vrep.simxSetJointTargetVelocity(clientID, RMotorHandle, 0, vrep.simx_opmode_blocking)
    time.sleep(1)    
    vrep.simxStopSimulation(clientID, vrep.simx_opmode_oneshot_wait)
    vrep.simxFinish(clientID)
    print 'Connection to vrep reset-ed!'
开发者ID:MengGuo,项目名称:P_MDP_TG,代码行数:18,代码来源:plan_execution.py


示例13: reset

 def reset( self ):
     err = vrep.simxStopSimulation(self.cid, vrep.simx_opmode_oneshot_wait)
     time.sleep(1)
     self.pos_err = [0,0,0]
     self.ori_err = [0,0,0]
     self.lin = [0,0,0]
     self.ang = [0,0,0]
     err = vrep.simxStartSimulation(self.cid, vrep.simx_opmode_oneshot_wait)
     if SYNC:
       vrep.simxSynchronous( self.cid, True )
开发者ID:Etragas,项目名称:GPSDrone,代码行数:10,代码来源:quadcopter.py


示例14: reset_rob

	def reset_rob(self):
		"""
			Sets the bubbleRob to his starting position; mind the hack, simulation has to be stopped 
		"""

		##### Set absolute position

		#stop simulation
		vrep.simxStopSimulation(self.clientID,vrep.simx_opmode_oneshot_wait) 

		#100ms delay, this is a hack because server isn't ready either
		time.sleep(0.3)

		#set on absolute position
		err = vrep.simxSetObjectPosition(self.clientID, self.bubbleRobHandle, -1, self.bubbleRobStartPosition, vrep.simx_opmode_oneshot_wait)

		#start simulation again
		vrep.simxStartSimulation(self.clientID,vrep.simx_opmode_oneshot_wait)

		time.sleep(0.3)
开发者ID:schlowmo,项目名称:neuronal_network_navigation,代码行数:20,代码来源:rob.py


示例15: resetSimulation

 def resetSimulation(self):
     returnCode = vrep.simx_return_novalue_flag
     while returnCode!=vrep.simx_return_ok:
         returnCode=vrep.simxStopSimulation(self.__clientID, vrep.simx_opmode_oneshot)
         time.sleep(0.5)
     time.sleep(0.5)
     returnCode = vrep.simx_return_novalue_flag
     while returnCode!=vrep.simx_return_ok:
         returnCode=vrep.simxStartSimulation(self.__clientID, vrep.simx_opmode_oneshot)
         time.sleep(0.5)
     time.sleep(1.0)
开发者ID:dtbinh,项目名称:Lingadrome,代码行数:11,代码来源:VRepBRSimulator.py


示例16: reset

 def reset( self ):
     err = vrep.simxStopSimulation(self.cid, vrep.simx_opmode_oneshot_wait)
     time.sleep(1)
     self.pos_err = [0,0,0]
     self.ori_err = [0,0,0]
     self.lin = [0,0,0]
     self.ang = [0,0,0]
     self.vert_prox = 0
     self.left_prox = 0
     self.right_prox = 0
     err = vrep.simxStartSimulation(self.cid, vrep.simx_opmode_oneshot_wait)
     if self.sync:
       vrep.simxSynchronous( self.cid, True )
开发者ID:bjkomer,项目名称:nengo_vrep,代码行数:13,代码来源:robots.py


示例17: startSim

    def startSim(self, clientID, screen=True):
        #I need the simulator stopped in order to be started
        retSimStop = vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)
        if retSimStop != simx_return_ok :
            print "simulation couldnt be stopped!"
        else:
            print "simulation stopped!"

        #setting the physics engine
        retSetPhyEngine = vrep.simxSetIntegerParameter(clientID, vrep.sim_intparam_dynamic_engine, bulletEngine, vrep.simx_opmode_oneshot_wait)
        if retSetPhyEngine != simx_return_ok:
            print "unable to set the physical engine"
        else:
            print "physical engine correctly setted"

        if int(self.sysConf.getProperty("physics enable?"))==1:
            vrep.simxSetBooleanParameter(clientID,sim_boolparam_dynamics_handling_enabled,True,vrep.simx_opmode_oneshot)
        else:
            vrep.simxSetBooleanParameter(clientID,sim_boolparam_dynamics_handling_enabled,False,vrep.simx_opmode_oneshot)

        #settig simulation speed
        if self.speedmodifier > 0:
            vrep.simxSetIntegerParameter(clientID,vrep.sim_intparam_speedmodifier, self.speedmodifier, vrep.simx_opmode_oneshot_wait)

        #settig simulation step
        retSetTimeStep = vrep.simxSetFloatingParameter(clientID,vrep.sim_floatparam_simulation_time_step, self.simulationTimeStepDT, vrep.simx_opmode_oneshot_wait)
        if retSetTimeStep != simx_return_ok :
            print "problems setting time step"
        else:
            print "time step setted!"

        #vrep.simxSetBooleanParameter(clientID,vrep.sim_boolparam_realtime_simulation,1,vrep.simx_opmode_oneshot_wait)

        #sync mode configuration
        if self.synchronous:
            vrep.simxSynchronous(clientID,True)

        #light mode configuration
        if not screen:
            vrep.simxSetIntegerParameter(clientID,vrep.sim_intparam_visible_layers,2,vrep.simx_opmode_oneshot_wait)
            #vrep.simxSetBooleanParameter(clientID,vrep.sim_boolparam_display_enabled,0,vrep.simx_opmode_oneshot_wait)


        #start simulation
        error=vrep.simxStartSimulation(clientID,vrep.simx_opmode_oneshot)
        if int(self.sysConf.getProperty("blank screen?"))==1:
            vrep.simxSetBooleanParameter(clientID,vrep.sim_boolparam_display_enabled,0,vrep.simx_opmode_oneshot_wait)
        return error
开发者ID:aguirrea,项目名称:lucy,代码行数:48,代码来源:Simulator.py


示例18: vrepSim

def vrepSim(clientID, action):
	vrep.simxFinish(-1)
	localhost = "127.0.0.1"
	clientID=vrep.simxStart(localhost,19997,True,True,1000,5)
	if clientID!=-1:
		print('Connected to remote API server')
		if action=="start":
			err = vrep.simxStartSimulation(clientID,vrep.simx_opmode_oneshot_wait)
			if (not err):
				print('Sim Started')
		elif action=="stop":
			err = vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)
			if (not err):
				print('Sim Stopped')		
		print("Disconnected from remote API server")
	else:
		print('Failed connecting to remote API server')
	vrep.simxFinish(clientID)
	return clientID
开发者ID:dtbinh,项目名称:pythonrobotcontrollers,代码行数:19,代码来源:vrepcontroller.py


示例19: JointControl

def JointControl(clientID, motionProxy, postureProxy, i, Body):
    # Head
    # velocity_x = vrep.simxGetObjectFloatParameter(clientID,vrep.simxGetObjectHandle(clientID,'NAO#',vrep.simx_opmode_oneshot_wait)[1],11,vrep.simx_opmode_streaming)
    pos = vrep.simxGetObjectPosition(clientID,vrep.simxGetObjectHandle(clientID, 'NAO#', vrep.simx_opmode_oneshot_wait)[1], -1, vrep.simx_opmode_streaming)[1]
    angularPos = vrep.simxGetObjectOrientation(clientID,vrep.simxGetObjectHandle(clientID, 'NAO#', vrep.simx_opmode_oneshot_wait)[1], -1, vrep.simx_opmode_streaming)[1]
    alphaPosRegister = []
    betaPosRegister = []
    gamaPosRegister = []
    j = 0
    li = []
    while vrep.simxGetConnectionId(clientID) != -1:
        for x in range(0, 150):
            commandAngles = motionProxy.getAngles('Body', False)
            j+=1
            pos = vrep.simxGetObjectPosition(clientID, vrep.simxGetObjectHandle(clientID, 'NAO#', vrep.simx_opmode_oneshot_wait)[1], -1, vrep.simx_opmode_buffer)[1]
            angularPos = vrep.simxGetObjectOrientation(clientID, vrep.simxGetObjectHandle(clientID, 'NAO#', vrep.simx_opmode_oneshot_wait)[1], -1, vrep.simx_opmode_buffer)[1]
            alphaPosRegister.append(angularPos[0])
            betaPosRegister.append(angularPos[1])
            gamaPosRegister.append(angularPos[2])

            vrep.simxSetJointTargetPosition(clientID,Body[0][i],commandAngles[0],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[1][i],commandAngles[1],vrep.simx_opmode_streaming)
            # Left Leg
            vrep.simxSetJointTargetPosition(clientID,Body[2][i],commandAngles[8],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[3][i],commandAngles[9],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[4][i],commandAngles[10],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[5][i],commandAngles[11],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[6][i],commandAngles[12],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[7][i],commandAngles[13],vrep.simx_opmode_streaming)
            # Right Leg
            vrep.simxSetJointTargetPosition(clientID,Body[8][i],commandAngles[14],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[9][i],commandAngles[15],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[10][i],commandAngles[16],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[11][i],commandAngles[17],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[12][i],commandAngles[18],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[13][i],commandAngles[19],vrep.simx_opmode_streaming)
            # Left Arm
            vrep.simxSetJointTargetPosition(clientID,Body[14][i],commandAngles[2],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[15][i],commandAngles[3],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[16][i],commandAngles[4],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[17][i],commandAngles[5],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[18][i],commandAngles[6],vrep.simx_opmode_streaming)
            # Right Arm
            vrep.simxSetJointTargetPosition(clientID,Body[19][i],commandAngles[20],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[20][i],commandAngles[21],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[21][i],commandAngles[22],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[22][i],commandAngles[23],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[23][i],commandAngles[24],vrep.simx_opmode_streaming)
            # Left Fingers
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][0],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][1],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][2],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][3],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][4],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][5],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][6],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[25][i][7],1.0-commandAngles[7],vrep.simx_opmode_streaming)
            # Right Fingers
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][0],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][1],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][2],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][3],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][4],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][5],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][6],1.0-commandAngles[25],vrep.simx_opmode_streaming)
            vrep.simxSetJointTargetPosition(clientID,Body[27][i][7],1.0-commandAngles[25],vrep.simx_opmode_streaming)
        motionProxy.stopMove()
        postureProxy.stopMove()
        # postureProxy.goToPosture("Stand",0.5)
        vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)
        break
    print 'End of simulation'
    print 'Final x pos'
    print pos
    calculos = {}
    calcular(alphaPosRegister,calculos)
    desvpadA = calculos['desvio_padrao']
    calculos = {}
    calcular(betaPosRegister,calculos)
    desvpadB = calculos['desvio_padrao']
    calculos = {}
    calcular(gamaPosRegister,calculos)
    desvpadG = calculos['desvio_padrao']
    return [(10*pos[0] - (desvpadA + desvpadB + desvpadG)/3), pos[0]]
开发者ID:ulimalta,项目名称:mc906_final,代码行数:84,代码来源:manage_joints.py


示例20: print

import sys

print ('Program started')
vrep.simxFinish(-1) # just in case, close all opened connections
clientID=vrep.simxStart('127.0.0.1',19997,True,True,5000,5) # Connect to V-REP
if clientID!=-1:
    print ('Connected to remote API server')

    # enable the synchronous mode on the client:
    vrep.simxSynchronous(clientID,True)

    # start the simulation:
    vrep.simxStartSimulation(clientID,vrep.simx_opmode_oneshot_wait)

    # Now step a few times:
    for i in range(1,10):
        if sys.version_info[0] == 3:
            input('Press <enter> key to step the simulation!')
        else:
            raw_input('Press <enter> key to step the simulation!')
        vrep.simxSynchronousTrigger(clientID);

    # stop the simulation:
    vrep.simxStopSimulation(clientID,vrep.simx_opmode_oneshot_wait)

    # Now close the connection to V-REP:
    vrep.simxFinish(clientID)
else:
    print ('Failed connecting to remote API server')
print ('Program ended')
开发者ID:Etragas,项目名称:GPSDrone,代码行数:30,代码来源:simpleSynchronousTest.py



注:本文中的vrep.simxStopSimulation函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python vrep.simxSynchronousTrigger函数代码示例发布时间:2022-05-26
下一篇:
Python vrep.simxStartSimulation函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap