Dev_Log[1]
Overview
The week that just went by was awesome. There’s not much to put into the overview section this time, so I’ll just list the themes I’m covering in this week’s Dev Log.
- Progress in Araannea
- A Session on Kivy I held
- Starting to Learn TensorFlow.
Progress: Araannea
One of the most significant updates of last week was getting our robot to stand and walk around (in the loosest definition of the term).
And we continued to work with that momentum
Last week, the top and bottom half of the main box was held together purely by the legs. Since that wasn’t ideal, we printed out braces to put on each side of the box.
Speaking about the code, we did the simplest and dumbest code possible. After studying the motion from demonstration videos, and working out the constraints of the motors, we literally hardcoded every angle rotation.
We’re working on making the code modular and more extensible bit by bit, but we’re coding in C, and since we’re not natively coding in C, that’s a jump we’ll take when we come to it 😨.
We coded out the basic walking forward motion, a push ups motion, and inadvertently, a rotation motion.
But, the motors were, to put it politely, garbage (yes that’s polite 😂). There is a severe quality control issue with servos, something I came across in other project articles and videos online too.
We purchased MG995R servos from Robu.in, rated for 10KG/cm at 6.8 volts the first time, and it came with plastic gears that wore out under their own weight within the first 5 tries.
We purchased MG995R servos from Amazon that specifically said they had metal gears, and only 6–8 out of 18 actually had metal gears.
8’s good right? We only need 8 servos for the quadruped version.
Turns out, it was 6 😂😢. (keep reading, 6 wasn’t the right answer either 😆)
So we finally decided to purchase 2 higher quality servos, from a company called Orange, and they just came in this Saturday. We’re going to test them on Monday, and fingers crossed, it allows us to complete the project within this week.
It’s basically the servos that manage the height of the robot that keeps busting out, and the Orange servos will be used here
If there is a significant difference between the 2 Servos from orange, and the MG995R servos, we’ll order two more, and make the total set of vertical servos the same.
This week, we plan on integrating the controller, and the final communication between the transmission and receiving.
MONDAY UPDATE: Once we got the new Orange Servos, the robot stood up properly! and it even did push-ups!
And as soon as we tried to make it walk, the older servos busted 😢.
We’re working on sourcing servos from more reliable sources or labs to get it done in time. Our deadline is the end of this week, so by the next Dev Log, we’ll know how it ends 🤞
Kivy Event.
This week, our club, Venn hosted a session, where I would be teaching Kivy with the help of a project I made.
The project was a Keyboard Sound effects program. The basic aim was to be able to press a key, (even outside of the window/terminal where I’m running the program) and an audio clip mapped to that specific key.
The idea behind this project was that I thought it would be really cool if I press enter after a long script, to make it run, and there’s a classic drum sound effect.
I made a simpler version of this program over a year ago, where I just basically had 0 customizations. If there was anything, I wanted to modify, it had to be done inside of the code.
So when the opportunity to teach Kivy in the session came up, I thought of it as the perfect opportunity to refresh this project.
I created two versions of this project
Version 1: Complexius Codificus
If you couldn't make it out from the Version title, this was the complex version. It had more features too, but the main reason that this wasn’t the final concept version was due to the fact this was around 200 lines of code, and since it covered multiple concepts at once, I came to the conclusion that it would be too much to cover under an hour.
The features this program had were:
- The ability to add new keys and effects and to over-write old ones from a window within the program itself.
- The ability to enable or disable the sound effects (sometimes I sat in class with this program running 😂)
- A window to view the current audio files mapped to the keys
- Multiple effects could be enabled at the same time.
Some of the tools/concepts I used in this program were:
- Storing information using JSON files
- Basic use of the Pynput library
- Use of pygame to play .mp3 files
- Kivy and the main principles of usage.
- Use of shutil to copy files
Version 2: Simpler
This was a version where there was a single window.
There was one dropdown that would list all the audio files within a single folder as options for sound effects
There was another dropdown from which you could choose which letter you wanted to map the audio effect.
There was a switch to enable and disable the sound effects
However, you could only enable a single effect at one time.
The limited sound effect choices and the single effect at times allowed me to completely do away with the JSON file writing and reading sections.
Human
So I was well prepared.
Yeah, but my mind was in multiple places simultaneously, and I got a little overconfident and carried away.
I’m generally very meticulous with such events and work-related stuff, but I wasn’t this time and let me explain how and why.
Kivy only runs on Python 3.10 and below. It won’t work for Python3.11
I developed Version 1 on my older Dell laptop, where I had conda and multiple interpreter versions set up. Since I was following the installation guide pretty well, I dealt with the version problem pretty easily.
I developed Version 2 on my borrowed Macbook Air, and since it’s got multiple interpreters by default, I was able to deal with the issue swiftly here too.
Due to a lot of laptop switching (I ended up presenting on my friend’s laptop cuz the Macbook didn’t have an HDMI port), I forgot about this and didn’t mention it as a pre-requisite.
And since most attendees just began programming, they all had the latest versions of Python, 3.11
Boom
We discovered this issue again, right in the middle of the session. And that meant that the attendees could not code along with me as I coded. But I couldn’t code either, since I was on my friend’s laptop, with 3.11!
I demonstrated the simplest version in the event, one with no GUI, even though the event was about making GUIs 😢.
It was very frustrating and I had no one to blame but myself and that’s what I did. However, within the hour, I took the lesson from it and was grateful that this didn’t happen in a more critical scenario.
It’s very difficult to disconnect from the emotions of a recent screw-up, to not bury yourself completely in that emotion, but I’m glad I have the ability to do that. This is not the end of making mistakes, I know I’ll make more for sure, but I’m glad that I’ll have to ability to assess the situation, keep a cool head, and if needed, fix it immediately. 🙂
Learning TensorFlow
One of the fields I’m very sure I’ll specialize in is ML and Deep Learning. Just to clarify, I had this intent even when blockchain was in hype 😦.
I know this year is the “Year of AI” and whatnot, but I had my intentions clear before ChatGPT came on the scene and the AI scene just exploded.
I’ve bagged my second internship in Deep Learning, and while I’ve done PyTorch pretty well, my manager said it would be good to know Keras too. I had already purchased a course last October for Tensorflow, and I realized now was the perfect time to start and complete it.
I purchased two courses at the same time, one for PyTorch, and one for TensorFlow both from Pierian Data
PyTorch Course: https://www.udemy.com/course/pytorch-for-deep-learning-with-python-bootcamp/
TensorFlow Course: https://www.udemy.com/course/complete-tensorflow-2-and-keras-deep-learning-bootcamp/
The course presented new theories in a very brief manner and jumped into directly implementing the concept using PyTorch.
I completed the PyTorch course within a week, but new concepts and code at the same time are not a good thing to do, and after I finished the course, I was just left in this odd spot where I had no idea how to use the course knowledge and did not look forward to doing the Tensorflow one.
Following that course, I got a scholarship from AWS for a Udacity Nanodegree titled AI Programming with Python. I would highly recommend this course to anyone who wants to jump into the field of AI. The course even teaches Python!!
It’s priced pretty high, but the worth of the course is undeniable. We had weekly connect sessions with a Mentor who monitored the progress of around 10–15 students at one time.
This course bridged the gap between the theory and maths behind Deep Learning (which is a lot!) and the implementation. It was the perfect sweet spot. The fact that the course focused on PyTorch too was an absolute boon for me.
The combination of the above two courses led to a significant increase in my knowledge level and confidence, and I’m sure that now continuing with the TensorFlow course and the Keras course would be pretty straightforward for me!
I’ve also started to read this book called “100 Pages of Machine Learning”, which is available on a “read first and buy later principle”. It’s a phenomenal book, and I would totally recommend it to anyone who wants to understand what they’re coding.
Conclusion
I’m pretty happy with the efforts I put in this week. I’ve come across a lot of things I want to learn eventually (due to a genuine curiosity), that includes Scalable Systems, System Design, the MERN Stack, Rust, and Golang. I have recognized the need to pace myself though. I’ve understood the importance of not rushing into too many things at once, and then struggling with maintaining that momentum for all the new things.
I’m also trying to add a little more personal opinion-based content on relevant matters to these articles, but I want to ensure that my perspective on things is not misunderstood or just arbitrary.
That’s it for this week! I look forward to doing this again!