|
Re: "Squaring" robot
That code doesn't do what was described.
Let me describe what it does.
It compares and subtracts two range sensors. If the difference is more than 5, it starts a loop that never ends -- the loop termination is guaranteed to be False wired to the Stop terminal. Inside that infinite loop, it sets the steering repeatedly to the same value with a small delay of 1ms. The motor controllers will only update every 5ms (Jags) or 20ms (Vics) by the way.
Equivalent code is something more like this ...
It only sets the value once to either 0.1 and -0.1, the opposite, or in the True frame it sets it to 0 and 0.
Greg McKaskle
|