Robot's source code
Dependencies: mbed
Asserv_Plan_B/planB.h@117:f8c147141a0c, 2015-05-06 (annotated)
- Committer:
- Jagang
- Date:
- Wed May 06 11:22:17 2015 +0000
- Revision:
- 117:f8c147141a0c
- Parent:
- 113:a30ae31795e8
- Child:
- 118:09bfc62d4867
Objectif pince et depot
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sype | 106:05096985d1b2 | 1 | #ifndef PLANB_H |
sype | 106:05096985d1b2 | 2 | #define PLANB_H |
sype | 106:05096985d1b2 | 3 | |
sype | 59:67e0d6ed44b6 | 4 | #include "mbed.h" |
Jagang | 71:95d76c181b22 | 5 | #include "Odometry2.h" |
Jagang | 62:454cd844fe1e | 6 | #include "Motor.h" |
sype | 59:67e0d6ed44b6 | 7 | |
Jagang | 62:454cd844fe1e | 8 | class aserv_planB |
Jagang | 62:454cd844fe1e | 9 | { |
sype | 64:6489bcfc1173 | 10 | public: |
Jagang | 71:95d76c181b22 | 11 | aserv_planB(Odometry2 &odometry,Motor &motorL,Motor &motorR); |
Jagang | 62:454cd844fe1e | 12 | void update(float dt); |
sype | 64:6489bcfc1173 | 13 | void control_speed(); |
Jagang | 71:95d76c181b22 | 14 | void setGoal(float x, float y, float theta); |
sype | 106:05096985d1b2 | 15 | void setGoal(float x, float y); |
Jagang | 117:f8c147141a0c | 16 | void stop(void); |
sype | 108:890094ee202a | 17 | bool isArrived(void) {return arrived;} |
sype | 85:8e95432d99d3 | 18 | float carre(float x) {return x*x;} |
sype | 106:05096985d1b2 | 19 | float Kp_angle, Kd_angle, Ki_angle; |
sype | 85:8e95432d99d3 | 20 | float Kp_distance, Ki_distance, Kd_distance; |
sype | 64:6489bcfc1173 | 21 | |
sype | 64:6489bcfc1173 | 22 | private: |
Jagang | 71:95d76c181b22 | 23 | Odometry2 &m_odometry; |
Jagang | 62:454cd844fe1e | 24 | Motor &m_motorL; |
Jagang | 62:454cd844fe1e | 25 | Motor &m_motorR; |
sype | 64:6489bcfc1173 | 26 | |
sype | 64:6489bcfc1173 | 27 | float erreur_g, vitesse_g; |
sype | 64:6489bcfc1173 | 28 | float erreur_d, vitesse_d; |
sype | 64:6489bcfc1173 | 29 | float cmd_g, cmd_d; |
sype | 64:6489bcfc1173 | 30 | float consigne_g, consigne_d; |
sype | 79:d97090bb6470 | 31 | float somme_erreur, somme_erreur_d; |
sype | 79:d97090bb6470 | 32 | float erreur_precedente; |
sype | 106:05096985d1b2 | 33 | float m_goalX, m_goalY, m_goalPhi; |
sype | 106:05096985d1b2 | 34 | float distanceGoal, distance; |
sype | 85:8e95432d99d3 | 35 | float thetaGoal; |
sype | 85:8e95432d99d3 | 36 | float memo_g, memo_d; |
sype | 112:df5388d9f706 | 37 | float limite; |
sype | 108:890094ee202a | 38 | bool arrived, squip; |
sype | 79:d97090bb6470 | 39 | int N; |
Jagang | 71:95d76c181b22 | 40 | |
Jagang | 71:95d76c181b22 | 41 | char state; |
sype | 79:d97090bb6470 | 42 | //char etat_angle; |
Jagang | 71:95d76c181b22 | 43 | |
sype | 79:d97090bb6470 | 44 | float cmd; |
sype | 70:56086a37f31f | 45 | float erreur_position_g, position_g; |
sype | 70:56086a37f31f | 46 | float erreur_position_d, position_d; |
sype | 70:56086a37f31f | 47 | float consigne_position_g, consigne_position_d; |
sype | 64:6489bcfc1173 | 48 | |
sype | 106:05096985d1b2 | 49 | }; |
sype | 106:05096985d1b2 | 50 | |
Jagang | 110:7e71e5cd8197 | 51 | |
Jagang | 109:53918ba98306 | 52 | #endif |