summaryrefslogtreecommitdiff
path: root/2005/i
diff options
context:
space:
mode:
authorhaller2005-05-04 20:23:37 +0000
committerhaller2005-05-04 20:23:37 +0000
commitd0da37a0996ebead846bc3277eca824c079142a0 (patch)
tree85015f9a7bcfa147508b4eccf51e06a9ff5988c4 /2005/i
parent74b469d936bad634197429ec5f3dc8d2e5cd654c (diff)
Ajout d'un setPosition
Ajout de la possibilité de setté la vitesse Max sur l'AVR
Diffstat (limited to '2005/i')
-rw-r--r--2005/i/robert/src/motor/motor.cc25
-rw-r--r--2005/i/robert/src/motor/motor.hh6
2 files changed, 29 insertions, 2 deletions
diff --git a/2005/i/robert/src/motor/motor.cc b/2005/i/robert/src/motor/motor.cc
index fb4a6dd..d963342 100644
--- a/2005/i/robert/src/motor/motor.cc
+++ b/2005/i/robert/src/motor/motor.cc
@@ -75,6 +75,16 @@ double Motor::getA(void)
return posA_;
}
+void Motor::setPosition(double x, double y, double a) //XXX Faire trois setteur
+{
+ asserv_.setXPos(x);
+ asserv_.setYPos(y);
+ asserv_.setAngle(a);
+ posX_ = x;
+ posY_ = y;
+ posA_ = a;
+}
+
void Motor::goTo(double x, double y, double a)
{
@@ -96,8 +106,9 @@ void Motor::goTo(double x, double y, double a)
void Motor::recalage(void)
{
- // XXX je ne vois pas l
- log_ ("recalage") << "Etat" << "A CODER!!!!";
+ asserv_.fuckTheWall(-3); // XXX Mettre l'arg en conf
+ log_ ("recalage") << "Vitesse" << "-3";
+ idle_ = false;
}
bool Motor::idle(void)
@@ -119,6 +130,16 @@ void Motor::rotation(double newA)
idle_ = false;
}
+void Motor::setMaxSpeed(int maxLspeed, int maxRspeed)
+{
+ asserv_.setMaxSpeed(maxLspeed, maxRspeed);
+}
+
+int Motor::getMaxLSpeed(void)
+{
+ return asserv_.getMaxLSpeed();
+}
+
bool Motor::sync(void)
{
log_("sync") << "Entr dans sync" << "";
diff --git a/2005/i/robert/src/motor/motor.hh b/2005/i/robert/src/motor/motor.hh
index 79af4d8..27f1894 100644
--- a/2005/i/robert/src/motor/motor.hh
+++ b/2005/i/robert/src/motor/motor.hh
@@ -79,6 +79,8 @@ class Motor : public Asserv::Receiver
double getY(void);
/// Renvoie l'angle A
double getA(void);
+ /// On set les positions dans l'avr
+ void setPosition(double x, double y, double a);
/// Ammne le robot la position x,y
void goTo(double x, double y, double a);
/// Recale le robot
@@ -89,6 +91,10 @@ class Motor : public Asserv::Receiver
void linearMove(double d);
/// Execute une rotation(argument en radian)
void rotation(double newA);
+ /// set de la vitesse des moteurs
+ void setMaxSpeed(int maxLspeed, int maxRspeed);
+ /// rcupre la vitesse linaire maximum
+ int getMaxLSpeed(void);
/// Syncronisation
bool sync(void);
/// On attend...