当前位置: 首页>>代码示例>>Python>>正文


Python Simulator.connectVREP方法代码示例

本文整理汇总了Python中Simulator.Simulator.connectVREP方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.connectVREP方法的具体用法?Python Simulator.connectVREP怎么用?Python Simulator.connectVREP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Simulator.Simulator的用法示例。


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

示例1: AXAngle

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import connectVREP [as 别名]
from Simulator import Simulator
from AXAngle   import AXAngle

import math
import os

standadRemoteApiPort=19997
localhost='127.0.0.1'
genetic_bioloid=os.getcwd()+"/models/genetic_bioloid.ttt"

print 'Program started' 
angle = AXAngle()
sim = Simulator()

clientID = sim.connectVREP()

if clientID !=-1:
    print 'Connected to remote API server'
    sim.loadscn(clientID, genetic_bioloid)
    sim.startSim(clientID,True)
    angle.setDegreeValue(150)    
    sim.setJointPosition(clientID,"R_Hip_Pitch",angle.toVrep())
    sim.setJointPosition(clientID,"L_Hip_Pitch",angle.toVrep())    
    pos1x, pos1y=sim.getBioloidPlannarPosition(clientID)
    end=False
    while not end:
        for i in xrange(30):
            angle.setDegreeValue(150-i)
            #print "voy a setear ax12 value en cadera izquierda: ", 150 - i
            sim.setJointPosition(clientID,'L_Hip_Pitch',angle.toVrep())
开发者ID:PatriciaPolero,项目名称:lucy,代码行数:32,代码来源:testBioloidAngles.py


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