コード例 #1
0
ファイル: Locomotion.py プロジェクト: rondelion/Lingadrome
class Locomotion(object):
    '''
    classdocs
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self.Stop = Stop()
        self.goStraight = GoStraight()
        self.Turn = Turn()
        self.FullTurn = FullTurn()
        self.Approach = Approach()

    def action(self, input, states, parameters):
        if states["locomotionType"] == "Stop":
            self.Stop.action(input, states, parameters)
        elif states["locomotionType"] == "GoStraight":
            self.goStraight.action(input, states, parameters)
        elif states["locomotionType"] == "Turn":
            self.Turn.action(input, states, parameters)
        elif states["locomotionType"] == "FullTurn":
            if input.has_key("orientation") and input["orientation"]!=None:
                self.FullTurn.action(input, states, parameters)
        elif states["locomotionType"] == "Approach":
            self.Approach.action(input, states, parameters)
        elif states["locomotionType"] == "Carry":
            pass