Thursday, 11 December 2014

Internship week 7

The seventh week of my internship here at NUS

I begin the software designing part for my product. What i had to do was to find some way to communicate between the arduino IDE and the Unity 3D application so that icould move a virtual object by moving my product.

The first few days i researched on the various ways to do so. Getting different codes from online sources such as Github and even the Arduino forum so that i could print raw data out from my MPU 9150 such as accelerometer, gyroscope and magnetometer data so that i could use it for further development and coding into the Unity 3D. I found out some things was not as simple as it seems as the user may be using a certain version or a certain library which was available at the moment thus for you to be able to get the same results, you would have to download all the separate libraries. I ended up with a whole lot of different libraries from various users on Github. Slowly but eventually, i found the right code to be able to print the raw datas.

i then carried on researching for the way unity 3D reads the information provided and found out that there were many methods but however transferring data serially was the best option forward as the information tend to be the most reliable as compared to sending it over the air via Bluetooth. I then started to research on how to compile a code which was able to fit my application. I was totally clueless as i really did not know how to start. Fortunately, there was an undergraduate which was also helping my supervisor at the same time and he was from the faculty of computer programming in NUS. M supervisor told me to work with him to come out with a code so that i could get the desired effect. His help was greatly appreciated i could finally get a start on the programming. By using simple equations we could calculate the roll, pitch and yaw which were values used to calculate the rotation of the object.

However after finally getting it to work, we found out that there was something wrong with the code such that when we tilt the MPU 9150 to the left and right, it would give different variation on the Unity 3D image. Also the image were quite unstable as the raw data keep changing irregularly. We then proceeded to solve the problem in the code. I found that there were errors in the code he used and we edited that specific line to get all the orientations working in the right directions. The other problem had to pushed to next week as he would only come to the office on Wednesdays and Thursdays.

This sums up my week at NUS as the coding really spend up a lot of my time, from researching on the different algorithms to troubleshooting the code so that it is accurate. It was also a new learning experience for me as we had very little exposure to cross platforms programming such as from Arduino to Unity 3D in our DEB modules. I dod not touch much of the hardware portion as i was kept busy in the office the whole week.

Slowly but steadily, the end product and its application is taking shape. This really encourages me to carry on to work hard so that the product would be a success.

No comments:

Post a Comment