In this video tutorial, we demonstrate how to gently push an object to accomplish the mission. "Gently" means that we are pushing but not with force. If we push using force, the mission model will fall, and we will not accomplish the mission. We use LEGO Education SPIKE Prime and the Ultrasonic Sensor.
- 13 Dec 2022
- LEGO Education SPIKE Prime
- Align, Push, FIRST LEGO League, FIRST LEGO League 2021-2022 Cargo Connect, Attachments, Robot Base Chassis, Scratch, LEGO Education SPIKE App Word Blocks 2, Sensors, Ultrasonic Sensor
Note that some competitions might forbid the use of the LEGO Education Ultrasonic Sensor.
The program for the robot uses the yaw angle to detect the angle at which the robot has rotated and it also squares (aligns) to a border which is always a nice trick to make the program more consistent and reliable.
In this video tutorial we accomplish the FIRST LEGO League 2021 accident avoidance mission. This here is the mission model and the goal is to push on the mission model really slowly and if you if we push a little bit harder it will fall. And the goal is to push slow and for the model not to fall. We are using LEGO Education SPIKE PRIME for this mission. Here we go move forward, align to the border, use the sensor, and accomplish the mission. That's it. For the second run we again start move forward, align to the border and then use the ultrasonic distance sensor to arrive near the mission model. Let's see the program. On my left we have the program and on the right we have the recording of the robot and this is how the program works. When the program starts, we set move on to motor A and B speed to 50% and we move forward for about 3 seconds. And if we start the recording, this move forward for about 3 seconds was right here. We move forward for about 3 seconds. Move forward and now when we reach the border, what happens there is that we continue moving forward because we are not sure how far away are we from the border. And in this way we are aligned to the border. So we just continue moving forward and at the end we are sure that we've aligned to the border. Then we move back for some 6.5 cm. Here it is and then it makes sense now to start using the sensor for the alignment. We don't use the sensors because we know that we just want to move forward for about 3 seconds. But then it makes sense to try to use the sensors and we use the motion sensor and we detect the angle at which the robot rotates and we start moving and we start turning until the yaw angle is less than -85 which means -90 and we rotate rotate rotate rotate at the end. We are somewhere at 90 degrees compared to the border. So this here is the border and we are 90 degrees from the border, stop moving and then we start moving forward and we move forward and we use another sensor. And if we go to the sensors, we can see that we have different blocks for the sensors. And we have, for example, this one here, which is for the distance for the ultrasonic sensor. And we can use this block to measure the distance that we have to the block to an object and we move forward until we reach 5 cm from the mission model, which is about two inches. Now we continue with the program, move forward, forward, forward somewhere around here and when we reach it happens quite fast, so we don't see that the camera probably we should have added some weight there to make the explanation easier. But we stopped moving and we move forward. Just a little bit further. Just a little bit further.
Then what we do is we move back so that we are not supporting the mission model in any way. Here we stop moving and we return back. And that's the program. That's the program for our avoidance, accident avoidance mission. Now, what's interesting about this program is that I'll use this behavior of the robot to explain how we built some robot, how we build robots that are tolerant to errors. But this is a subject of the next tutorial. The first tutorial is how do we accomplish the mission? And the next tutorial is ten out of ten. And after that, we have a tutorial for how do we accomplish this mission in a way that it's error tolerant. Which means that the robot could start from many different places, and again, it will accomplish the mission. See you in the next tutorial.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.