本文整理汇总了Python中NavHelper.createAndSendWalkVector方法的典型用法代码示例。如果您正苦于以下问题:Python NavHelper.createAndSendWalkVector方法的具体用法?Python NavHelper.createAndSendWalkVector怎么用?Python NavHelper.createAndSendWalkVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NavHelper
的用法示例。
在下文中一共展示了NavHelper.createAndSendWalkVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dodge
# 需要导入模块: import NavHelper [as 别名]
# 或者: from NavHelper import createAndSendWalkVector [as 别名]
def dodge(nav):
if nav.firstFrame():
nav.dodging = True
if nav.brain.ball.vis.frames_off < 5:
nav.brain.tracker.trackBall()
else:
nav.brain.tracker.trackObstacle(dodge.obstaclePosition)
## SET UP the dodge direction based on where the obstacle is
# if directly in front of us, move back and to one side based on
# where the goToPosition dest is
dodge.speed = Navigator.BRISK_SPEED
obstacleInfo = constants.OBS_DICT[dodge.obstaclePosition]
helper.createAndSendWalkVector(nav,
dodge.speed*obstacleInfo[0],
dodge.speed*obstacleInfo[1],
0)
print "Dodging ", obstacleInfo[2], " Obstacle"
if navTrans.doneDodging(nav):
nav.dodging = False
nav.brain.tracker.repeatBasicPan()
return nav.goLater('briefStand')
return nav.stay()