Robot's source code
Dependencies: mbed
Asserv_Plan_B/planB.h@93:4d5664e9188a, 2015-04-30 (annotated)
- Committer:
- Jagang
- Date:
- Thu Apr 30 15:55:09 2015 +0000
- Revision:
- 93:4d5664e9188a
- Parent:
- 85:8e95432d99d3
- Child:
- 100:a827a645d6c2
- Child:
- 106:05096985d1b2
- Child:
- 109:53918ba98306
Cleaning Main; Ticker for asserv; If USB Logger, baudrate at 921 600
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sype | 59:67e0d6ed44b6 | 1 | #include "mbed.h" |
Jagang | 71:95d76c181b22 | 2 | #include "Odometry2.h" |
Jagang | 62:454cd844fe1e | 3 | #include "Motor.h" |
sype | 59:67e0d6ed44b6 | 4 | |
Jagang | 62:454cd844fe1e | 5 | class aserv_planB |
Jagang | 62:454cd844fe1e | 6 | { |
sype | 64:6489bcfc1173 | 7 | public: |
Jagang | 71:95d76c181b22 | 8 | aserv_planB(Odometry2 &odometry,Motor &motorL,Motor &motorR); |
Jagang | 62:454cd844fe1e | 9 | void update(float dt); |
sype | 64:6489bcfc1173 | 10 | void control_speed(); |
Jagang | 71:95d76c181b22 | 11 | void setGoal(float x, float y, float theta); |
Jagang | 93:4d5664e9188a | 12 | bool isArrived(void) {return done;} |
sype | 85:8e95432d99d3 | 13 | float carre(float x) {return x*x;} |
sype | 85:8e95432d99d3 | 14 | float Kp_angle, Kd_angle; |
sype | 85:8e95432d99d3 | 15 | float Kp_distance, Ki_distance, Kd_distance; |
sype | 64:6489bcfc1173 | 16 | |
sype | 64:6489bcfc1173 | 17 | private: |
Jagang | 71:95d76c181b22 | 18 | Odometry2 &m_odometry; |
Jagang | 62:454cd844fe1e | 19 | Motor &m_motorL; |
Jagang | 62:454cd844fe1e | 20 | Motor &m_motorR; |
sype | 64:6489bcfc1173 | 21 | |
sype | 64:6489bcfc1173 | 22 | float erreur_g, vitesse_g; |
sype | 64:6489bcfc1173 | 23 | float erreur_d, vitesse_d; |
sype | 64:6489bcfc1173 | 24 | float cmd_g, cmd_d; |
sype | 64:6489bcfc1173 | 25 | float consigne_g, consigne_d; |
sype | 79:d97090bb6470 | 26 | float somme_erreur, somme_erreur_d; |
sype | 79:d97090bb6470 | 27 | float erreur_precedente; |
Jagang | 71:95d76c181b22 | 28 | float m_goalX, m_goalY, m_goalTheta; |
sype | 85:8e95432d99d3 | 29 | float distance_g, distance_d; |
sype | 85:8e95432d99d3 | 30 | float thetaGoal; |
sype | 85:8e95432d99d3 | 31 | float memo_g, memo_d; |
sype | 79:d97090bb6470 | 32 | bool done; |
sype | 79:d97090bb6470 | 33 | int N; |
Jagang | 71:95d76c181b22 | 34 | |
Jagang | 71:95d76c181b22 | 35 | char state; |
sype | 79:d97090bb6470 | 36 | //char etat_angle; |
Jagang | 71:95d76c181b22 | 37 | |
sype | 79:d97090bb6470 | 38 | float cmd; |
sype | 70:56086a37f31f | 39 | float erreur_position_g, position_g; |
sype | 70:56086a37f31f | 40 | float erreur_position_d, position_d; |
sype | 70:56086a37f31f | 41 | float consigne_position_g, consigne_position_d; |
sype | 64:6489bcfc1173 | 42 | |
Jagang | 62:454cd844fe1e | 43 | }; |