Robot Simulator
This was a quick and dirty project for a robotics class that I took at Georgia Tech in 2005. In this project, I built a Matlab simulator for testing out some simple obstacle avoidance/navigation code. My hope is that someone uses this a springboard to make a more complete version.
Introduction
I’ve spent plenty of time working on robotics projects, and I have enjoyed all aspects of the design process from mechanical to electrical to computer science. However, if you are only interested in the computer science part (control theory, artificial intelligence, creating behavior) then having to have an electromechanical platform to run your code on can be a big hassle!
One solution to this is to use a pre-made platform (such as in this project). However, this too can be problematic because everything can break, and when developing algorithms, it is often convenient to prototype them in a simulated environment where real-life confounders don’t hinder your creativity.
Simulations
This problem is often solved by robot simulators. One that I’ve used with great success is differential steering model. This is a simple, but very useful model for robotic actuation. With this type of drive system the robot can drive straight, trace an arc, or even turn in place.
Simulated World
The simulated robot can make its way around a simulated environment represented by a .png file where black represents walls, and white represents flat, clear terrain. Thus any “environment” can be shown as a black and white image. For testing, I used two types of terrains, an organic-looking obstacle course and an “office” with square walls and corners.
Navigation
So, now that we have a simulated robot in a simulated world we want it to do something. The goal I was working towards was this: Make the robot wander around the environment covering most of the area and not hitting any of the walls. This is accomplished with a pretty simple algorithm:
- Go straight unless sensors are blocked
- If one sensor is blocked, turn away from it
- If both are blocked, turn towards the farthest
- Turn until both sensors are free
- Continue going straight
There is a lot of room for improvement here (obviously), but this was a very quick project.
Results
Check out a couple of videos. Here we see the robot’s path as it drives around the area.
Demo
Download the demo and run “>>setup.m” Please feel free to make improvements to this. If you do, let me know!


Top Commenters