Hello, im trying to code these:
- Straight-line collision prevention:
o Using the Mbot and block programming, create a program that would
move the robot in a straight line until an obstacle is sensed. Once an
obstacle is detected in front of the robot, it should stop and wait until
the obstacle is removed. Once the obstacle is removed, the robot
should continue its mission of moving forward. Congrats, you just
prevented a collision!
o The robot should be able to exhibit this collision-prevention behavior
multiple times in a row, in a single take. Demonstrate that the collision
prevention feature works when the obstacle is introduced and removed
multiple times.
o Questions:
What is the unit of the ultrasonic sensor readings?
What was the stopping distance threshold you used in your
code?
When you look at your robot’s actual stopping distance from the
obstacle: is it more, less, or the same from your distance
threshold? Why?
- “Robot in a box”:
● Place the robot in an environment fully surrounded by obstacles.
Create a program that would move the robot inside this “box”
indefinitely. When an obstacle is detected, it should turn around and
move in a pseudo-random and obstacle-free direction. The robot
should not hit any obstacles at any time.
I tried a few trials and error and couldnt get the mbot to complete the task-i programmed the ultrasonic sensor distance to be less than 10 but it seems like the mbot just dont stop when obstacle is being detected. How should i approach the block codings? Do anyone have a sample code i can try using?