Code Your Own Twitch Chat Controls For Robots — Or Just About Anything Else!

Twitch Plays Pokemon burst onto the then nascent livestreaming scene back in 2014, letting Twitch viewers take command of a Game Boy emulator running Pokemon Red via simple chat commands. Since then, the same concept has been applied to everything under the sun. Other video games, installing Linux, and even trading on the New York Stock Exchange have all been gameified through Twitch chat.

TwitchPlaysPokemon started a craze in crowdsourced control of video games, robots, and just about everything else.

You, thirsty reader, are wondering how you can get a slice of this delicious action. Fear not, for with a bit of ramshackle code, you can let Twitch chat take over pretty much anything in, on, or around your computer.

It’s Just IRC

The great thing about Twitch chat is that it runs on vanilla IRC (Internet Relay Chat). The protocol has been around forever, and libraries exist to make interfacing easy. Just like the original streamer behind Twitch Plays Pokemon, we’re going to use Python because it’s great for fun little experiments like these. With that said, any language will do fine — just apply the same techniques in the relevant syntax.

SimpleTwitchCommander, as I’ve named it on Github, assumes some familiarity with basic Python programming. The code will allow you to take commands from chat in two ways. Commands from chat can be tabulated, and only the one with the most votes executed, or every single command can be acted on directly. Actually getting this code to control your robot, video game, or pet viper is up to you. What we’re doing here is interfacing with Twitch chat and pulling out commands so you can make it do whatever you like. With that said, for this example, we’ve set up the code to parse commands for a simple wheeled robot. Let’s dive in.

Continue reading “Code Your Own Twitch Chat Controls For Robots — Or Just About Anything Else!”

Field Guide To Shipping Containers

In the 1950s, trucking magnate Malcom McLean changed the world when he got frustrated enough with the speed of trucking and traffic to start a commercial shipping company in order to move goods up and down the eastern seaboard a little faster. Within ten years, containers were standardized, and the first international container ship set sail in 1966. The cargo? Whisky for the U.S. and guns for Europe. What was once a slow and unreliable method of moving all kinds of whatever in barrels, bags, and boxes became a streamlined operation — one that now moves millions of identical containers full of unfathomable miscellany each year.

When I started writing this, there was a container ship stuck in the Suez canal that had been blocking it for days. Just like that, a vital passage became completely clogged, halting the shipping schedule of everything from oil and weapons to ESP8266 boards and high-waist jeans. The incident really highlights the fragility of the whole intermodal system and makes us wonder if anything will change.

A rainbow of dry storage containers. Image via xChange

Setting the Standard

We are all used to seeing the standard shipping container that’s either a 10′, 20′, or 40′ long box made of steel or aluminum with doors on one end. These are by far the most common type, and are probably what come to mind whenever shipping containers are mentioned.

These are called dry storage containers, and per ISO container standards, they are all 8′ wide and 8′ 6″ tall. There are also ‘high cube’ containers that are a foot taller, but otherwise share the same dimensions. Many of these containers end up as some type of housing, either as stylish studios, post-disaster survivalist shelters, or construction site offices. As the pandemic wears on, they have become so much in demand that prices have surged in the last few months.

Although Malcom McLean did not invent container shipping, the strict containerization standards that followed in his wake prevent issues during stacking, shipping, and storing, and allow any container to be handled safely at any port in the world, or load onto any rail car with ease. Every bit of the container is standardized, from the dimensions to the way the container’s information is displayed on the end. At most, the difference between any two otherwise identical containers is the number, the paint job, and maybe a few millimeters in one dimension.

Standard as they may be, these containers don’t work for every type of cargo. There are quite a few more types of shipping containers out there that serve different needs. Let’s take a look at some of them, shall we?

Continue reading “Field Guide To Shipping Containers”

Death Of The Turing Test In An Age Of Successful AIs

IBM has come up with an automatic debating system called Project Debater that researches a topic, presents an argument, listens to a human rebuttal and formulates its own rebuttal. But does it pass the Turing test? Or does the Turing test matter anymore?

The Turing test was first introduced in 1950, often cited as year-one for AI research. It asks, “Can machines think?”. Today we’re more interested in machines that can intelligently make restaurant recommendations, drive our car along the tedious highway to and from work, or identify the surprising looking flower we just stumbled upon. These all fit the definition of AI as a machine that can perform a task normally requiring the intelligence of a human. Though as you’ll see below, Turing’s test wasn’t even for intelligence or even for thinking, but rather to determine a test subject’s sex.

Continue reading “Death Of The Turing Test In An Age Of Successful AIs”

AI Upscaling And The Future Of Content Delivery

The rumor mill has recently been buzzing about Nintendo’s plans to introduce a new version of their extremely popular Switch console in time for the holidays. A faster CPU, more RAM, and an improved OLED display are all pretty much a given, as you’d expect for a mid-generation refresh. Those upgraded specifications will almost certainly come with an inflated price tag as well, but given the incredible demand for the current Switch, a $50 or even $100 bump is unlikely to dissuade many prospective buyers.

But according to a report from Bloomberg, the new Switch might have a bit more going on under the hood than you’d expect from the technologically conservative Nintendo. Their sources claim the new system will utilize an NVIDIA chipset capable of Deep Learning Super Sampling (DLSS), a feature which is currently only available on high-end GeForce RTX 20 and GeForce RTX 30 series GPUs. The technology, which has already been employed by several notable PC games over the last few years, uses machine learning to upscale rendered images in real-time. So rather than tasking the GPU with producing a native 4K image, the engine can render the game at a lower resolution and have DLSS make up the difference.

The current model Nintendo Switch

The implications of this technology, especially on computationally limited devices, is immense. For the Switch, which doubles as a battery powered handheld when removed from its dock, the use of DLSS could allow it to produce visuals similar to the far larger and more expensive Xbox and PlayStation systems it’s in competition with. If Nintendo and NVIDIA can prove DLSS to be viable on something as small as the Switch, we’ll likely see the technology come to future smartphones and tablets to make up for their relatively limited GPUs.

But why stop there? If artificial intelligence systems like DLSS can scale up a video game, it stands to reason the same techniques could be applied to other forms of content. Rather than saturating your Internet connection with a 16K video stream, will TVs of the future simply make the best of what they have using a machine learning algorithm trained on popular shows and movies?

Continue reading “AI Upscaling And The Future Of Content Delivery”

Hackaday Forced Into Light Mode

Hackaday has always been dark mode. Gray10 is less jarring when you’re burning the midnight oil on a project, so we give you a lot of it. Fifteen years ago, it was called “reverse video” or “trog mode“, and we were the freaks. We were doing it wrong. We had the colors “backwards”. Dark mode used to be edgy, outré, but dare we say it, a bit sexy.

Hackaday … QuickBooks. Just sayin’.
They even ripped our highlight yellow!

Flash forward, and everyone has come over to the dark side. Facebook has a dark mode. Google has dark mode. Across the Microsoft empire, from Windows 10 to GitHub, you can live your life in the dark. Heck, even the White House has a dark mode! (They call it high-contrast mode, but they’re not fooling anyone.)

Dark mode here, dark mode there. It’s mainstream. Dark mode has become corporate cool which is nobody’s idea of cool.

We’re not saying that all of the aforementioned institutions are biting the Hackaday style, but, well, they’re all biting our style. Where were they when we were the only website on the whole darn Internet with a sensible background color? Huh? Dark-mode-come-latelys!

But Hackaday doesn’t rest on its laurels. We have our fingers on the pulse on the modern hacker. Where previously you would be up late at night researching Hackaday for juicy nuggets of communal wisdom to help out with your current hack, you’re probably “telecommuting” these days — a euphemism for working on your private projects even while the fiery ball is still in the sky. (Wink, wink, nudge, nudge.) It’s only natural that you’d want a lighter background color to match your new lifestyle. We hear you!

So we present you, Hackaday Light Mode™. Enjoy!

[Editor’s note: For historical accuracy, we had phosphor green headings in the very beginning, in place of the jarring white. If you want to relive those glory days of yore, or just to go back to Hackaday in dark mode, there’s always CSS scripting.]

The Difference Between 4WD And AWD

Car manufacturers will often tout a vehicle’s features to appeal to the market, and this often leads to advertisements featuring a cacophony of acronyms and buzzwords to dazzle and confuse the prospective buyer. This can be particularly obvious when looking at drivelines. The terms four-wheel drive, all-wheel drive, and full-time and part-time are bandied about, but what do they actually mean? Are they all the same, meaning all wheels are driven or is there more to it? Let’s dive into the technology and find out.

Part-Time 4WD

Part-time four-wheel drive is the simplest system, most commonly found on older off-road vehicles like Jeeps, Land Cruisers and Land Rovers up to the early 1990s, as well as pickup trucks and other heavy duty applications. In these vehicles, the engine sends its power to a transfer case, which sends an equal amount of torque to the front and rear differentials, and essentially ties their input shafts together. This is good for slippery off-road situations, as some torque is provided to both axles at all times. However, this system has the drawback that it can’t be driven in four-wheel drive mode at all times. With the front and rear differentials rotating together, any difference in rotational speed between the front and rear wheels — such as from turning a corner or uneven tyre wear — would cause a problem. The drive shaft going to one differential would want to turn further than the other, a problem known as wind-up.

Continue reading “The Difference Between 4WD And AWD”

The $50 Ham: WSPR-ing Around The World

Everybody has a bucket list,  things to be accomplished before the day we eventually wake up on the wrong side of the grass. Many bucket-list items are far more aspirational than realistic; very few of us with “A trip to space” on our lists are going to live to see that fulfilled. And even the more realistic goals, like the trip to Antarctica that’s been on my list for ages, become less and less likely as your life circumstances change — my wife hates the cold.

Luckily, instead of going to Antarctica by myself — and really, what fun would that be? — I’ve recently been getting some of the satisfaction of world travel through amateur radio. The last installment of “The $50 Ham” highlighted weak-signal digital modes using WSJT-X; in that article, I mentioned a little about the Weak Signal Propagation Reporter, or WSPR. It’s that mode that let me test what’s possible with very low-power transmissions, and allowed me to virtually visit six continents including Antarctica and Sweden-by-way-of-Alaska.

Continue reading “The $50 Ham: WSPR-ing Around The World”