summaryrefslogtreecommitdiff
path: root/i/chuck/src/motor
diff options
context:
space:
mode:
Diffstat (limited to 'i/chuck/src/motor')
-rw-r--r--i/chuck/src/motor/motor.cc13
-rw-r--r--i/chuck/src/motor/motor.hh2
-rw-r--r--i/chuck/src/motor/test_motor.cc3
3 files changed, 17 insertions, 1 deletions
diff --git a/i/chuck/src/motor/motor.cc b/i/chuck/src/motor/motor.cc
index 32d94eb..1572845 100644
--- a/i/chuck/src/motor/motor.cc
+++ b/i/chuck/src/motor/motor.cc
@@ -141,6 +141,19 @@ Motor::receiveAck (int seq)
}
}
}
+/// The Best Evite Program ;p
+void
+Motor::avoidrobot(void)
+{
+ rotate(3.14116/2);//faire calcul ailleur
+ move(100,0);
+ rotate(3.14116/2*(-1));//voir plus haut
+ move(300,0);
+ rotate(3.14116/2*(-1));
+ move(100,0);
+ rotate(3.14116/2);
+ move(300,0);
+}
void
Motor::receiveCounterStat (int l, int r)
diff --git a/i/chuck/src/motor/motor.hh b/i/chuck/src/motor/motor.hh
index 548c7bd..2534c21 100644
--- a/i/chuck/src/motor/motor.hh
+++ b/i/chuck/src/motor/motor.hh
@@ -69,6 +69,8 @@ class Motor : public Asserv::Receiver
void reset (void);
/// get the position of robal
void getPosition(double & x, double & y, double & a) const;
+ ///Avoid un truk
+ void avoidrobot(void);
private:
/// Next seq number.
inline void nextSeq (void);
diff --git a/i/chuck/src/motor/test_motor.cc b/i/chuck/src/motor/test_motor.cc
index 760dfd6..a659a12 100644
--- a/i/chuck/src/motor/test_motor.cc
+++ b/i/chuck/src/motor/test_motor.cc
@@ -1,4 +1,4 @@
-// test_motor.cc
+ test_motor.cc
// marvin - programme du robot 2006. {{{
//
// Copyright (C) 2006 Nicolas Schodet
@@ -62,6 +62,7 @@ class TestMotor : public Tester
void preRun (void)
{
Interpreter &i = getInterpreter ();
+ i.add ("avoid",Interpreter::memFunc(motor_,&Motor::avoidrobot),"j evite un super robot");
i.add ("wait", Interpreter::memFunc (*this, &TestMotor::wait),
"wait MS\nwait for a delay in millisecond");
i.add ("move", Interpreter::memFunc (motor_, &Motor::move),