Robot's source code

Dependencies:   mbed

Asserv_Plan_B/planB.h

Committer:
Jagang
Date:
2015-04-30
Revision:
100:a827a645d6c2
Parent:
94:5c37bcf73d14
Parent:
93:4d5664e9188a

File content as of revision 100:a827a645d6c2:

#include "mbed.h"
#include "Odometry2.h"
#include "Motor.h"

class aserv_planB
{
public:
    aserv_planB(Odometry2 &odometry,Motor &motorL,Motor &motorR);
    void update(float dt);
    void control_speed();
    void setGoal(float x, float y, float theta);
    bool isArrived(void) {return done;}
    float carre(float x) {return x*x;}
    float Kp_angle, Kd_angle;
    float Kp_distance, Ki_distance, Kd_distance;
private:
    Odometry2 &m_odometry;
    Motor &m_motorL;
    Motor &m_motorR;
    
    float erreur_g, vitesse_g;
    float erreur_d, vitesse_d;
    float cmd_g, cmd_d;
    float consigne_g, consigne_d;
    float somme_erreur, somme_erreur_d;
    float delta_erreur;
    float erreur_precedente;
    float m_goalX, m_goalY, m_goalTheta;
    bool done;
    int N;
    float moyenne;
    float limite;
    
    char state;
    //char etat_angle;
    
    float cmd;
    float erreur_position_g, position_g;
    float erreur_position_d, position_d;
    float consigne_position_g, consigne_position_d;

};