From eebc8595234bd4999b66fbd7b88e040ace900d6a Mon Sep 17 00:00:00 2001 From: dufourj Date: Thu, 5 May 2005 13:47:18 +0000 Subject: 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 --- 2005/i/robert/src/motor/motor.cc | 7 +++++++ 2005/i/robert/src/motor/motor.hh | 2 ++ 2 files changed, 9 insertions(+) (limited to '2005/i/robert/src/motor') 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); + // Défini 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); -- cgit v1.2.3