Пример #1
0
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
Пример #2
0
 def __init__(self):
     '''
     Constructor
     '''
     self.Stop = Stop()
     self.goStraight = GoStraight()
     self.Turn = Turn()
     self.FullTurn = FullTurn()
     self.Approach = Approach()
Пример #3
0
 def __init__(self):
     '''
     Constructor
     '''
     self.Stop = Stop()
     self.goStraight = GoStraight()
     self.Turn = Turn()
     self.FullTurn = FullTurn()