LeJOS Robotics

As an extension of our continued learning of Java and Object-Oriented concepts being put into practice, I opted to take a module in Robotics. In this course, we learnt about various maze solving algorithms, accurate control methods and localisation. These concepts all came together when we were tasked with making a robot with a goal of our own choosing.

There were a variety of ideas being played around with, from a robot that dances in response to the beat of whatever music is being played at the time
…to one that just thinks it’s a dog:

ezgif.com-cropezgif.com-optimize

However, in the end, we decided on a ball sorting robot, which would operate within a cardboard arena, surrounded by balls of two different colours. The robot then proceeds to roam around the area and, once confronted with a ball, will grab ahold of it and identify its colour with a light sensor on the front of claws. Once the colour is decided, the robot then rotates until a QR code is found, whereupon a small android phone placed in a caddy in the body of the robot scans the QR code and sends the result to the leJOS brick.

ezgif.com-gif-maker (slow)If the QR code matches the colour of the ball the robot has in its grasp, the robot will then proceed towards that side of the arena. Alternatively, this will signify that the correct area to deposit the ball is 180° behind the robot, and as such, the robot will turn accordingly. Either way, once the robot reaches its destination, the ball is deposited and the search for more balls continues.

While the parallels between robotics programming and games programming are not immediately clear, I would argue that the method in which a lot of the systems within the LeJOS library interact, is actually surprisingly similar to the systems in place and their interactions in games.
I would also say that programming in the LeJOS firmware taught me a lot about the challenges of concurrency, lessons that I am still learning, even today. But crucially, I think robotics, at least in the context of this module, is all about the process of turning code on a screen into something practical, observable and entertaining. This translates directly into my passion for games development and was very likely the main reason I found such an interest in this module.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s