From 865e61e603e69bd8211086a8a0b0be7a424facbe Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 10 Nov 2006 16:16:29 +0000 Subject: [PATCH] =?utf8?q?Se=20mejora=20el=20demo,=20se=20agrega=20una=20r?= =?utf8?q?ueda=20m=C3=A1s=20(central)=20al=20robot=20para=20que=20sea=20m?= =?utf8?q?=C3=A1s=20estable=20(tal=20vez=20en=20el=20robot=20posta=20haya?= =?utf8?q?=20que=20sacarla=20porque=20impida=20la=20rotaci=C3=B3n=20por=20?= =?utf8?q?diferencia=20de=20velocidad=20en=20las=20ruebas=20laterales)=20y?= =?utf8?q?=20se=20ajustan=20los=20valores=20de=20medici=C3=B3n=20del=20sen?= =?utf8?q?sor=20para=20que=20se=20comporte=20como=20se=20espera=20(se=20al?= =?utf8?q?eje=20y=20acerque=20de=20las=20paredes).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- trunk/src/breve/Demo.tz | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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. -- 2.43.0