WU CHENXIAO

Executive summary/Abstract

In this one month WOW! Attachment Programme, our group SCEI001 had the honour of being assigned to Agency for Science, Technology and Research (A*STAR), Science and Engineering Institute (SCEI). During our attachment, we first started by preparing for a short presentation on the history of interactive entertainment robots and the significance of game in human history. We showcased how entertainment robots evolved throughout the years and linking them to the development of programming, and presented some of the possible game ideas to our external mentor so that we can decide which one we would take on as a project to programme it into a actual interactive game with robotic arm. Throughout the attachment, we continuously researched and learned new programming knowledge that we can apply in our project.

We have attended one talk during our attachment. The talk was conducted by Professor Luo Jian Xi, an Associated Professor of Engineering Product Development and Program Director for SUTD Technology Entrepreneurship Program (STEP), targeted toward every researcher in the office. Through sharing his personal experience in Tsinghua University and Massachusetts Institute of Technology, Professor Luo showcased multiple ways one can create new ideas.

Our experience in A*STAR Lab was a truly incredible one, as I had never expected myself to gain full access to a fully functional robotic arm, and experiment with it. To be able to attach to A*STAR Lab was an eye-opener as I was able to gain insights of how a research centre operates and observe the work of these researchers. It completely changed my perspective of programming.

Background information of the projects / tasks which I was involved in.

For our project, we were tasked to investigate the use of robots for entertainment in interactive settings such as board games and interactive drawing. We were be given the opportunity to learn how to work with an actual robot arm, and will be responsible for planning and implementing a simple interactive game using the robot arm. Our final project will be in the form of a poster and a video.

Elaboration / record of the activities done

Before starting on our actual project, we first looked through the game ideas that we came up with during our discussion on the first day. It was decided that claw machine program will be our main project, and if given any free time left, we will program an interactive connect 4 game. With the topic of our project confirmed, we started our work. Throughout week one, we spent nearly all of our time into studying basic python knowledges, OpenCV and the manual control of Universal Robot(UR). Given that the last time we have learnt about python was 3 years ago, revise of these python knowledges was essential for our project to progress. We would require strong understanding of the basics in order to study the more advanced function that would be used in our code, for example, like those in urx. Urx is a library to control UR robots. This library will allow us to access functions that can operate the robotic arm, and move it to designated location. On the other hand, OpenCV is an open source computer vision and machine learning software library. However, OpenCV only comes in handy in Connect 4 programming, which is not our Primary Project. Thus, we did not make insightful research into OpenCV.

On the second week, we decided to temporarily group up with SCEI002 to experiment with the movement of the robotic arm by importing the urx library. We switch the robotic arm to free drive mode, so that the change of value that indicate the change in location of the robotic arm can be observed. In the end, we are able to come up with a simple joystick code that allow us to rotate the robotic arm by its base joint. On the same week, we are able to develop connect 4 game that is playable on python. It consist of a game rule system that will drop the pieces to where the player select and a minimax algorithm system, which simulate a computer player using a point system. We were able to control the depth of moves the system predict, but only limited to a max depth of 5 move due to the reason that any further increase in depth of moves prediction will cause our laptop to crash. Nevertheless, through our testing, we have proven that the AI is practically unbeatable.

On the third week, we realised that the connect 4 project has to be stopped as we are unable to obtain an actual connect 4 board. In the end, we decide to start with our actual claw machine code. In our first prototype, we used a function from urx known as movel(). This function is different from the movej() function we have used in our experimenting process in week two. Instead of representing the position of the robotic arm with the angle of rotation of the joint, movel() function represent position using x, y and z. By increasing these values, the robotic arm will move exactly in the south-west, north-west direction and vertically up correspondingly. However, we did faced a problem in our code which was the jittering motion of the robotic arm. This problem was resolved by the following week.

On our last week, we decided to seek help from our external mentors. After some research, our mentors suggested a solution to our current problem, and it was to use a built in python library known as msvcrt. This library contains keyboard functions that allow our code to detect whether a key on the key board is being pressed and automatically identify that key without pressing ‘Enter’. This allowed us to execute the code as many as the times the corresponding keys are recognized when we pressed them down, thus allowing the robotic arm to move smoothly. From there, we modified the code by specifying that when space bar is pressed, the robotic arm will lower itself and grab the toy and then come back up. After this code is executed, the robotic arm will be programmed to move to the ‘drop point’, where the robotic arm will release any soft toy caught by it. The only problem we have left is that the robotic arm does not stop moving when we stop holding the keys. On the last day of our attachment, as we made our final modification to the code so that the robotic arm brakes the moment the key is released, we came to the end of WOW. It was a bit disappointing that we didn’t completed the connect 4 project due to time constrains.

Elaboration / record of results / deliverables / impact of work done

Our final project consist of a poster and a video which showcase the research we’ve done throughout our attachment and display how our game code functions with the involvement of the robotic arm. In the video showcased how the robotic arm was managed to be controlled by one of our group member, moving forward, leftward, backward and rightward from his perspective when the corresponding keys “w, a, s, d” are pressed. When the space bar was pressed, the robotic arm lowered itself and closed its gripper in the pile of soft toys, and grabbed one of the soft toys. It then automatically proceeded to the ‘drop point’ where we have prepared a plastic bag below for the robotic arm to drop the soft toys it caught in it. The learning objective are to let us be introduced to control of robotic arm and the advanced knowledges of python. Through numerous researches, we had not only understood the reason behind how certain codes function, but to use the knowledge we had learnt to create an interactive robot game from scratch. Despite the fact that our final project still have existing flaws, I was contented that we were able to learn so much merely in one week of WOW attachment project.

3 content knowledge / skills learnt

1. I have learnt about the skill of creative thinking from Professor of SUTD, Mr. Jianxi Luo. During our attachment in A*STAR Lab, we attended his talk about the factors that lead to creativity. He shared with us his personal experience back in the day he was studying in Tsinghua University, when he was assigned to design an electrical battery powered bus. To tackle the problem of overheating which can lead to large energy lost, he researched into the field of aerospace engineering, and use the example of a rocket engine cooler as a guideline for his project, which eventually lead to success. Perhaps one of his most impactful words to us is that creativity is not just about coming up with a completely revolutionary idea, but instead using the knowledge from the previous generation, and from these knowledge birth our new ideas. His words were proven to be true as we discovered variety of ways programming can be applied to complete similar tasks, allowing us to complete the final project. As a self-proclaimed uncreative person, I was truly inspired by him to start thinking outside the field of my curriculum and seek into unknown field to come up with new ideas.

2. I have learnt how to code with python library Urx and OpenCV. Urx is a python library that contains built in functions that allow its user to control UR robot (in our case, the robotic arm) when imported. They can either control the robotic arm through rotating each joints or move the robotic arm across x, y, z axis base on the starting position of the robotic arm. On the other hand, OpenCV functions are mainly used to capture features in a video and to process images.

3. I have learnt about the difference between an AI and algorithm system. As the name suggest, an artificial intelligence is a simulation of human intelligence through programming, which involves in machine learning. In a game system, an AI usually start its learn process from square zero except following the existing game rule, but will become progressively better at the game. Algorithm, which is used in our project, is nothing like AI. Algorithms are usually systems that calculate the best possible outcome of a game. In our project, the algorithm we used is known as minimax. It reward the highest possible point with the best possible move on the board, and detect points for the respective move a human player make. Using addition and deduction, it calculate the best possible outcome, which simulate prediction of moves.

2 interesting aspects of your learning

1. During our attachment, one of the interesting aspect of our learning is that we did not receive any lesson from our mentors. Despite the fact that the requirement of this attachment stated that programming knowledge was not necessary, the external mentors had the expectation for us that we can take on the learning process of programming by ourselves. Thus, we ended up learning most of the knowledge from online tutorials, and only in desperate situations that we sought help from our mentors. This to me was a completely new learning experience.

2. Throughout my learning process, I was surprised to see how I developed to have interest in programming. From my prior experience in python 3 years ago, I felt that programming is extremely tedious to learn and lack interest in it. However, as I was learning about programming this time along with my fellow friends, we would sometime find online programming challenges to test our skills. These things motivated me to constantly seek for new knowledges, and stay interested in my project.

1 takeaway for life

My biggest take away from this WOW! attachment was to never stop seeking for new ways to solve a problem. In programming, a single problem is never limited to a single solution. Even until today, my WOW! teammates and I are still discussing ways we can modify our code to make it more efficient Every time we wrote down a code and relook at it again, we are able to find other ways to simplify our work. It is the challenges that we give ourselves and achievement we gained from each successful challenges that push us to learn more and enjoy our work.