當前位置: 首頁>>代碼示例>>Python>>正文


Python SweetMoves.getMoveTime方法代碼示例

本文整理匯總了Python中man.motion.SweetMoves.getMoveTime方法的典型用法代碼示例。如果您正苦於以下問題:Python SweetMoves.getMoveTime方法的具體用法?Python SweetMoves.getMoveTime怎麽用?Python SweetMoves.getMoveTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在man.motion.SweetMoves的用法示例。


在下文中一共展示了SweetMoves.getMoveTime方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: squat

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def squat(player):
    if player.firstFrame():
        player.isChasing = False
        player.executeMove(SweetMoves.INITIAL_POS)
        player.squatting = True
        if DEBUG:
            player.executeMove(SweetMoves.SAVE_CENTER_DEBUG)
        else:
            player.executeMove(SweetMoves.GOALIE_SQUAT)
    if (player.stateTime >=
        SweetMoves.getMoveTime(SweetMoves.GOALIE_SQUAT) +
        SweetMoves.getMoveTime(SweetMoves.INITIAL_POS)):
        return player.goLater('squatted')
    return player.stay()
開發者ID:iris-xx,項目名稱:nao-man,代碼行數:16,代碼來源:SquatPositionStates.py

示例2: getKickInfo

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def getKickInfo(player):
    """
    Decides which kick to use
    """
    player.inKickingState = True

    if player.firstFrame():
        player.brain.tracker.stopHeadMoves()
        player.kickScan()

        player.kickDecider = KickDecider(player)

    # If scanning, then collect data
    if (player.stateTime < SweetMoves.getMoveTime(HeadMoves.KICK_SCAN)):
        player.kickDecider.collectData(player.brain)
        return player.stay()

    # Done scanning time to act
    player.brain.tracker.trackBall()
    player.kickDecider.calculate()

    if not player.brain.ball.on:
        if player.brain.ball.framesOff < 100: # HACK, should be constant
            return player.stay()
        else :
            player.inKickingState = False
            return player.goLater('scanFindBall')

    return player.goNow('decideKick')
開發者ID:Zakat,項目名稱:nao-man,代碼行數:31,代碼來源:KickingStates.py

示例3: gamePenalized

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def gamePenalized(player):
    if player.firstFrame():
        player.isChasing = False
        player.inKickingState = False
        player.justKicked = False
        if player.squatting:
            player.executeMove(SweetMoves.GOALIE_SQUAT_STAND_UP)
            player.squatting = False
        else:
            player.stopWalking()
        player.penalizeHeads()

    if (player.stateTime >=
        SweetMoves.getMoveTime(SweetMoves.GOALIE_SQUAT_STAND_UP)):
        player.stopWalking()

    return player.stay()
開發者ID:iris-xx,項目名稱:nao-man,代碼行數:19,代碼來源:BrunswickStates.py

示例4: kickBallExecute

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def kickBallExecute(player):
    if player.firstFrame():
        player.brain.CoA.setRobotGait(player.brain.motion)
        player.brain.tracker.trackBall()
        player.executeMove(player.chosenKick)

        if not player.penaltyMadeFirstKick:
            player.penaltyMadeFirstKick = True
        elif not player.penaltyMadeSecondKick:
            player.penaltyMadeSecondKick = True

    if not player.brain.ball.on and \
            player.brain.ball.framesOff > constants.LOOK_POST_KICK_FRAMES_OFF:
        player.lookPostKick()

    if player.stateTime >= SweetMoves.getMoveTime(player.chosenKick):
        return player.goLater('afterKick')

    return player.stay()
開發者ID:Zakat,項目名稱:nao-man,代碼行數:21,代碼來源:KickingStates.py

示例5: chasePrepare

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def chasePrepare(player):
    if player.firstFrame():
        player.brain.tracker.trackBall()
        player.isChasing = False

        if player.squatting:
            if DEBUG:
                pass
            else:
                player.executeMove(SweetMoves.GOALIE_SQUAT_STAND_UP)
        else:
            player.isChasing = True
            return player.goNow('chase')
    elif (player.stateTime >=
        SweetMoves.getMoveTime(SweetMoves.GOALIE_SQUAT_STAND_UP)):
        player.isChasing = True
        player.squatting = False
        return player.goNow('chase')

    return player.stay()
開發者ID:iris-xx,項目名稱:nao-man,代碼行數:22,代碼來源:SquatPositionStates.py

示例6: kickAtPosition

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def kickAtPosition(player):
    """
    Method to simply kick while standing in position
    Used for a very simple goalie behavior
    """
    if player.firstFrame():
        player.brain.tracker.trackBall()
        player.executeStiffness(StiffnessModes.LEFT_FAR_KICK_STIFFNESS)
    if player.counter == 2:
        player.executeMove(SweetMoves.LEFT_FAR_KICK)

    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.LEFT_FAR_KICK):
        player.standup()

        if player.brain.nav.isStopped():
            player.brain.CoA.setRobotGait(player.brain.motion)
            player.currentGait = ChaseBallConstants.FAST_GAIT
            return player.goLater('atPosition')

    return player.stay()
開發者ID:Zakat,項目名稱:nao-man,代碼行數:22,代碼來源:KickingStates.py

示例7: scanFindBall

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def scanFindBall(player):
    '''
    State to move the head to find the ball. If we find the ball, we
    move to align on it. If we don't find it, we spin to keep looking
    '''
    if player.firstFrame() or  player.brain.ball.framesOff > FRAMES_OFF_THRESH:
        player.printf("First frame or havent seen the ball in abit")
        player.brain.tracker.switchTo('scanBall')
        player.stopWalking()
    if player.brain.ball.on:
        player.brain.tracker.trackBall()

    player.printf("ball.frames on" +str(player.brain.ball.framesOn) +
                  " dist:" + str(player.brain.ball.dist))

    if player.brain.ball.framesOn > FRAMES_ON_THRESH:
        return player.goNow('rotAlignOnBall')

    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.SCAN_BALL):
        return player.goNow('spinFindBall')
    return player.stay()
開發者ID:burst,項目名稱:nao-man,代碼行數:23,代碼來源:ChaseBallStates.py

示例8: standFromFront

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def standFromFront(guard):
    if guard.firstFrame():
        guard.brain.player.executeMove(SweetMoves.STAND_UP_FRONT)
        guard.standupMoveTime = SweetMoves.getMoveTime(SweetMoves.STAND_UP_FRONT)

    return guard.goLater('standing')
開發者ID:hchapman,項目名稱:nao-man,代碼行數:8,代碼來源:FallStates.py

示例9: getTimeRemainingEst

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
 def getTimeRemainingEst(self):
     if (self.currentState == "notFallen" or
         self.currentState == "doneStanding"):
         return 0
     else:
         return SweetMoves.getMoveTime(SweetMoves.STAND_UP_FRONT)
開發者ID:bbellon,項目名稱:nbites,代碼行數:8,代碼來源:FallController.py

示例10: saveCenter

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def saveCenter(player):
    if player.firstFrame():
        player.executeMove(SweetMoves.GOALIE_SQUAT)
    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.GOALIE_SQUAT):
        return player.goLater("holdCenterSave")
    return player.stay()
開發者ID:nerkis,項目名稱:nbites,代碼行數:8,代碼來源:GoalieSaveStates.py

示例11: saveLeft

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def saveLeft(player):
    if player.firstFrame():
        player.executeMove(SweetMoves.GOALIE_DIVE_LEFT)
    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.GOALIE_DIVE_LEFT):
        return player.goLater("holdLeftSave")
    return player.stay()
開發者ID:nerkis,項目名稱:nbites,代碼行數:8,代碼來源:GoalieSaveStates.py

示例12: shouldSpinFindBall

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def shouldSpinFindBall(player):
    """
    Should spin if we already tried scanning
    """
    return (player.stateTime >=
            SweetMoves.getMoveTime(HeadMoves.HIGH_SCAN_BALL))
開發者ID:Rkfire,項目名稱:nbites,代碼行數:8,代碼來源:ChaseBallTransitions.py

示例13: saveLeft

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def saveLeft(player):
    if player.firstFrame():
        player.executeMove(SweetMoves.SAVE_LEFT_DEBUG)
    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.SAVE_LEFT_DEBUG):
        return player.goLater('holdLeftSave')
    return player.stay()
開發者ID:Zakat,項目名稱:nao-man,代碼行數:8,代碼來源:GoalieSaveStates.py

示例14: saveRight

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def saveRight(player):
    if player.firstFrame():
        player.executeMove(SweetMoves.GOALIE_DIVE_RIGHT)
    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.GOALIE_DIVE_RIGHT):
        return player.goLater('holdRightSave')
    return player.stay()
開發者ID:gnmerritt,項目名稱:nbites,代碼行數:8,代碼來源:GoalieSaveStates.py

示例15: saveRight

# 需要導入模塊: from man.motion import SweetMoves [as 別名]
# 或者: from man.motion.SweetMoves import getMoveTime [as 別名]
def saveRight(player):
    if player.firstFrame():
        player.executeMove(SweetMoves.SAVE_RIGHT_DEBUG)
    if player.stateTime >= SweetMoves.getMoveTime(SweetMoves.SAVE_RIGHT_DEBUG):
        return player.goLater("holdRightSave")
    return player.stay()
開發者ID:nglennon,項目名稱:nbites,代碼行數:8,代碼來源:GoalieSaveStates.py


注:本文中的man.motion.SweetMoves.getMoveTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。