summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/motor
diff options
context:
space:
mode:
authordufourj2005-05-05 13:47:18 +0000
committerdufourj2005-05-05 13:47:18 +0000
commiteebc8595234bd4999b66fbd7b88e040ace900d6a (patch)
tree45f291b245174947347800999a72e0861be3786b /2005/i/robert/src/motor
parentdc1defb9c6dbc965782f1da84979010f2520809c (diff)
Config :
* ralentissement de la vitesse et accélération Ai : * réinitialisation de la PWM à zéro * gestion de rotations inutiles Motor : * fonction pour reset de la PWM sur asserv
Diffstat (limited to '2005/i/robert/src/motor')
-rw-r--r--2005/i/robert/src/motor/motor.cc7
-rw-r--r--2005/i/robert/src/motor/motor.hh2
2 files changed, 9 insertions, 0 deletions
diff --git a/2005/i/robert/src/motor/motor.cc b/2005/i/robert/src/motor/motor.cc
index 9cf55f8..c292e9c 100644
--- a/2005/i/robert/src/motor/motor.cc
+++ b/2005/i/robert/src/motor/motor.cc
@@ -58,6 +58,7 @@ void Motor::init (void)
void Motor::stop(void)
{
asserv_.setSpeed();
+ idle_ = true;
}
double Motor::getX(void)
@@ -85,6 +86,12 @@ void Motor::setPosition(double x, double y, double a) //XXX Faire trois setteur
posA_ = a;
}
+void
+Motor::setPwm(int leftPwm, int rightPwm)
+{
+ asserv_.setPwm (leftPwm, rightPwm);
+}
+
void Motor::goTo(double x, double y, double a)
{
diff --git a/2005/i/robert/src/motor/motor.hh b/2005/i/robert/src/motor/motor.hh
index 062957c..b527525 100644
--- a/2005/i/robert/src/motor/motor.hh
+++ b/2005/i/robert/src/motor/motor.hh
@@ -115,6 +115,8 @@ class Motor : public Asserv::Receiver
void receiveSpeedStat (int leftError, int leftInt, int rightError,
int rightInt);
void receivePwm (double leftPwm, double rightPwm);
+ // Dfini les valeurs de la PWM
+ void setPwm(int leftPwm = 0, int rightPwm = 0);
void receiveTiming (int motorTimer4,
int motorTimer3, int motorTimer2,
int motorTimer1, int motorTimer0);