A drive that goes sideways
Three degrees of freedom on the floor, and what holonomic buys you.
Do this lesson in the simulatorA car has three degrees of freedom on the floor (x, y and heading) and two controls, and it cannot use them independently: to move sideways it must drive forwards and backwards several times. That is a non-holonomic vehicle, and parallel parking is the everyday proof.
The BugBot has three controls for three degrees of freedom. It is holonomic: any combination of forwards, sideways and turning, at once, straight away.
from bugbot import *
connect()
# straight to the right, still facing the way it started
drive(0, 70, 0)
wait(2)
stop()
print("ended at", position(), "facing", round(heading()))
What that buys you
- Position and heading come apart. The robot can point the camera at one thing while travelling towards another. A tracked vehicle has to choose.
- Planning gets simpler. A path is any curve at all, not a curve a car could follow. The whole subject of Dubins paths and Reeds-Shepp curves, which exists because cars cannot go sideways, is unnecessary here.
- Control gets simpler. The error in x and the error in y can be fixed by separate terms, at the same time, which is why U2.6 fits in one page.
And what it costs: more actuators, worse efficiency, and an odd drive that is harder to model. The sideways axis of this robot is slower than the forward axis (about 15 cm/s against 20) and the two do not stay out of each other's way. Holonomic on paper, only roughly so in the world.
The three commands are not the same size
from bugbot import *
connect()
for name, cmd in (("forward", (70, 0, 0)), ("sideways", (0, 70, 0)), ("turning", (0, 0, 70))):
drive(*cmd)
wait(1.2)
bx, by = flow()
print(name, "flow", (round(bx, 1), round(by, 1)), "turn rate", round(imu()[1]))
stop()
wait(0.6)
Command 70 means 70 percent of that axis, and each axis has its own full scale. Any code that treats a command as a velocity will be wrong by the ratio between them, and wrong differently in x and y, which shows up as a robot that drifts to one side of the straight line it was asked for.
Task: crab into the zone
The green zone is to the robot's right. Get into it without turning: the robot has to arrive facing the same way it started.
from bugbot import *
connect()
# drive(forward, sideways, rotation)
Challenges
- Drive a diagonal by using forward and sideways together. Is the path straight?
- Drive in a circle without changing the heading at all, using only the two translation terms.
- Measure the sideways top speed and the forward top speed, and work out the ratio. Keep the number.