Programming a Pi to Deter Cats: Part 5

Good Morning from my Robotics Lab! This is Shadow_8472, and I feel good about my progress this week. Let’s get Started!

Last week, I had successfully confirmed OpenCV was installed on my Raspberry Pi. The first thing to do this week was to start coding just as soon as I figure out a way to save a program file within the virtual environment, right?

Not quite. I thought a virtual environment was kind of like a virtual machine, where it has a whole little computer running within your computer, only with a few less restrictions. I still think that, but it turns out it works just fine if I run a file within the virtual environment from the Desktop or anywhere else.

I also learned exactly what a bash script is. So, I had OpenCV working in a script, and I changed permissions so I could run a .py file from the command line, but when i went to run it, I got an error about import not being supported. It turns out I forgot to run the Python interpreter with my program as an argument. That detail got me into the workshop I sometimes mention.

I actually got my base coding test harness from the YouTube Channel CodingEntrepreneurs. (Link to their first OpenCV Python video) While I was at the workshop, I learned a bunch of tangential stuff like when to pack your Python power cord, I polished off my knowledge on how to make sure a substitute power supply is acceptable, and when it’s a good idea to go back to the tutorial instead of arbitrarily placing a missing closing parenthesis.

In the end, I feel like I had a very successful session, but since then I’ve been building a framework for my program as a whole. Hopefully, by next week, I will have a program that will look at a series of pictures, tell if the background in each of three zones (cupboard, counters, and cabinets) is occluded (blocked) by a moving object (a cat or human), and sound the alarm if it sees something in the counters’ zone. As a bonus, it can save a picture of the culprit for if/when I try my coding skills at training a neural net to tell if my cat is being naughty.

Final Question: When was the last time you caught yourself considering over complicating a plan?

Programming a Pi to Deter Cats: Part 4

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I have a small, but important step completed. Let’s get started!

The tutorial I’ve been following gave me a hiccup after compilation. I had a passing difficulty when the commands I was copying used A different version number for an ls command.

Other than that, I had a little drama copying some expected output as a command, and when I did get the correct version number and file name in the command, there were a mismatch witha number or two. I figured it was just because of the version.

In the end, the tutorial had me test everything by running Python in the virtual environment, import OpenCV, and have it report its version. I was so relieved when it gave something back that didn’t resemble an error.

Going forward, I think the next, big milestone needs to be turning on an external light when it sees my cat in the frame. Setting this goal opens up a slew of smaller goals: connecting an LED to the external pins; learning and implementing basic elements in the OpenCV API; setting up such a program to run from either a single command, an icon, or bootup.

After that, it I should probably set it up as a VNC server and place it in its rightful position where it can start learning the difference between naughty cat on the counter and hungry human in the kitchen.

This project feels like it’s gone on ar least ten times longer than I expected. It’s good to have a small victory for once.

Final question: How do you keep track of progress in long projects?

Programming a Pi to Deter Cats: Part 3

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am finally installing OpenCV on my Raspberry Pi. And if I have a little more time, I may even try getting a Hello World type program running with it; it’s unlikely though. Let’s Get Started!

Last time I actually made any progress, I finished with making a virtual environment, meaning anything that happens in the sandbox stays in the sandbox, and I won’t have to rebuild the whole computer if things go nuclear. I think. The tutorial LINK wasn’t very informative, but it was fairly instant while making it clear it was technically an optional step.

The next couple steps are fuzzy in my memory. I don’t remember everything in chronological order. I kept running into errors, but I was gently pushed in the direction of trying to learn about them when I was in the local workshop (I was sure to bring a keyboard and mouse that weren’t at odds with my Pi).

My first major roadblock was when I was setting up to compile. I was sent off to research ‘cmake,’ a command line program being used in that stem. I ended up on a page with a lot of text, and I’m an audio learner. I don’t remember much of what was going on, but I recognized enough to say I was only about 95% lost as to what was going on when it came down to fine details, like the options being used for each argument in the command.

For some reason, it didn’t work, and I left stressed over it. If there’s one thing that is just an infinitesimal less frustrating than something not working when everything you know says it should work, it’s something working when everything you know says it shouldn’t work, and you’re trying to reproduce the problem so you can fix it. That happened to me. I set up for compilation, and I ran it. Ten minutes into the expected hour-plus operation at home, it crashed. There was some library it couldn’t find based on the pregenerated header, but I only figured that out when I went back into the workshop for a second time.

Round two this week was more of the same, possibly leading to events jumping sessions in my mind, but the second one was felt a lot more productive. I found the cause of the source of the problem, and I also worked on another, unrelated topic I want to save for another time.

Bonus Topic: I’ve complained a few times about how Windows sometimes is like, “By the way, we are updating your computer in 10 minutes, is that okay?” I find that highly frustrating. It popped up two or three Friday nights ago (after Sabbath started, so I didn’t want to do a whole topic about it). My father and I finally found the settings to supposedly require human input to permit an update.

Final Question: How much do you usually know about the commands you use?

Programming a Pi to Deter Cats: Part 2.01 (Robot Ethics Monologue)

Good Morning from my Robotics Lab! This is Shadow_8472, and I don’t feel like I have much progress this week. Let’s get Started!

I continued with the tutorial I started last week, and kept running into walls. I wanted a Hello World program up and running to show for this week’s post, but that simply isn’t happening unless I don’t generate enough text and brute force it within the next couple hours.

I suppose I could try sorting out my feelings about robot cruelty instead.

Several years ago, I did a paper about future mistreatment of robots. The gist was basically since animal abuse is strongly tied to human abuse, and the brain handles some robots more like people than even animals, there should be some form of legal protection for lifelike robots by the time they come into common use. Robots themselves might not need the protection, but people around would-be robot users would benefit from fewer abusers.

On the other hand, now that I know a little more about the prototyping process, I now know that a little more care would need to go into defining “abuse” lest the industry suffer.

I recently listened to a story where one of the characters was discovered to be a robot after a set of shelves fell on and damaged a limb. When her older sister questioned their parents, they said they found her in a dumpster, and didn’t show any sign of knowing she was artificial.

In the above story, there could be any number of reasons a lifelike robot could end up in a dumpster. She could have ended up there as an abandoned prototype, or even for having anomalous code that produced true emotions in a line of worker robots and someone smuggled her out instead of secretly destroying or reprogramming her. Or, she simply could have outlived her usefulness to her previous owner and they wiped her memory as they abandoned her.

In pretty much any case, under today’s laws, robots are treated like stuff, though social pressure has forced robotics company Boston Dynamics to stop showing footage of debugging their robots’ balance programs.

Where then, should the line be drawn, if it should even be drawn? The strongest opposing argument would be for the people who could stop at abusing robots so they don’t go on to people and buy legal victims who can easily have the memory erased. And without going off on a long sting of research, I don’t think I could answer which way would lead to fewer living victims.

For me, if asked to draw the line right now, I’d go easy on “abuse” cases performed in a professional context, as well as robots not designed or modified to relate as an artificial person. Digital assistants are a bit fuzzy here. They are often bound as part of modern operating systems, though I try to limit their scope for privacy concerns, thereby “neglecting” them.

Final Question: Should there be any laws against mistreatment of robots, and if so, how would you weave such a law so it stops the potentially harmful stuff while permitting ethical ore even necessary forms of “abuse”?