in ruote aggiuno giroscopio, creato appunti dettagli robot

This commit is contained in:
leo 2025-09-21 19:16:29 +02:00
parent 81b6fd69fb
commit a6aa951e40
2 changed files with 24 additions and 4 deletions

10
leo/appunti.txt Normal file
View file

@ -0,0 +1,10 @@
distanza tra le assi = 87mm
diametro ruota = 43.2mm
circonferenza ruota = 43.5 * pi = 135.71mm
strada da percorrere = 87 * pi / 4 = 68.33mm
gradi da fare (per girare di 90gradi)
circ routa : 360 = strada da percorrere : x
x = 360 * strada da percorrere : circ ruota

View file

@ -2,6 +2,8 @@ from pybricks.parameters import Port, Stop
from pybricks.pupdevices import Motor from pybricks.pupdevices import Motor
from pybricks.tools import wait from pybricks.tools import wait
# from pybricks.hub import PrimHub
mDestra = Motor(Port.F) mDestra = Motor(Port.F)
mSinistra = Motor(Port.B) mSinistra = Motor(Port.B)
@ -18,11 +20,19 @@ def turn(speed_L, speed_R, gradi):
mDestra.run_angle(speed_R, gradi, then=Stop.NONE, wait=True) mDestra.run_angle(speed_R, gradi, then=Stop.NONE, wait=True)
vai_avanti(1000, 360) # reset_angle()
turn(1000, 1000, 360)
vai_avanti(1000, 360)
turn(1000, 1000, 360)
# vai_avanti(1000, 360)
turn(1000, 1000, 120)
# vai_avanti(1000, 360)
# turn(1000, 1000, 360)
# vai_avanti(1000, 360)
# turn(1000, 1000, 360)
# vai_avanti(1000, 360)
# turn(1000, 1000, 360)
# giro = hub.imu.heading()
# print(giro)
while not (mSinistra.done() and mDestra.done()): while not (mSinistra.done() and mDestra.done()):
wait(10) wait(10)