robot_localisation/robot.py
def next_surrounding(pos):
        """
        Return a random next-adjacent position to 'pos'.
        """
        x, y = pos
        choices = [(x-2, y-2), (x-2, y-1), (x-2, y), (x-2, y+1), (x-2, y+2),
                   (x-1, y-2), (x-1, y+2), (x, y-2), (x, y+2), (x+1, y-2),
                   (x+1, y+2), (x+2, y-2), (x+2, y-1), (x+2, y), (x+2, y+1),
                   (x+2, y+2)]
        return choices[np.random.randint(len(choices))]

        Return a random next-adjacent position to 'pos'.
        
Return a random next-adjacent position to 'pos'.
Return a random next - adjacent position to ' pos ' .
def next_surrounding(pos):
        x, y = pos
        choices = [(x-2, y-2), (x-2, y-1), (x-2, y), (x-2, y+1), (x-2, y+2),
                   (x-1, y-2), (x-1, y+2), (x, y-2), (x, y+2), (x+1, y-2),
                   (x+1, y+2), (x+2, y-2), (x+2, y-1), (x+2, y), (x+2, y+1),
                   (x+2, y+2)]
        return choices[np.random.randint(len(choices))]
def next_surrounding ( pos ) : x , y = pos choices = [ ( x - 2 , y - 2 ) , ( x - 2 , y - 1 ) , ( x - 2 , y ) , ( x - 2 , y + 1 ) , ( x - 2 , y + 2 ) , ( x - 1 , y - 2 ) , ( x - 1 , y + 2 ) , ( x , y - 2 ) , ( x , y + 2 ) , ( x + 1 , y - 2 ) , ( x + 1 , y + 2 ) , ( x + 2 , y - 2 ) , ( x + 2 , y - 1 ) , ( x + 2 , y ) , ( x + 2 , y + 1 ) , ( x + 2 , y + 2 ) ] return choices [ np . random . randint ( len ( choices ) ) ]
Return a random next-adjacent position to 'pos'.
Return a random next - adjacent position to ' pos ' .
"""
        Return a random next-adjacent position to 'pos'.
        """
pos