Robot's source code

Dependencies:   mbed

Asserv_Plan_B/planB.h

Committer:
sype
Date:
2015-05-05
Revision:
113:a30ae31795e8
Parent:
110:7e71e5cd8197
Parent:
112:df5388d9f706
Child:
116:73d7d87e0299
Child:
117:f8c147141a0c

File content as of revision 113:a30ae31795e8:

#ifndef PLANB_H
#define PLANB_H

#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);
    void setGoal(float x, float y);
    void aserv_planB::stop(void);
    bool isArrived(void) {return arrived;}
    float carre(float x) {return x*x;}
    float Kp_angle, Kd_angle, Ki_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 erreur_precedente;
    float m_goalX, m_goalY, m_goalPhi;
    float distanceGoal, distance;
    float thetaGoal;
    float memo_g, memo_d;
    float limite;
    bool arrived, squip;
    int N;
    
    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;

};


#endif