Quick Start Guide
© Modular Robotics, 2016 www.modrobotics.comPage 14
15. Gradients: Diffusion
This robot shows the gradient story. The Bar
Graph Action block is attached to one of two
Passive blocks between two Distance Sense
blocks, one at each end of the robot. The
closer Distance Sense block has a bigger
effect on the Bar Graph Action block. If your
robot has an Action block right between two
Sense blocks, the Action block averages the
numbers the two Sense blocks tell it.
If one Sense block is farther from the Action
block than the other, then the closer block
has a stronger effect. You can test this using
the Bar Graph block. Build a robot with the two
Distance Sense blocks on either end and two
Passive blocks between them. Add a Bar Graph
Action block to one of the Passive blocks.
Now play with your robot: put one hand in front
of each Distance Sense block, so that the Bar
Graph Action block reads high (all its cells
light). Take your hand away from the Distance
Sense block that is farther from the Bar Graph
Action block. Now put your hand back and try
the other Distance Sense block. The Bar Graph
Action block responds more strongly to the
closer Distance Sense block.
An Action block acts according to the average
of the Sense block numbers it gets, weighted
by the distances (number of blocks from
Sense block to Action block, or “hop count”)
they’ve travelled.