<< Click to Display Table of Contents >> Example |
The image from Robotino's camera (here from the Robotino Simulator) is used as input for the line detector. We use the Image Information function block to map the x position of the line from the range [0, image width] to [-image width/2, image width/2] which is in our case [-160,160]. The scale function block is used to switch the sign and to scale the output of the subtraction function block.
The value can be used directly to rotate Robotino so that Robotino turn right if the line is to its right and turns left if the line is to its left. With a constant forward velocity Robotino follows the line.