summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/motor/test_motor.cc
diff options
context:
space:
mode:
authorschodet2004-04-16 16:46:46 +0000
committerschodet2004-04-16 16:46:46 +0000
commita3a3a4d6d183b22036a606cda8553192c98321cd (patch)
tree37d158408eabfbb8524d1214a985a44e376ee333 /2004/i/nono/src/motor/test_motor.cc
parente68b824329a537eddddd5b59b9bdf498698ee604 (diff)
Logger fonctionne.
MovementRotation aussi. Ajout de Serial::wait. Ajout de commentaires.
Diffstat (limited to '2004/i/nono/src/motor/test_motor.cc')
-rw-r--r--2004/i/nono/src/motor/test_motor.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/2004/i/nono/src/motor/test_motor.cc b/2004/i/nono/src/motor/test_motor.cc
index 2f5f893..5ad15a2 100644
--- a/2004/i/nono/src/motor/test_motor.cc
+++ b/2004/i/nono/src/motor/test_motor.cc
@@ -34,6 +34,22 @@
using namespace std;
+void
+syntax (void)
+{
+ std::cout <<
+ "test_motor - teste la gestion du déplacement.\n"
+ " g go (active l'asservissement)\n"
+ " G ungo (désactive l'asservissement)\n"
+ " w wait stop (attend l'arret complet)\n"
+ " 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"
+ " <timeout> attend un certain temps (qui augmente avec timeout)\n"
+ " ? cet ecran d'aide" << std::endl;
+}
+
int
main (int argc, char **argv)
{
@@ -94,13 +110,22 @@ main (int argc, char **argv)
if (i >= argc) break;
dA = atof (argv[i++]);
cout << "rotation " << dA << endl;
- Movement *mov = new MovementRotation (dA);
+ Movement *mov = new MovementRotation (dA * 2 * M_PI /
+ 360);
m.setMovement (mov);
}
break;
+ case '?':
+ syntax ();
+ return 0;
default:
int s;
s = atoi (argv[i++]);
+ if (s == 0)
+ {
+ syntax ();
+ return 1;
+ }
cout << "sleep " << s << endl;
for (int j = 0; j < s * 1000 / 50; ++j)
{