aaa
Fork of Move by
Diff: move.cpp
- Revision:
- 23:e30ffaeb3e0f
- Parent:
- 22:eed10c0b7fe0
- Child:
- 24:d041fc34d846
--- a/move.cpp Sat Sep 10 17:04:45 2016 +0000 +++ b/move.cpp Sat Sep 10 17:06:05 2016 +0000 @@ -108,7 +108,7 @@ else if(coordinateTheta() < rad) np = -1; else return; - move((-np)*rightspeed, (np)*leftspeed); + move((-np)*leftspeed, (np)*rightspeed); while(1) { update_np(); @@ -139,7 +139,7 @@ update(); - move(rightspeed, -leftspeed); + move(leftspeed, -rightspeed); while(1) { update(); @@ -169,7 +169,7 @@ update(); - move((-1)*rightspeed, leftspeed); + move((-1)*leftspeed, rightspeed); while(1) { update(); @@ -284,8 +284,8 @@ else daikei = 1; - move(daikei * (rightspeed*(1-ratio) + k*(*disorder) - k_theta*dtheta) + rightspeed*ratio, - daikei * (leftspeed *(1-ratio) - k*(*disorder) + k_theta*dtheta) + leftspeed *ratio); + move(daikei * (leftspeed*(1-ratio) + k*(*disorder) - k_theta*dtheta) + leftspeed*ratio, + daikei * (rightspeed *(1-ratio) - k*(*disorder) + k_theta*dtheta) + rightspeed *ratio); //pc2.printf("d_length:%d disorder:%d rs:%f ls:%f daikei:%f\n\r", *d_length, *disorder, k*(*disorder) - k_theta*dtheta, -k*(*disorder) + k_theta*dtheta, daikei); if((direction > 0 && *d_length <= 0) || (direction < 0 && *d_length >= 0)) { @@ -353,8 +353,8 @@ } else daikei = 1; - move(daikei * (rightspeed*(1-ratio) - k*disorder - k_theta*dtheta) + rightspeed*ratio, - daikei * (leftspeed *(1-ratio) + k*disorder + k_theta*dtheta) + leftspeed *ratio); + move(daikei * (leftspeed*(1-ratio) - k*disorder - k_theta*dtheta) + leftspeed*ratio, + daikei * (rightspeed *(1-ratio) + k*disorder + k_theta*dtheta) + rightspeed *ratio); pc2.printf("length:%f, d_length:%d, vx:%d, vy:%d\n\r", length, d_length, virtual_coordinateX(), virtual_coordinateY());