Lab 11 Bayes Filter Simulation (Real)

The goal of this lab was to use the update step of the Bayes Filter and Localize in real life.

Robot Issues

Unfortunately, in the process of trying to do this lab, I had many many issues eventually resulting in the retirement of my dear robot, Jombo. After overcoming initial bluetooth issues because of my operating system, in the process of testing my robot, something most likely happened to either the motors or the motor drivers that caused either too large a current draw or some kind of short in the system. I ended up burning through one Artemis' voltage regulator, and after replacing it and resoldering most of my component connections, I was still experiencing hard faults any time I ran code, even from old labs. I isolated each system one, and was able to see that the sensors still worked, but any time I would send a signal to my motors I would reach a hard fault and the board would heat up. Ultimately, it was determined that my robot's motors or the motor drivers had some kind of issue with them that was shorting the board, and rather than continue debugging I opted to use my lab 9 data to run my Bayes' filter. Before making a decision I also used a different spare robot in the lab. However, oscilloscope probing showed that while the input PWM signal was being recieved, there was no output. With no extra motor drivers in the lab, I have chosen to just work with a partner for Lab 12.

Implementation

My plan was to use essentially the same code as I did for mapping in Lab 9, but turning in 20 degree increments rather than 10. I would also, rather than sending all data points from each spot (I was collecting 5), average them all together on the Artemis side instead of the python side since the Bayes script was expecting 18 data points. The code for the python side that I was planning on using is shown below.

Results Using lab 9 Data

First, I ran the simulation as is to make sure it worked, and it did.

Sim Results

These are the results at each point using my (transformed and 'normalized' to the origin) data points

Bayes Algo Bayes Algo Bayes Algo Bayes Algo

The robot localized perfectly at all locations except for (5, 3) where it was off by about a foot in either direction. I think this is likely because the robot shifted off axis for that data set, however since my robot did not work, I was unable to collect more data.

Discussion

I found this lab pretty straightforward in theory. Basically all of the code for it was set up during Labs 9 and 10, so there was not much work to be done other then enable bluetooth communication while localizing. Honestly, I am just sad/annoyed that my robot broke considering how close to the end I was. I look forward, though, to trying to implement the Bayes filter and path planning for Lab 12 with a partner.