Virtual simulation personally developed for testing code designed to run the iRobot used in the CS101 introductory class at George Mason University. Project began from the idea of testing code without direct access to the iRobot. This was a way to ease the process of working with a group and having been assigned only one robot.
The Virtual Robot:
The virtual environment allows the iRobot to be placed on a floor where it could freely execute the code dictating its movements. Boxes and walls can be placed alongside the robot for interactive purposes and for creating obstacles like a maze.
How Does It Work:
The way that this idea is implemented is by borrowing the original create.py headers for each function and mapping them to the equivalent functions of the virtual iRobot. This allows the virtual create.py module to function as the original and can be imported as such.
Trace and Maze:
The trace and maze examples provide ideas for what exactly can be tested with this simulator. The trace example shows the use of Tkinter’s Turtle module drawing the approximated path of the robot. The maze example tests the robot’s IR and bump sensors against virtual walls and obstacles.
How To Use:
- Unzip the download and locate the create.py file and VR folder inside.
- Place the virtual create.py file along with the VR folder into your iRobot source code directory.
- Compile your code to .pyc and run your byte code with python.
- The Virtual Environment window should come up and you should place your virtual roomba by using the ‘Environment’ drop down menu or the shortcut key ‘r’.
- Place any additional environment objects onto the environment
- Play the simulation by using the ’emulator’ drop down menu or the top right play/pause button.
(Please download and install this first)