def const_unicycle_sim(degrees): # Command to the Turtle cm = 18 pix = cm2pix(cm) pix = randround(pix) degrees = int( degrees+ random.gauss(0,abs(degrees)/20.0) ) real_pix = 0.0 if pix == 0: robosim_td(degrees) else: for i in range( pix ): robosim_td(degrees*1.0 / pix) if robosim_av(): real_pix += 1.0 return degrees
def tournedroite(n): assert n in [0,30,60,90], "les angles passes a td() et tg() doivent etre un multiple de 30" bruit = randround( random.gauss(0,n/20) ) return robosim_td(n+bruit)