TUTORIAL 3: Simple maze using Erle-Lidar laser block

Blockly is a ROS package that provides web-based visualization and block programming tools for robots and drones.

As mentioned in other tutorials, 'Calibrate IMU' block is needed whenever a 'Turn N degrees' block is being used. Also note that Laser value must be saved before using it.

Download this workspace

This workspace creates a specific behavior able to solve this simple maze. Erle-Lidar laser is used to measure distances and 'turn right 90 degrees' block to avoid walls.

'Repeat while true' runs the blocks inside in an infinite loop. Every loop Laser value is saved in a variable called "dist". We use that value to compare with a specific distance in the if/else block. To use that same variable as many times as needed, "duplicate" option must be selected when right clicking that variable-block.