Robot secondaire
Dependencies: RoboClaw mbed StepperMotor
Fork of RoboClaw by
Diff: Odometry/Odometry.cpp
- Revision:
- 69:1b257fb65281
- Parent:
- 49:5e2f7323f280
- Child:
- 73:538d6627ae2f
--- a/Odometry/Odometry.cpp Thu May 05 00:41:18 2016 +0000 +++ b/Odometry/Odometry.cpp Thu May 05 01:29:35 2016 +0000 @@ -107,6 +107,7 @@ void Odometry::GotoThet(double theta_) { + logger.printf("Odometry::GotoThet..."); //pos_prog++; //logger.printf("Theta : %3.2f\n\r", theta_*180/PI); //arrived = false; @@ -140,18 +141,20 @@ //logger.printf("IniR:%6d\tDistR:%6d\tIniL:%6d\tDistL:%6d\n\r", pos_initiale_right, distance_ticks_right, pos_initiale_left, distance_ticks_left); - while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)) - logger.printf ("[Thet] %d\t%d\n\r", m_pulses_right - distance_ticks_right, m_pulses_left - distance_ticks_left); + while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)); + // logger.printf ("[Thet] %d\t%d\n\r", m_pulses_right - distance_ticks_right, m_pulses_left - distance_ticks_left); //logger.printf("%6d\t%6d\t%6d\t%6d\t%6d\n\r",m_pulses_right - pos_initiale_right, distance_ticks_right, m_pulses_left - pos_initiale_left, distance_ticks_left); wait(0.4); setTheta(theta_); //arrived = true; //logger.printf("arrivey %d\n\r",pos_prog); + logger.printf("End\n\r"); } void Odometry::GotoDist(double distance) { + logger.printf("Odometry::GotoDist..."); //pos_prog++; //logger.printf("Dist : %3.2f\n\r", distance); //arrived = false; @@ -169,6 +172,7 @@ wait(0.4); //logger.printf("arrivey %d\n\r",pos_prog); //logger.printf("X : %3.2f\tY : %3.2f\tTheta : %3.2f\n\r", getX(), getY(), getTheta()*180/PI); + logger.printf("End\n\r"); } void Odometry::TestEntraxe(int i) { @@ -188,8 +192,8 @@ roboclaw.SpeedAccelDeccelPositionM1M2(accel_angle, vitesse_angle, deccel_angle, distance_ticks_right, accel_angle, vitesse_angle, deccel_angle, distance_ticks_left, 1); - while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)) - logger.printf ("[Dist] %d\t%d\n\r", m_pulses_right - distance_ticks_right, m_pulses_left - distance_ticks_left); + while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)); + // logger.printf ("[Dist] %d\t%d\n\r", m_pulses_right - distance_ticks_right, m_pulses_left - distance_ticks_left); wait(0.4); }