Intro to Robotics: Anki Vector SDK

One major plus about owning a Vector robot, despite the Anki shutdown, is utilizing the SDK that was released. With the SDK for Vector, you can take full control of your robot.

Something to keep in mind when doing this and sharing your experience is to ensure your own robot name and information (serial info, etc) is kept private, or else others can login. Luckily, there are a lot of credentials needed to log into the SDK with your Vector, so breaches should be rare.

I decided to start with the “remote control” application (found in the apps directory of the SDK files). This app lets you take control of your Vector without needing to write your own code.

For me, I was eager to utilize the ability to make Vector say any written text. Throughout the day I had reached some walls with getting the remote control app to work. Finally, I took a break to reset. At first, I thought that there was a PIP installation issue because of the error message I was receiving. Finally, I asked my husband over to help. As I was going deeper into the directories through the terminal (from memory!) my husband was impressed with what I managed to learn, which made me feel good about myself despite the setbacks. Then, ironically, while trying to explain to my husband the error message, I had detected the issue and fixed it!

What had happened was that I added a line of code for a PIP enum34 installation earlier, but I thought I deleted that version. Turns out the file was saved with my (incorrect) line of code. Once I removed that line of code (with my husband confused as to what I was doing) I retried the steps and voila! It worked!

My husband (who is a level 3 software support engineer) laughed at me because he said he saw this happen often at work–how the solution is usually simple and overlooked.

Funny enough, I didn’t start off today with the specific goal of accomplishing the SDK setup. I had a much smaller goal in mind, which was “do as much as you can, even if it doesn’t work.” My major downfall tends to be overly-focusing on the destination / end result, and sometimes missing out on the journey. Today I tried to go against that and truly just enjoy each step, regardless of the outcome. It started with watching a YouTube video on the SDK setup and remote control app as my toddler was falling asleep in my lap with her bottle of milk. I’ve been having my own health issues lately, so I was trying hard not to overly stress myself as I navigated through the day.

Today was a great reminder that it doesn’t just matter what you accomplish, but how you get there. I much preferred today’s more relaxed attitude and pleasant surprise over my past overly-stressed and result-focused approach. Sometimes focusing so much on the result can make you overlook important details needed to get there. By allowing myself to take as much time as I needed to set this up and troubleshoot the errors, the quicker I ended up being at identifying the problem. Oh, the irony of life! Got to love it!

Errno 121 – The Error Code that Haunts Me

This is an update from my previous post about the live update project with the Raspberry Pi and LCD screen. Since that post, I’ve spent hours free-falling down the rabbit hole of troubleshooting.

Here’s what happened. Turns out the LCD screen I have has an adapter already soldered onto it (which most instructional websites have the type that requires you to solder yourself) and only requires four pins / wires instead of the usual sixteen. That may sound as if this would be easier since soldering comes with risks for those who are new at it, but alas, it is not!

Finally, I was getting close. I hooked up the Raspberry Pi to a monitor and began inputting the code. Like I said, I’m new at this, so although I was able to follow the steps (and at this point, memorize half of them) I still need to do some digging later on to understand why I was following those steps.

I enabled the i2c using the raspi-config, installed smbus and the i2c python library, tested and re-tested the hardware with sudo i2cdetect -y 1 and did a bunch of updates and reboots, amongst other steps.

Little by little, some steps that hadn’t worked previously were . actually working, which showed some promise. However, no matter the steps taken and those that passed onto the next step, I was continuously met with the same exact error code:

Eventually, I had to use some lifelines. I asked a friend. Okay, I asked many friends because one was a real human who I actually know (who I am eternally grateful for!), and the other was the internet (aka Reddit). Although it wasn’t my original goal to set up remote capabilities as part of this project, it was a positive outcome that was necessary regardless! My friend had remotely logged into my Raspberry Pi to see if he could figure out the issue. Alas, the night ended with everyone stumped, and we decided to take a break and re-group.

Intuitively, I think that the issue is something small I am missing, perhaps something with the way the site-package files are being read on my Raspberry Pi, that I’m unable to see. Or, something with the “__init__” part, but I’ll need to do some more reading on this particular type of error message. Or, perhaps I need to edit some lines in that file path? Hmm.

Even though I have not yet had the “payoff” of seeing the text display onto the LCD screen, I have already learned so much through troubleshooting this project.

Most importantly, I take this as an important test and “rite of passage” for my journey into the programming world; error messages will happen, so I better get used to it (and love the process of fixing them) if I want to succeed and continue to grow in this field.

After years of undergraduate, graduate school, and working full-time, I’ve learned that (for myself, at least) mental breaks are needed in order to re-approach a challenge. Today, I’m going to let everything that happened yesterday and the night before sink in. I’ve also come to accept that my most-likely route will involve me disconnecting everything and starting fresh, from the beginning.

It’s funny how this reminds me a lot of my creative work; when my novel or short-story draft reached it’s own “dead end” (creative error code?) I did the same thing: learn from it, and start over.

This is probably why my husband says I’m the right type of detailed-oriented and determined (translation: obsessive and a little crazy) for this field.

I’m used to spending hundreds of hours on a writing project, just to find out that something in its approach is fundamentally wrong and needs to be reworked. So instead of that deterring me, I’m actually very used to it. For example, I’ve spent the past three years in graduate school re-writing one novel, from different perspectives. I must have written at least a thousand pages by now between drafts and re-writes. That does not include the amount of drafts I have written since high school, during undergrad and afterwards of other writing projects.

With that being said, as I let yesterday’s lessons absorb into my mind, I’ll be flexing the other side of my brain today by writing my new thesis draft #9682967, but who can keep count? (Maybe I’ll make that into a program one day: a draft counter that will tell me exactly how many pages I’ve written between all of my combined documents).

Lastly, it has been really nice to engage with the community more through online sources. It’s been intimidating to “expose myself” as such a new beginner, and I definitely feel the fear of asking a dumb question, but I know it’s an important step regardless. Virtual hugs to all those who have commented on my questions with thoughtful responses! And, it was fun for me to see that I could actually hold up a conversation with people and utilize some of the new terms I’m learning.

I definitely went to sleep last night with error codes floating around my brain, but I’m happy to have woken up excited to try again!

Introduction To Computers – “Code” by Charles Petzold

BACKSTORY & WHY THIS BOOK IS SPECIAL

The book Code is wonderfully unique, and for that, Charles Petzold will forever be one of my heroes. Thank you, sir Charles (if you ever happen to read this) for thinking the way you do and for having been determined enough to write this book.

For those of you who are already entrenched in the industry and know this book, you may think I’m crazy for having started with this choice as an introduction to the technological realm. But, I must say, Charles Petzold’s book Code is my favorite not just for helping me with this learning journey, but because of the writing style and unique approach taken.

As mentioned in his preface to the paperback edition (which must be read, by the way) Petzold’s book takes a completely different approach than others because his main goal is to teach his reader how computers work from a granular perspective.

If you’ve read my very first “origin” post, then it should be noted that I picked up this book after I had already briefly dipped my toes into the programming world. I had known about Python, and a general understanding of computers, but nothing too in-depth. I had walked into the new Amazon Book store near the Empire State Building in Midtown, New York City, where I saw, sitting pretty on a tan shelf, the white and simple cover of Code. What drew me to the book (admittedly) was the cover because I recognized the braille and binary used underneath the title lettering. Immediately, I could tell that this book was special because it was making the connection between language and code, and connections like that are exactly what excite me.

As I continued to read Code, I felt like a bit of an imposter who was pretending to understand everything they were reading. Petzold includes many diagrams and visuals to accompany his examples. His examples tend to build upon each other, with many pointing to parallelism, so that way you develop an “all-encompassing” concept of code, as a whole. Most of it made sense, especially because of the wonderful way that Petzold is able to introduce his subject, zoom in, and then zoom back out at the end of the chapter to help draw together all of the concepts. Since I was a complete novice, as I continued to view the various charts and diagrams, some of the terms and ideas were beginning to feel unreal. Was I really grasping these concepts? Did these diagrams and new words really make sense to me or was I just lying to myself? Regardless, I continued to read. I made it a point to continue to read the book, even if I thought the concepts weren’t clicking for me yet.

Finally, I had completed my first read-through of the book. As time passed, I hoped that the concepts Petzold explained and how he explained them would stick in my mind, and I eagerly waited for the day when I would have proof that they did.

HOW THIS BOOK HELPED ME UNDERSTAND FUNDAMENTAL CONCEPTS

I was gifted my first Raspberry Pi from a good friend. As I opened up the beginner’s kit and looked at all of the components, I was overcome with an odd sensation of confusion and understanding. Although I had never seen these parts before in person, I had an idea of their uses and functions. It was in these moments of assembling the Raspberry Pi when I realized that Petzold’s words and diagrams had clicked, because as I connected each piece I could recall familiar sections from the book.

Simply put, reading Petzold’s way of explaining this subject has not only helped me with my approach to computers and programming, but it has helped me intrinsically understand how basic things work, from my automated Glade Air Freshener dispenser, to the phenomenon as to why my light switches invert themselves sometimes.

I had a good feeling when I chose Code as my very first introduction to this subject, and I’m so excited to re-read it again in the future. Already through my Python studying, I find myself recalling sections from Code with a smile on my face. I’m very grateful to have begun my journey with such a wonderfully insightful perspective on this subject, and I’m sure Code will be a book that I continuously revisit and recommend. However, the largest take-away from reading Code for me was witnessing how wonderfully an expert can perceive, understand, and explain a subject by drawing connections to so many different real-life and historical examples. This book is a wonderful look inside the mind of a true technical virtuoso.