Rodney is an adaptive machine. It
has integrated reflexes, and decision-making and goal-setting capabilities
which is more advanced than
preprogrammed robots. It’s not so
much what he does, but how he does
it (Figure 4).
One of the bugs in the previous
iteration of the code from last time
was that it only needed one tick of
the mobility sensor for Junior to think
he we moving. So, sometimes you got
false positives, and the robot would
think that one wheel in one direction
or the other (codes 1 or 2, for
example) was in motion with
magnitude patterns (so to speak).
It was interesting since one
motion pattern — Left Reverse ( 2), for
example — might have been a false
trigger, but the robot would
nonetheless go Left Reverse ( 2), go
forward ( 4), Left Reverse ( 2), and go
forward, over and over again so that
Junior managed to move around the
playpen anyway. Rodney found a way
To squelch this false trigger, I
have added a timing loop called
Length which makes the mobility
sensor trigger twice (adjustable)
before calling the motion pattern
response a “success.” No real change
in the theory, just conditioning the
sensor. Also, the February code
included debug hooks through the
serial monitor; one of them was left in
which provided a timing function. It
has since been removed and replaced
with an adjustable delay command.
I also discovered
thing, I was noticing some consistent
patterns with the movements (bugs
notwithstanding). There seemed to be
some consistency to the motions
Rodney made. I could almost
anticipate the pattern as he started.
This was because I wasn’t seeding the
random number generator!
Yeah, I’d get random numbers,
but it would be the same sequence
every time. Regardless, the point is
now I’m seeing much more variety in
Rodney’s movements since seeding his
random number generator
(randomSeed) from the analog port
There’s still more work to be
done, as there will be for quite a
while in this business (Figure 6).
50 SERVO 05.2015
Figure 4. Rodney Jr. in his playpen, happily bouncing around exploring his environment.
Sometimes I let him out to explore the broader world.
Figure 5. This is Rodney out of his playpen, scooting across the floor. Even with only one
sensor — the mobility sensor — he rarely gets stuck because of his machine intelligence.