Showing posts with label RaspberryPi. Show all posts
Showing posts with label RaspberryPi. Show all posts

Thursday, February 12, 2015

Gource: A Free (and Easy-to-Use) VCS Visualization


A friend shared this with me a while back, but I finally have a neat repo to test it on and a blog to show it off! Gource is a free tool that visualizes files & commits in a specific version control repo. The example below is a project I've been working on for a while. While the repo in the video is git, the author's page claims it also works with Mercurial, Bazaar, and SVN as well. 

 - Uploading directly to Blogger resulted in terrible resolution & quality in the version below. -  
(In case the video doesn't upload right, it's also on YouTube)

And it's pretty damn simple to use, too. Just running gource from a command line at the top level of a given repo runs it with its default settings, but it has a pretty extensive set of parameters if you want to change things (speed it up, specify date ranges, etc.).

In this example, there's really only one author (me), but I sometimes from a Raspberry Pi as well, which it currently just treats as a second user (named "pi", of course!), thus the second figure floating around.

My only wish is that it could somehow visualize the extent of the changes made to a given file, perhaps by color, or "flashing" that file's dot (varying brightness) temporarily, or maybe the changed file's dot grows in size for a second or something. That would make me feel better for those long hours and manny commits on a few particular files!

Anyway, really cool and free -- what can be better?


Friday, December 12, 2014

Getting Physical: Learning to Interface Python & Hardware

I've always been more of a software guy then a hardware guy. But a litany of factors have resulted in me finally putting a lot of real effort into making an old idea of mine become a reality, so now's the perfect time to start getting hands-on experience working on the hardware side of things!

In short, I need to create a device that can take some real-time distance and motion measurements. Ideally, this device will be small, inexpensive, simple to setup/install, and wireless (which means wireless communication and wireless power). To start, though, I'm just getting a functional prototype going for proof-of-concept, so I'm not worried about the size, wired vs wireless aspect, etc.

It's Alive!

Maybe I'll get a chance to go into some more detail at a later date, but for now I'll skip to the cool part: version 0.2 is operational! (I arbitrarily used v0.1 to getting the accelerometer working, and v0.2 has the distance sensor as well).
Device v0.2: RaspberryPi + GY-521 MPU-6050 accel/gyro + HC-SR04 range sensor

Since I went into this pretty blind (no idea what I'm doing at the outset) and a with low expectations (circuits was one of my worse courses in physics undergrad), I made some choices that erred on flexibility. For one, I started with a Raspberry Pi B+ model. Choosing a RasPi instead of an Arduino came down to two key differences:  1) RasPi is an all-in-one computer while Arduino is a much simpler microcontroller, so the former has a lot more functionality while the latter is intended for a single or fewer uses; and  2) Arduino's programming environment is in C, while Raspberry Pi runs a parred-down Linux, so I can code in just about anything I like: Python, Perl, Java, C, etc. 

There are a wealth of helpful tutorials for getting started in RasPi and interfacing it with various sensors & equipment. For the accelerometer/gyroscope unit, I used a Kootek GY-521 MPU-6050 (also bought a couple ADXL-345 units which were popular on blogs & tutorials). And for distance, I'm used an HC-SR04 ultrasonic range sensor. I'll make a note to come back at a later time and link out to the best tutorials I found, but a simple Google search gives you plenty. 

Oh, and for the Raspberry Pi board itself, I went with a starter kit from CanaKit, which provided a lot of the important peripherals in addition to the basic RasPi board (e.g. power supply, wifi dongle, enclosure). As a complete idiot when it comes to DIY circuits/electronics, I can say the CanaKit package was a really great place to start. 

In the end I'm actually a bit surprised that once I learned the basics of build-it-yourself electronics, the hardware aspect of my project was a surprisingly small portion of the hours I've put into it so far. So I'm already going back to the coding stuff I love! My next task is to start learning multi-threading & queuing in Python, so I can have the two sensors running in parallel and controlled by a single program.