Robot's source code
Dependencies: mbed
Asserv_Plan_B/planB.h@116:73d7d87e0299, 2015-05-06 (annotated)
- Committer:
- sype
- Date:
- Wed May 06 11:14:02 2015 +0000
- Revision:
- 116:73d7d87e0299
- Parent:
- 113:a30ae31795e8
- Child:
- 118:09bfc62d4867
A B
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); |
sype | 116:73d7d87e0299 | 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 | 116:73d7d87e0299 | 27 | float cmd; |
sype | 64:6489bcfc1173 | 28 | float cmd_g, cmd_d; |
sype | 116:73d7d87e0299 | 29 | float limite; |
sype | 116:73d7d87e0299 | 30 | |
sype | 116:73d7d87e0299 | 31 | float somme_erreur_theta, somme_erreur_distance; |
sype | 116:73d7d87e0299 | 32 | float delta_erreur_theta, delta_erreur_distance; |
sype | 116:73d7d87e0299 | 33 | float erreur_precedente_theta, erreur_precedente_distance; |
sype | 106:05096985d1b2 | 34 | float distanceGoal, distance; |
sype | 85:8e95432d99d3 | 35 | float thetaGoal; |
sype | 116:73d7d87e0299 | 36 | |
sype | 116:73d7d87e0299 | 37 | float m_goalX, m_goalY, m_goalPhi; |
sype | 116:73d7d87e0299 | 38 | |
sype | 108:890094ee202a | 39 | bool arrived, squip; |
sype | 79:d97090bb6470 | 40 | int N; |
Jagang | 71:95d76c181b22 | 41 | |
Jagang | 71:95d76c181b22 | 42 | char state; |
sype | 79:d97090bb6470 | 43 | //char etat_angle; |
sype | 106:05096985d1b2 | 44 | }; |
sype | 106:05096985d1b2 | 45 | |
Jagang | 110:7e71e5cd8197 | 46 | |
Jagang | 109:53918ba98306 | 47 | #endif |