C Programming Projects from ROB 502

The following are select projects that I completed individually for the ROB 502 Programming for Robotics course at the University of Michigan. The majority of this course used the C programming language. It is also worth noting that I scored a perfect 100% overall course grade for the class.

rasterize.PNG

Rasterize

In this project, I built the graphics framework for the robotics simulation that I used for later projects in this class using Microsoft bitmap images. These images were sent to an image server that allowed me to view the image in a web browser.

Some basic graphics features that I implemented for this project were drawing outlines, filling in, and rotating/translating polygons.

To the right is an image depicting a black bitmap image with a triangle translated and rotated in the bottom right of the bitmap image.

This video shows the implementation for the Braitenberg project. Note the output in the terminal which shows the position of the vertices of the robot before and after “rounding.” The rounding method used here was implemented to prevent pixel overlap when drawing the graphics. The terminal output also displays when a collision occurs between a lamp and the robot.

Braitenberg

In this problem I implemented and visualized a simple 2b type Braitenberg vehicle that had two light sensors, a left and right sensor. The more light received by the left sensor, the faster the right wheel of the vehicle turned. Similarly, the more light that the right sensor received, the faster the left wheel turned.

I placed three light sources on a map for a robot to interact with. I also incorporated collision detection code that detected whether the robot collided with the lamp and had the robot resolve the collisions accordingly by moving back half a pixel until there was no longer a collision.

Chase

In this project, I programed one robot (the "chaser") to chase after another robot (the "runner").

Both robots had the ability to perform one of the following actions per time step: 0) do nothing, 1) increase velocity, 2) increase angular velocity clockwise, 3) increase angular velocity counter clockwise (just the chaser).

The runner selected an action to perform at random. A recursive search tree was implemented for the chaser to help it determine the action that it should perform to catch the runner in the least amount of time steps.

This video shows an implementation for the Chase project. Note that one of the input parameters for the program is the starting location for the runner. This video shows how the chaser behaves when the runner is located at the bottom right of the map. The output in the terminal lists the action number that the chaser and runner performed at that time step.

This video shows an implementation of my Potential project where I change various parameters of the potential controller and initial runner index as the program runs. Note that the program restarts whenever the “chaser” (red) catches the “runner” (green). The program can also restart if the user presses “r,” and the program quits if the user presses “q.”

Potential

In this project, I used a potential field controller to replace the recursive search tree from the Chase project to determine the movements of my “chaser” robot.

Additionally, I created a command line user interface that allowed the user to live-tune the parameters of the potential field controller using threading.

Bigrams

In this project I created and used a hash table to find the most common bigrams (pairs of consecutive words) in a text file.

The implementation used for this project is very loosely based on/inspired by the Google Abseil (a C++ library) "Swiss Table" family of hash tables.

The image on the left shows the output where I called my bigrams program on a text file of Jane Austen’s Pride and Prejudice. The output in the terminal shows when I had to “rehash” my hash table—when I doubled my hash table size to help reduce the amount of collisions. The output also displays the bigrams that appear at least 200 times in the entire book as well as the total number of different bigrams in the book.

bigrams.PNG
Previous
Previous

Robotics Tutorial Video Series (Ongoing)

Next
Next

Implementing TAI on a Desktop 3D Printer using an Arduino Mega 2560