Unity - mintforpeople/robobo-programming Wiki

RoboboSim

3D simulators that allow the use of realistic robot models such as CoppeliaSim or Gazebo are computationally cost software tools, complex to configure and not suitable for the starting educational level. But, on the other hand, if the simulators are too simple, the operation of sensors, motors and the physics of movement itself will be very different from those of the real robot. This means that students do not really learn robotics, since the problems they have to solve are different, so their training is clearly limited.

For these reasons, it was decided to develop our own simulator using Unity technology, which allows us to create a realistic and computationally light simulation, as well as allowing the simulator to run in a browser. It should be noted here that Unity is used as a development engine for many video games, so it has a usability and aesthetics similar to these, something that makes its acceptance by students is greater.

The simulator is fully functional although it is still in beta version, so some bugs could arise. The last version can be downloaded from the following links depending on your computer OS:

MacOS: unzip the file and execute the app file. It could be necessary to launch it by pressing CTRL button while double clicking on the file, only for the first time.

Windows: unzip the file and execute the file "Robobo Simulator Win64.exe"

Linux: unzip the file and execute the "Robobo Simulator Linux.x86_64" by double clicking or through a window terminal

Basic use

Once launched, the following window will appear:

By clicking on the World Select option, you enter this new window:

Where the available environments for simulation can be loaded. For instance, when clicking on the Seesaw world, the following environment is shown:

As it can be observed, the Robobo model is loaded with some elements of this specific environment. By clicking over the Robobo, a new window will appear in the left bottom corner, which displays the first person view from the robot camera, together with the local IP address of the robot.

On the top left corner, three buttons are shown in blue. The left one stops the current simulation and deletes all the pending commands, the middle one pauses simulation, and the right one restarts simulation placing the robot back on the position established by the green arrow on the floor.

Connection with Scratch and Python

To use this simulator with Scratch3, start it and load one of the available worlds as explained above. Then go to: http://scratch.theroboboproject.com and in the IP address box, write localhost and press connect. The monitoring window will start showing the sensing values obtained from the simulator

To use it with Python, you just have to specify the IP address (localhost) in the class creation. as shown in this example:


# This imports the library    
from robobopy.Robobo import Robobo

# This creates an instance of the Robobo class with the localhost IP address
rob = Robobo("localhost")

# This connects to the robobo base
rob.connect()

# This makes Robobo move straight during 4 seconds
rob.moveWheelsByTime(10,10,4)

# This disconnects from the robobo base
rob.disconnect()