def METHOD_NAME(self):
    # find the boundaries of the environment
    with self.env:
        envmin = []
        envmax = []
        for b in self.env.GetBodies():
            ab = b.ComputeAABB()
            envmin.append(ab.pos()-ab.extents())
            envmax.append(ab.pos()+ab.extents())
        abrobot = self.robot.ComputeAABB()
        envmin = numpy.min(array(envmin),0)+abrobot.extents()
        envmax = numpy.max(array(envmax),0)-abrobot.extents()
    bounds = array(((envmin[0],envmin[1],-pi),(envmax[0],envmax[1],pi)))
    while True:
        with self.env:
            self.robot.SetAffineTranslationLimits(envmin,envmax)
            self.robot.SetAffineTranslationMaxVels([0.5,0.5,0.5])
            self.robot.SetAffineRotationAxisMaxVels(ones(4))
            self.robot.SetActiveDOFs([],DOFAffine.X|DOFAffine.Y|DOFAffine.RotationAxis,[0,0,1])
            # pick a random position
            with self.robot:
                while True:
                    goal = bounds[0,:]+random.rand(3)*(bounds[1,:]-bounds[0,:])
                    self.robot.SetActiveDOFValues(goal)
                    if not self.env.CheckCollision(self.robot):
                        break
        print('planning to: %r'%goal)
        # draw the marker
        center = r_[goal[0:2],0.2]
        xaxis = 0.5*array((cos(goal[2]),sin(goal[2]),0))
        yaxis = 0.25*array((-sin(goal[2]),cos(goal[2]),0))
        h = self.env.drawlinelist(transpose(c_[center-xaxis,center+xaxis,center-yaxis,center+yaxis,center+xaxis,center+0.5*xaxis+0.5*yaxis,center+xaxis,center+0.5*xaxis-0.5*yaxis]),linewidth=5.0,colors=array((0,1,0)))
        if self.basemanip.MoveActiveJoints(goal=goal,maxiter=3000,steplength=0.1) is None:
            print('retrying...')
            continue
        print('waiting for controller')
        self.robot.WaitForController(0)