Control your robot using Google Blockly and make it to follow precise commands
WHAT:
This challenge aims to show how a robot responds to sequential commands. Teach it how to follow your orders and behave accordingly.
Lets start with an example: We have created a very simple circuit for the B-robot placing 4 traffic cones forming an square of 40×40 cms. See image below (left side).
Now, we want the robot to move around the cones leaving all of them on its left (and not touching them on its way). If we want the B-robot to advance we can use the Google Blockly command “MOVE FORWARD” + 60 CM. To turn: “TURN LEFT” + degress 90º. You can connect as many blocks as you want creating a sequence. See below, the intended route path (left) for the B-robot and the final command sequence (right side on the image) created for Google Blockly to complete a full lap. Easy!
Left: the intended path for the robot to follow
Right: the command sequence in Google Blockly
Let´s move forward and make the B-robot to repeat the sequence 10 times:
- Go to the Blockly´s left MENU and click on “Loops“, then grab and drop the REPEAT “3” times block and place it on top of the previously created command sequence as indicated below. Done! Now, the robot will repeat 3 times the same sequence.
- Remember to send the commands to be executed by the B-robot clicking on the PLAY symbol on the upper right corner.
How to control the B-robot with Google Blockly?
Steps:
- Turn ON your B-robot EVO
- Connect your computer´s WIFI to the B-robot´s WIFI (named JJROBOTS_XX) using the default password: 87654321
2. Download from GITHUB or from here the APP. Extract everything to a folder and launch BROBOT_Blockly.exe. Your default internet browser will open a webpage like the one displayed below (and a system windows indicating all the connection info in real time)
3.) Now you are ready to send commands to your B-robot 🙂 Try first with something like:
Drag and drop the block shown above and click on the RUN button. The B-robot will rotate 360º to the right and stand “still” after waiting for new commands
Find below some challenges to beat with the B-robot. Feel free to modify them as much as you want (there are no distances indicated anywhere so the overall dimension it is up to you!) but the tips provided will work for the shapes indicated below. The traffic cone 3D model can be found here.
Make a lap around the cones not touching any!
Place the traffic cones as indicated above (more or less). You have to complete a Lap not touching the cones.
Depending on the size of the hexagon and how good it was drawn the turn on the corners might vary. If you are having difficulties finishing the lap, reduce the overall dimension of the circuit.
NOTE: If there is any misalignment or small leverage offset on the B-robot´s wheels (the wheel´s hub have to be perfectly fit into the stepper motor axis and free of any plastic obstruction), the robot can suffer lack of accuracy when moving. Try to adjust the wheels or reduce the diameter of the hexagon in order to solve it.
Move the B-robot and drop the pencil using the robot arm. After that, move back to the original location.
Use a long pencil or stick as barrier (The B-robot should have enough clearance to move through easily) . Use four cones (2+2) to hold the “barrier” at the right height. Start moving the robot and once it is in front of the barrier, lower its arm and knock it down! afterwards, go back to the starting position.
A google blockly code like this will work, but of course, it will depend on the size of the circuit.
NOTE: If there is any misalignment or small leverage offset on the B-robot´s wheels (the wheel´s hub have to be perfectly fit into the stepper motor axis and free of any plastic obstruction), the robot can suffer lack of accuracy when moving. Try to adjust the wheels or reduce the diameter of the hexagon in order to solve it.