From: Leandro Lucarella Date: Fri, 10 Nov 2006 16:16:29 +0000 (+0000) Subject: Se mejora el demo, se agrega una rueda más (central) al robot para que sea más X-Git-Tag: entrega-20061218~61 X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/commitdiff_plain/865e61e603e69bd8211086a8a0b0be7a424facbe?ds=inline Se mejora el demo, se agrega una rueda más (central) al robot para que sea más estable (tal vez en el robot posta haya que sacarla porque impida la rotación por diferencia de velocidad en las ruebas laterales) y se ajustan los valores de medición del sensor para que se comporte como se espera (se aleje y acerque de las paredes). --- diff --git a/trunk/src/breve/Demo.tz b/trunk/src/breve/Demo.tz index 8b9a3e5..1fe9eb1 100644 --- a/trunk/src/breve/Demo.tz +++ b/trunk/src/breve/Demo.tz @@ -20,8 +20,9 @@ CeldasControl : DemoController { vehicle move to (10, 2, 5). - leftWheel = (vehicle add-wheel at (-.5, 0, -1.5)). - rightWheel = (vehicle add-wheel at (-.5, 0, 1.5)). + leftWheel = (vehicle add-wheel at (-2, 0, -1.5)). + rightWheel = (vehicle add-wheel at (-2, 0, 1.5)). + vehicle add-wheel at (1, 0, 0). leftWheel set-velocity to 15.0. rightWheel set-velocity to 15.0. @@ -33,14 +34,14 @@ CeldasControl : DemoController { value = sensor get-sensor-value. - if value < 5: { - leftWheel set-velocity to ((leftWheel get-velocity) + 5). - rightWheel set-velocity to ((rightWheel get-velocity) + 5). + if value < 2: { + leftWheel set-velocity to ((leftWheel get-velocity) + 1). + rightWheel set-velocity to ((rightWheel get-velocity) + 1). } - if value > 5: { - leftWheel set-velocity to ((leftWheel get-velocity) - 5). - rightWheel set-velocity to ((rightWheel get-velocity) - 5). + if value > 2: { + leftWheel set-velocity to ((leftWheel get-velocity) - 1). + rightWheel set-velocity to ((rightWheel get-velocity) - 1). } print value.