Hints on nonoscillating wall following
- At first, I suggested (my apologies!) that using position-relative
commands (pr) would reduce oscillation. However, the intent was not
to continually send position commands, but to stop turning when
the robot is heading fast enough already in the correct direction.
- So, returning to velocity control, I tried to use the derivative term
to control this, but there were two problems: the change in error is very
slow and, if you turn enough to create a large derivative term, it has so
big an impact, the robot oscillates anyway.
- One possibility would be to compute the derivative term over many time
steps (often it would not change between two time steps). Alternatively,
you can get a sense of how quicky you're reaching the goal position by
looking at the sonars to either side of the left (or right) sonar reading
that you're using to do wall/corridor following.
- When the difference between these neighboring sonar values (call it D)
is large enough, set the rotational velocity to zero. As the error diminishes,
rotate the robot to reduce both the error and D. This will send it on its way.
The image below is a longish [(0,0) to (17000,500)] run at the
real robot's maximum translational velocity (200).
There is still a small bit of wobble, which
more tuning (the coefficient on D) would minimize. Because of the limit on
the angle of turn, however, the robot can start even closer to the bottom
wall (as long as both valls are visible to the sonar).
- Also, I adopted a suggestion made by Jessica and Brie to first turn
the robot without translating until a particular sonar (the right one) held
the minimum reading.
- Good luck! If you're interested (and this may hurt more than it
helps), a representative piece of the control code is
here. In this code, D is called aerror.
- One thing this code might help with (even ignoring the control)
is the on-the-fly tuning of parameters (and printing of data)
using the nonblocking keyboard input. This saves lots of time.
libracomplexwest map (cut off at Galileo)
walltestmap shown here
CS 154 references page
