Posts

Showing posts with the label Programming

Making an 8DOF Quadruped

Image
  I tried my hand at making a Quadruped Robot; an 8-DOF one as opposed to the typical 12-DOF ones. It is still very much a WIP, but I just couldn’t wait to make a post about it. In the top most photo you can see how it is taking serial inputs from a GUI application. The application itself was made using Processing. The GIF below shows how I send the servo values using the interactive knobs and pressing the respective servo buttons. For instance, HLF would mean Hip Left Front and KLB would be Knee Left Back. So if I set the HLF knob to be of a certain value, and then press the HLF button, it will send a command to move the front left servo connected to the hip, to the desired position. The GUI establishes Serial communication with the Arduino.  Spent so many hours 3D Printing the body. (The STL files were obtained from this Instructables page ). To provide sufficient current to all my servos, I al...

Face Tracking Duck (and Sheep!)

Image
Did you know that you can control your DSLR camera via command line instructions. Not me! And I wouldn’t have until I attempted this project. But that’s besides the point, this project goes beyond me simply using a DSLR camera to obtain a video feed. I used a 2-DOF pan-tilt rig powered by Arduino and the OpenCV library to track the movement of a person’s face. In a way, one could call this a rudimentary example of an animatronic head. If you move upwards, the head will tilt upwards to look at you. Almost like its gaze will follow in whichever direction you move. (Provided you remain within the frame, of course!) I tried placing several cute toys on the pan-tilt rig such as a duck or a sheep, and a ladybird. Setting up a DSLR camera for your video feed: I used a DSLR camera so that I can position the camera wherever I wanted to. In addition, you get a higher frame rate, better image quality etc… This project works with a laptop camera as well, which is what I was using at the be...

An attempt at creating "ASCII" Art but with Unicode characters

Image
Following a quick read of this article on Medium [4], I felt tempted to try my hand at making ASCII art. Well, ASCII art but including Urdu/Arabic characters in it. So in other words, not “ASCII” art at all. This means we’re going beyond the realm of a restrictive 127 character set. Making ASCII art has been tried and done hundreds of times. For this project, I used C++ (my go-to programming language). Upon researching the working principle behind ASCII art [10] and how others approached this in C# [2], Python [4] and JavaScript [3] , I found that implementing an intensity-dependent program is the simplest solution. It can be summed up in 4 steps. 1) Set a char array with several characters sorted by “intensity” 2) Get a grayscale, contrast-adjusted image. 3) Loop through each pixel and select a corresponding character for each pixel, based on the grayscale value (0-255). 4) Print out the corresponding characters. I used the SFML library to load the ima...

Controlling a Stepper Motor using a WPF application

Image
I started off this project wanting to dig deeper into using Serial Communication to control an Arduino-connected actuator. Previously, I had seen certain projects switching LED’s on and off using WinForms. Although WinForms is great, I wanted to go a step above that. My goal was to create an interactive UI, which was a little more intuitive to use. In this case, creating a dial-like interface that the user could move would help them visualize clearly what direction they want their motor to point to. As opposed to typing in an angular value in a text box, which is decidedly less intuitive. Since WinForms is limited, I knew I had to use WPF (Windows Presentation Foundation). I’ve seen people build amazing WPF apps on Youtube, and thought it would fit this project. Also, it would serve as hands-on practice with XAML and C#. (Since I will be needing to use them in a later project). Required Components: 28BYJ-48 Stepper Motor ULN2003 Motor Driver Board Arduino UNO (or an...