Search This Blog

Monday 4 July 2016

The Story of RatedR - Before the beginning

Before I get started with the story, this is a fictional story of a robotics team, based on a real story. Any resemblance to actual persons, living or dead, or actual events is purely coincidental. I have the hope that you'll have fun reading the story. I will post Mondays a new part of the story.

Image source
It's seven o'clock in the morning, preparing myself for a new day of school. My school is not far away from my home so I take my time to drink the morning coffee and eat something as usual. This isn't just an ordinary day, it's the first time I will meet this new teacher. The class started, I'm sitting in first row and listing the teacher as he presents himself to the class. The teacher ends his own presentation, starts talking about technology, I'm excited by this subject, technology being my favourite, I start talking with him about it, telling him that I've worked with 3D software before and I also have some knowledge in programming (C++, Lua, PHP, etc). He was happy about it and invited me this weekend to his robotics group from school, I accept the invitation with no hesitation. I'm thinking how wonderful would it be to work with people with the same interests in technology as for myself.

The weekend has come, I'm going to the workshop to see what's all about. I meet few new people here that I will work with, I'm the only programmer from the team. It was shown to me this new software RobotC, which I will use for the robot we're making for FTC contest. I'm using C++ for the coding of the robot, just perfect as I started to learn C++ few months ago for a server mode in C&C Renegade. I try understand what is the propose of this robot in this contest, after I while I figure out and start writing the code. I get home and still continue writing code.

Weeks pasts, I write more and more code, more complex. The teacher tells me that it's too complex and might not work as expected, I don't listen, I trust my knowledge, I'm sure it's done all right.

It's the weekend of the contest, first day it's the testing day, we're coming to this place and setup everything up after travelling with a crazy taxi driver (I wish we took the subway). Doing some tests of my code, everything works as expected, I'm happy about my code, it appears I was right.
Image source (not the actual robot we've used)

The important day comes, we take the subway this time, hah, and get there just in time for the contest to start, actually just few rounds of testing, everything works. After a while, we're informed that the real round will start in few minutes, no worries, everything works. In this contest you have two phases, the autonomous phase were my code is ran to take some objects and put them somewhere and then get on the ramp and second phase being the control mode, where you have joysticks to control the robot and take other objects with the built-in crane from the robot. The round starts, it takes a while to connect to all robots, I'm there to supervise that everything works in the communication phase, they start the round and... surprise, my robot breaks. We get to the control mode with a broken robot and we stop, they'll continue the round without us.

More rounds, more trouble, the robot motors are breaking up, smoke coming from them, everything breaks up, nothing works as did in the testing phase.. what the hell. We start arguing on all things and of course my code, being way too complex, something might of gone wrong inside the core of my code. I'm mad and sad, I have no idea what to do to fix all things, nothing happen as I predicted, just more and more trouble. We've lost the contest in between the last, with a broken controller and motor. I was feeling like the black sheep of the team, being my code running and probably broken. We took the loss and continued on.

After a week or two, I started researching what was going on, what made my code to stop running, I was not sure. I'm reading trough the help manual of the RobotC software, after a while, and some maths, I discover that I was wrong in a part... a integer was too small to hold big numbers, like time in milliseconds, I never seen such a problem before, being a Lua programmer most of time, I never encountered such a problem, was something new, I was mad on myself, I've made such a small mistake that could've caused big trouble. I was supposed to use 'long' instead of 'int' in my code, if I was doing that, everything would've worked. To be even more sure that will work, I could've put a 'unsigned' before 'long', I didn't know that is possible.

With this mistake fixed, I told them about the mistake and I apologized for the mistake. I continued working with them.

..some months later..

The team got smaller, we're only two people in this team right now, me and Harley. Harley being the mechanic of the team, I'm the programmer, we try to make a great team together, with all the mistakes we make, we're learning from the mistakes every time and improve to get what we want from our work better.

I started to make a even more complex code, yeah.. you've heard it right. This time, with all the knowledge and readings I did, it will work as expected. I make a code that will record movement of the robots by using joystick and then play the recording. It works almost perfect in testing, of course. We get this code to a real test in a contest, but surprise as always.. it doesn't work well because Harley is nervous in front of a lot of people and we can't get the robot to do what it should do. We think that we'll lose as previously done, but we actually get fourth place, it could've been worse. A new contest, this time I have to present my code to the public, I do all my best to explain to the judges that It's really cool what I've made, did the most stupid example I could've done, telling them that this robot can bring you the coffee every morning after being programmed very easily, well.. for me that's a great thing, because I'm kinda lazy to even get that done in some mornings :-). I did get the max score.

-In the next part you'll see a brand new name for the team that will struggle to get known-

No comments:

Post a Comment