Neural Networks Walk Better Than Humans For Game Animation

Modern day video games have come a long way from Mario the plumber hopping across the screen. Incredibly intricate environments of games today are part of the lure for new gamers and this experience is brought to life by the characters interacting with the scene. However the illusion of the virtual world is disrupted by unnatural movements of the figures in performing actions such as turning around suddenly or climbing a hill.

To remedy the abrupt movements, [Daniel Holden et. al] recently published a paper (PDF) and a video showing a method to greatly improve the real-time character control mechanism. The proposed system uses a neural network that has been trained using a large data set of walking, jumping and other sequences on various terrains. The key is breaking down the process of bipedal movement and its cyclic behaviour into a series of sub-steps or phases. Each phase translates to a natural posture for the character while moving. The system precomputes the next-phases offline to conserve computational resources at runtime. Then considering user control, previous pose of the character(including joint positions) and terrain geometry, the consequent frame of the animation is computed. The computation is done by a regression network that calculates future position of the joints and a blending function is used for Motion Matching as described in a presentation (PDF) and video by [Simon Clavet]. Continue reading “Neural Networks Walk Better Than Humans For Game Animation”

Using Modern C++ Techniques With Arduino

C++ has been quickly modernizing itself over the last few years. Starting with the introduction of C++11, the language has made a huge step forward and things have changed under the hood. To the average Arduino user, some of this is irrelevant, maybe most of it, but the language still gives us some nice features that we can take advantage of as we program our microcontrollers.

Modern C++ allows us to write cleaner, more concise code, and make the code we write more reusable. The following are some techniques using new features of C++ that don’t add memory overhead, reduce speed, or increase size because they’re all handled by the compiler. Using these features of the language you no longer have to worry about specifying a 16-bit variable, calling the wrong function with NULL, or peppering your constructors with initializations. The old ways are still available and you can still use them, but at the very least, after reading this you’ll be more aware of the newer features as we start to see them roll out in Arduino code.
Continue reading “Using Modern C++ Techniques With Arduino”

The Science Behind Boost Converters

[Ludic Science] shows us the basic principles that lie behind the humble boost converter. We all take them for granted, especially when you can make your own boost converter or buy one for only a few dollars, but sometimes it’s good to get back to basics and understand exactly how things work.

The circuit in question is probably as simple as it gets when it comes to a boost converter, and is not really a practical design. However it helps visualize what is going on, and exactly how a boost converter works, using just a few parts, a screw, enameled wire, diode, capacitor and a push button installed on a board.

The video goes on to show us the science behind a boost converter, starting with adding a battery from which the inductor stores a charge in the form of an electromagnetic field. When the button is released, the magnetic field collapses, and this causes a voltage in the circuit which is then fed through a diode and charges the capacitor a little bit. If you toggle the switch fast enough the capacitor will continue to charge, and its voltage will start to rise. This then creates a larger voltage on the output than the input voltage, depending on the value of the inductor. If you were to use this design in a real life application, of course you would use a transistor to do the switching rather than a push button, it’s so much faster and you won’t get a sore finger.

This is very basic stuff,  but the video gives us a great explanation of what is happening in the circuit and why. If you liked this article, we’re sure you’ll love Hackaday’s own [Jenny List] explain everything you need to know about inductors.

(updated thanks to [Unferium] – I made a mistake about the magnetic field collapsing when the button is pressed , When in reality it’s when the button is released that this happens. Apologies for confusion.)

Continue reading “The Science Behind Boost Converters”

Don’t Forget: Bring A Hack Munich Is Tonight

If you’re in Munich, Germany this weekend and you’ve got a sweet hack to show off and a thirst for beer and/or good geeky company, then you’re in luck! Come join Hackaday at the muCCC for a Hackaday Prize Bring a Hack.

The location is Schleißheimer Str. 41, a short walk west along Heßstraße from the Theresienstraße U-Bahn. No reservation is needed, but it’d be swell if you’d let us know in the comments that you’re coming (or better yet, click the “join this event” button in the upper right of the event page) so that we have enough pizza on hand.

The party starts at 20:00, not entirely coincidentally as soon as exhibitor setup at Make Munich closes. So if you’re setting up a booth, come on over to the other side of town where you can show off a small project to a select audience of fellow hackers. If you’re only going to be attending Make Munich, this is a great warm up.

Hackaday’s [Elliot Williams] will be there and taking photos if you’ve got something portable that you’d like to show the world! Otherwise, relax and hang out with kindred spirits. Need a time and place to get a team together for the Hackaday Prize? Here, with beer! (Or Spezi, but nothing rhymes with Spezi.)

Many thanks again to our hosts at Munich’s CCC.

MATLAB And Simulink For Zynq

Although we see a lot of MATLAB use in industry and in academia, it isn’t as popular in the hacker community. That’s probably due to the cost. If you’ve ever wondered why companies will pay over $2000 for the base product, you might enjoy the video of a webinar covering using MATLAB and Simulink (a companion product) to program the CPU and FPGA on a Zynq Zedboard. Not interested because of the price? If you aren’t using it for commercial purposes, it isn’t as bad as you think.

MathWorks is one of those companies that likes to market by virtually giving away products to students with the hope that they’ll adopt the same tools when they land jobs in industry. Their flagship product, MATLAB, is well-entrenched in the labs and offices of big corporations. We’ve often thought that MATLAB is sort of what FORTRAN would look like if it had been developed in the last 20 years instead of 60 years ago. It is true that a base license for MATLAB is over $2000. However, if you aren’t using it for commercial purposes, and you can’t score a student license, you can get a personal license of MATLAB for about $150. The extra modules are also similarly reduced in price. If you are a student, the price drops to about $100, although many schools have licenses students can use at no cost to them.

If you watch the video from [Noam Levine], you’ll see you get your money’s worth. If you are wanting to configure the FPGA directly, this isn’t for you. But if you just want to accelerate a program by pushing DSP or other algorithms that can benefit from hardware assistance, MATLAB makes it very easy.

Continue reading “MATLAB And Simulink For Zynq”

Ancient Robot Creates Modern Art

They say that there’s more to a Jackson Pollock painting than randomly scattering paint on a canvas, and the auction value of his work seems to verify that claim. If you want to create some more conventional artwork, however, but are missing the artistic muse that inspired Pollock, maybe you can put your creative energies to work building a robot that will create the art for you.

[Dane Kouttron] was able to get his hands on an old SCARA robotic arm, and was recently inspired to create a paintbrush-weilding robot with it for the 2nd Annual Robot Art competition. Getting one of these ancient (circa 1983) robots working again is no easy task though. [Dane] used LinuxCNC to help reverse engineer the robot’s controls and had to build a lot of supporting hardware to get the extremely heavy robot to work properly. The entire process took around two months, and everything from color selection to paint refill to the actual painting itself is completely automated.

Be sure to check out the video after the break to see the robot in action. The writeup goes into great detail about the robot, and includes everything from reverse engineering the encoders to auto-cleaning a paintbrush. If you don’t have a SCARA robot arm in your parts drawer, though, there are lots of other options to explore for robot-created artwork.

Continue reading “Ancient Robot Creates Modern Art”

AI Generates Color Palettes; Has Remarkably Good Taste

Color palettes are key to any sort of visual or graphic design. A designer has to identify a handful of key colours to make a design work, making calls on what’s eye catching or what sets the mood appropriately. One of the problems is that it relies heavily on subjective judgement, rather than any known mathematical formula. There are rules one can apply, but rules can also be artistically broken, so it’s never a simple task. To this end, [Jack Qiao] created colormind.io, a tool that uses neural nets to generate color palettes.

It’s a fun tool – there’s a selection of palettes generated from popular media and sunset photos, as well as the option to generate custom palettes yourself. Colours can be locked so you can iterate around those you like, finding others that match well. The results are impressive – the tool is able to generate palettes that seem to blend rather well. We were unable to force it to generate anything truly garish despite a few attempts!

The blog explains the software behind the curtain. After first experimenting with a type of neural net known as an LSTM, [Jack] found the results too bland. The network was afraid to be wrong, so would choose values very much “in the middle”, leading to muted palettes of browns and greys. After switching to a less accuracy-focused network known as a GAN, the results were better – [Jack] says the network now generates what it believes to be “plausible” palettes. The code has been uploaded to GitHub if you’d like to play around with it yourself.

Check out this primer on neural nets if you’d like to learn more. We’d like to know – how do you pick a palette when starting a project? Let us know in the comments.