Hi, I added a GUI and some other needed things to the emulator, so here is the first distribution.
Users guide: (in Spanish )
compressed folder with
https://www.dropbox.com/s/yoao21cieviitun/emulador%20mBot.zip?dl=0
mBot folder: the executable
vcredist_x86.exe if needed
a couple of sb2 scripts: line follower and obstacle avoidance
vspe: virtual serial port emulator, optional, if you need it to link scratch with the simulator
(another way of linking the simulator with scratch is using a couple of FTDI modules wired one with each other)
as the documentation is in Spanish… English will come soon, but mine is very elemental
Here is some basic explanation
In the mBot folder you will find a couple of sub-folders called “pisos” and “laberintos” : floors and mazes.
Any jpg image of 512x512 pixels can be added to the “pisos” folder and used as a mat on the 3D scene of the simulator, some examples are inside the folder for you to use. The mat will have 4m x 4m so one pixel is about 0.78 cm, i recommend the use of at least 4 pixels thick lines if you plan to build a track for the mBot to follow.
In the “laberitnos” folder, there are text files with a elemental draw of the walls of the mazes: 40x40 characters each non “space” character will build a cube of 10x10x10 centimeters so a 4m x 4m maze could be built.
About the first 3 lines of the text file they must contain 3 numbers, one on each
first line: x position in the range 1 … 40 column in the maze where mBot will start positioned
second line, y position in the range 1 … 40 line in the maze where mBot will start positioned
third starting forward angle of mBot, 0=North (?), heading away from us, 90 means going right, 180 approaching us, 270 going to the left. Any integer from 1 to 359 may be written.
If you do not link scratch with my simulator, you may select “continuar” in the first screen and use some keys to move the mBot manually and to move the camera which always look to the mBot.
Keys A/Z will increase/decrease Left motor speed by 25, Up/Down arrow does the same with the Right motor
Space will stop both motors
Left arrow will give 50 of speed to both motors and right arrow -50 (reverse) to both motors
With keypad keys you can control the camera position
5 move camera to default position 30 cm above and 40 cm behind
4,6 turn camera position clockwise/counter clockwise
8,2 rise/lower the camera
7,9 zoom in, out
to reach the first screen (3 options menu) you have to press ESCAPE key
if you select “Config” to select a floor and/or a maze, one, other or both and some other options like kind of power 6V, 3.7V, serial communication port, some optionally texts on screen like motors speed, line followers state, ultrasonic sensor reading…
On the “Escenarios” Tab, you will have a couple of list boxes with the files on the “pisos” and “laberintos” folders, the included ones and the ones you create
“pantalla” tab will let you choose screen resolution, I recommend some half width resolution so if you hide the “scene” on scratch you may have scratch and mBot simulator side by side.
enjoy
Juan