# Get button states
    btn = dm.getButton()
    # If reset button is pressed change state back to init state
    if btn == Button.RESET:
        dm.walkStop()
        dm.motionLoadINI(WALKING_INI)
        state = States.INIT

    if state == States.INIT:
        print("Init.")
        sleep(2)
        # Sets up robot initial robot. This state is run only once.
        dm.walkLoadINI(WALKING_INI)

        dm.playMotion(52)  # Bow Walk ready motion
        dm.headMoveToHome()
        look_dir = 1  # This is used to change directions when looking for the target

        state = States.READY

    elif state == States.READY:
        print("Ready.")
        # Wait for the start button press

        if btn == Button.START: state = States.FIND_TARGET

    # Look for target
    elif state == States.FIND_TARGET:
        print("Find Target.")
        # Get obj info from tracker
        obj_info = tracker.getObj()
    def init_motion(self):
        dm.initMotionManager()
        dm.playMotion(1)

        dm.headMoveToHome()
    def _init_motion(self):
        dm.initMotionManager(DEFAULT_CONFIG)
        dm.playMotion(52)

        dm.headMoveToHome()