Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: moves/moves.cpp
- Revision:
- 46:c58335028928
- Parent:
- 45:6df20a8f4b21
--- a/moves/moves.cpp Fri May 17 05:43:51 2019 +0000 +++ b/moves/moves.cpp Fri May 17 06:07:59 2019 +0000 @@ -103,11 +103,12 @@ void Run(WalkMode mode, int d_step_l, int is_not_wait_right = 0) { CanID id = NORMAL; - if(is_not_wait_right == 1) - id = UNSYNC; - can_send(mode, motor_lo.getDutyLimit()); + if(is_not_wait_right == 1) { +// id = UNSYNC; + } + can_send(mode, motor_lo.getDutyLimit(), id); RunNotWaitRight(mode, d_step_l); - if(is_not_wait_right == 0){ + if(is_not_wait_right == 0) { WaitAnotherLeg(); } } @@ -122,11 +123,11 @@ } DEBUG("angle:%.3f backdist:%.2f\r\n", degree0, get_dist_back()); } -void straightAndInfinity(float target_degree, float tolerance_degree) +void straightAndInfinity(float target_degree, float tolerance_degree, int is_not_wait_right) { if(target_degree - degree0 > tolerance_degree) curveLeft(); else if(degree0 - target_degree > tolerance_degree) curveRight(); - else straight(); + else straight(is_not_wait_right); } void climbAndInfinity(float target_degree, float tolerance_degree) { @@ -142,9 +143,9 @@ { Run(STOP,0); } -void straight() +void straight(int is_not_wait_right) { - Run(FORWARD,1); + Run(FORWARD,1, is_not_wait_right); } void turnLeft() {