The tool’s interface below is still in French. The interface is being translated by Google Translate.
mBot: avoiding obstacles
At what distance to react, which way to turn, for how long? Set it, run it, count the bumps.
Réglages
Cliquez dans l’arène pour ajouter un obstacle. Le faisceau vert montre ce que « voit » le capteur ; il devient rouge sous la distance de détection.
Programme
Les limites du vrai capteur
- Portée : de 3 cm à 4 m environ ; en dessous de 3 cm, la mesure devient fausse.
- Angle : il ne voit que devant lui, dans un cône étroit : un pied de chaise sur le côté lui échappe.
- Surfaces : un mur de biais ou un tissu renvoie mal les ultrasons.
- Réglage : plus le robot roule vite, plus il faut détecter loin, car il lui faut de la distance pour s’arrêter.
How to use the obstacle avoidance simulator
Set the detection distance, the direction and duration of the turn, then watch the virtual robot cross an arena while counting collisions.
-
Set the logic
A few parameters are enough.
-
Run the simulation
The virtual robot runs your program.
-
Get the program
mBlock blocks and Arduino code.
About the obstacle avoidance simulator
The ultrasonic sensor measures the distance to the obstacle in front of the robot. The typical program: drive forward while the way is clear, otherwise back up and turn.
The simulation shows the effect of each setting: a detection distance that is too short at high speed causes crashes, a turn that is too brief brings the robot back facing the wall.
Frequently asked questions about the obstacle avoidance simulator
At what distance should it detect?
15 to 25 cm suits medium speed; increase it if the robot drives fast.
Do I need a robot to use the tool?
No. It exists precisely to prepare or test a program before loading it onto the mBot.
Are the blocks identical to those in mBlock?
Labels may differ slightly depending on the mBlock version; the logic and the Arduino code stay the same.