summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/motor/test_motor.cc
diff options
context:
space:
mode:
authorschodet2004-04-25 20:48:52 +0000
committerschodet2004-04-25 20:48:52 +0000
commit3af9c88516543659002f5303d703f32579b45d6f (patch)
tree0ffefb8dd07b9a748e5e8338d673fee94f3b706b /2004/i/nono/src/motor/test_motor.cc
parentba4f2fedc890eb3a565c5d92cce6e88d2134e2ab (diff)
Modification de Goto.
Diffstat (limited to '2004/i/nono/src/motor/test_motor.cc')
-rw-r--r--2004/i/nono/src/motor/test_motor.cc31
1 files changed, 23 insertions, 8 deletions
diff --git a/2004/i/nono/src/motor/test_motor.cc b/2004/i/nono/src/motor/test_motor.cc
index 27d4e68..42130bf 100644
--- a/2004/i/nono/src/motor/test_motor.cc
+++ b/2004/i/nono/src/motor/test_motor.cc
@@ -45,7 +45,8 @@ syntax (void)
" b <speed> <len>\n"
" mouvement basique\n"
" t <x> <y> va en (x, y)\n"
- " r <a> se dirige vers l'angle a en degrées\n"
+ " r <a> se dirige vers l'angle a en degrés\n"
+ " c <r> <a> Suis un arc de rayon r et d'angle a en degrés\n"
" <timeout> attend un certain temps (qui augmente avec timeout)\n"
" ? cet ecran d'aide" << std::endl;
}
@@ -62,17 +63,17 @@ main (int argc, char **argv)
switch (argv[i][0])
{
case 'g':
- cout << "go" << endl;
+ cout << "test: go" << endl;
i++;
m.go ();
break;
case 'G':
- cout << "ungo" << endl;
+ cout << "test: ungo" << endl;
i++;
m.go (false);
break;
case 'w':
- cout << "wait stop" << endl;
+ cout << "test: wait stop" << endl;
i++;
m.waitStopped ();
break;
@@ -85,7 +86,7 @@ main (int argc, char **argv)
speed = atof (argv[i++]);
if (i >= argc) break;
len = atof (argv[i++]);
- cout << "basic " << speed << ' ' << len << endl;
+ cout << "test: basic " << speed << ' ' << len << endl;
Movement *mov = new MovementBasic (speed, len);
m.setMovement (mov);
}
@@ -98,7 +99,7 @@ main (int argc, char **argv)
dX = atof (argv[i++]);
if (i >= argc) break;
dY = atof (argv[i++]);
- cout << "goto " << dX << ' ' << dY << endl;
+ cout << "test: goto " << dX << ' ' << dY << endl;
Goto *g = new GotoSimple (dX, dY);
Movement *mov = new MovementGoto (g);
m.setMovement (mov);
@@ -110,12 +111,26 @@ main (int argc, char **argv)
double dA;
if (i >= argc) break;
dA = atof (argv[i++]);
- cout << "rotation " << dA << endl;
+ cout << "test: rotation " << dA << endl;
Movement *mov = new MovementRotation (dA * 2 * M_PI /
360);
m.setMovement (mov);
}
break;
+ case 'c':
+ {
+ i++;
+ double r, a;
+ if (i >= argc) break;
+ r = atof (argv[i++]);
+ if (i >= argc) break;
+ a = atof (argv[i++]);
+ cout << "test: circle " << r << ' ' << a << endl;
+ Goto *g = new GotoCircle (r, a * 2 * M_PI / 360);
+ Movement *mov = new MovementGoto (g);
+ m.setMovement (mov);
+ }
+ break;
case '?':
syntax ();
return 0;
@@ -127,7 +142,7 @@ main (int argc, char **argv)
syntax ();
return 1;
}
- cout << "sleep " << s << endl;
+ cout << "test: sleep " << s << endl;
for (int j = 0; j < s * 1000 / 50; ++j)
{
m.ok ();