CE/CZ3004 Multi-disciplinary Design Project

30 October 2015

During my final day of internship at Healint, I described about the heaviness and difficulty of this module to my supervisor, Mr Nicolas. His response was:

It will be fun, but you won’t learn anything.

Hmmm, it’s near the end of MDP, actually it was fun. But do I learn anything? Not much. Most of what I poured into my codes are from what I already knew, and other small parts are just copy-pasted from Stack Overflow.

In our project, we put the “brain” into the Raspberry Pi and hence I SSH-ed to it to run the program. But I’m already quite familiar with SSH  since:

  • I’ve run programs over SSH at Wikimedia’s Tool Labs
  • I’ve deployed (and also debugged) Django website for my part-time work at LILY Research Center

Fun?

It was fun in discovering and fixing bugs.

It was fun that the Arduino team keep improving a lot.

It was terrible that during Week 11 challenge, our SD card on our RPi is spoilt and hence can’t mount the OS (Raspbian); and we need to set the program up on another SD card and we forgone our challenge attempt, and lots of hours used up for setting up this new SD card. This teaches a hard lesson that we need to shutdown the RPi properly before plugging the power out.

It was fun that, at one instance, we need to put this line of code at the beginning of the program:

monkey.patch_all()

No one knows why we need it, and unless we put it, our program will fail to run.

Lessons

What I indeed learn is that Python I/O (input/output) is blocking (unlike Node.js) and to “trick” it, every components that have I/O need to be threaded. And hence, the program need to be properly terminated, if not, there will be a dangling thread running in the background. Due to this project, now I really dislike blocking I/O :P

We learned lessons from failures. On week 8, we were panicked while setting up the robot (and since it was us who got the first turn to attempt), and as a result we failed to start. It was combination between instability of Bluetooth connection and also the input buffer from Bluetooth after it was connected. The start command was sent twice and two threads were spawned to issue commands to the robot (cause there is no check on whether the thread has been started or not).

Luck.

On Week 9 challenge, just before the challenge, our robot miserably failed the previous week’s maze. But during the challenge itself, luckily it was okay.

On Week 10 challenge, the exploration was impossible to perfect our score but luck comes for our fastest path challenge, we managed to reach 13 seconds and be the #1 in that leaderboard.

Update on 23 December 2015:

What happened in Week 12?

Even after lots of rigging & testing on the previous days, “something” occurred at the right place and saved us. But on another spot where we think that the robot won’t fail, the robot went out of alignment and failed the exploration since the robot failed to get back to the start zone. But just for fun (& with some luck), running the fastest path program, our robot can still reach the finish zone. People were impressed.

Concluding

Reflecting back, this module needed:

  • good leader, this is crucial for making sure the big team was well communicated and task were well done on time.
  • good thinker, for coding the Algorithm/RPi, also familiarity with Linux Terminal and Python I/O.
  • good hardware people, for the Arduino part
  • a lot of commitments and good luck. :)

5 comments

  1. Hi,

    Thanks for sharing your inputs on MDP!

    I am going to take MDP in the next year (i.e. the following semester) and was quite worried whether I have the expertise to contribute much to my team. I was from a JC and my experience in coding was solely just based on the school work from Year 1 to Year 2. In addition, I am also a Business and Computing student, so often, there wasn’t extra time for me to practice on my coding or broaden my knowledge in many aspects in computing.

    However, do you have any advice as to what I should read up or practice to prepare myself for this project?

    Thank you so much!

    1. Hi Kelsey!

      Assuming that the module is still the same, I believe that even if you have no expertise at all, this is a very good module to pick up the skills since you are put into such a challenge. I think, this project, will require the team to do many things, from writing code to run a Raspberry Pi, operating a Arduino, and writing an Android app. Personally, I’m not sure what one can do to prepare, I guess when the project start, there the team can discuss together each strength, weakness, and interest to decide together. To me, having a good team leader is very crucial in this project to make sure the team members are performing well. But in the end, I think one also need many many luck to perform well in the leaderboard.

      Regards,
      Kenrick

      1. I understand that this project is a good exposure for me to try out the more practical side of computing. However, I am quite concerned that time may not permit for me to finish my task as well as how I may struggle a lot during the semester where I have MDP. Hence, I was wondering if it is possible to read up on certain theories first, eg: Frameworks or like what you mentioned something about SSH.

        Thanks :D

        1. Hmm alright then, so in this project, I am exposed to the following stuffs:

          – writing a web server in Python (using Tornado library), implementing the real-time communication with WebSocket, and displaying the map with HTML canvas
          – Entering into a Raspberry Pi via SSH, running Linux commands there (if you haven’t use Linux terminal before, probably need to familiarize)
          – other than that, algorithm wise, it wasn’t that much of a concern (implemented A* search algorithm during the race phase; and left-wall hugging during exploration). Most of the frustrations here was to manage the inaccurate readings from the sensors.
          – The guys working on Arduino mention something about “PID algorithm” there, but I’m not really sure what it is really doing.

          You can try learn up some of the concepts. Hope ithelps. :)

          1. Thank you so much.

            I will definitely spend some time on these concepts whenever I am free.

            Best wishes!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.