Skip to main content

Posts

Dynamic Reflection

After three years I'm leaving my engineering job at Dynamic Controls! I started as a summer intern back in 2010 and was subsequently hired as a Systems Engineer. Most of my time at Dynamic Controls was spent within the system's architecture team, designing, prototyping and specifying protocols for powered wheelchairs. I've really enjoyed and grown in my first real world job. Dynamic was a great fledgling ground, while there I've had good mentors and great friends. One thing that stood out from the first day is the company has a strong vision of where it wants to be. The culture strongly promotes innovation, openness, sustainability and a desire for excellence. I've certainly enjoyed telling people that I help design powered wheelchairs as well! I was very proud to be on the team that helped to design and implement the LiNX architecture. Of course there was plenty of pressure during my time as we released the first in a series of innovative wheelchair controller...

Prototyping User Interfaces with AngularJS

When creating responsive websites there are so many options to choose from. I've come to favour AngularJS and want to take the time to walk through creating a non trivial, useful tool. Standing on the Shoulders of Giants Using a seed app gives a well designed and extendible structure. Start by downloading the angular-seed app from github . Extract the into your project folder and start your web server. The server itself is not the concern of this post, django, nodejs or python's built in http server will work fine to serve the content. If everything has gone well you should be able to aim your web browser at localhost:8000 and sees something very exciting like: Directory Layout Lets take a quick digression to look at where all the files are: app/ --> all of the files to be used in production css/ --> css files with default stylesheet img/ --> image files index.html --> app layout file (the main...

Pickling items that don't fit in memory

I really like using Python's generators . Watching/reading David Beazley's talk on the topic of generators has made me try use them where ever practical. Recently I've had to deal with streaming and capturing massive amounts of data. Recording all traffic from a high baud rate CAN bus incidentally. Anyway I have Packets of unknown type and length coming in and want to store the sequence in such a way that I can recreate the full python objects on another computer. A quick solution is to serialize the data and store it to a file. The built in module for this is pickle . Unfortunately even with 12GB of RAM my work PC couldn't store the entire sequence in memory waiting to do a single serialization dump with pickle. After a bit of research I found a Python 2 implementation of streaming-pickle by Philip Guo . His solution didn't support bytearray objects and also suffered from a content boundary separation problem - multiple newlines within the pickled data coul...

Rolling Frequency Analysis in Python

One of the projects I've been involved in at Dynamic Controls is building a Dyno Bench - essentially a set of motors that are very well instrumented. With this bench we can measure all sorts of things like Motor Speeds, Voltages, Current, and temperatures. Recently I've been investigating more and more in a live fashion - wanting to see changes in real time while I tweak parameters or inputs. I required a quick an easy way to see the frequencies present in an arbitrary signal. This is usually calculated after the test has run with a large Fast Fourier Transform . These calculations are quite expensive but with a small enough window and a powerful enough computer they can easily run in real time. By considering the frequencies of interest, as well as the computation power you have to play with you can make the trade off between a small enough sampling time dt and a large enough sample size n For a problem on Friday I was interested in frequencies in the 10 - 100 Hz range,...

Terrain Aware Navigation

A passion of mine is enjoying the outdoors, especially tramping. I love how easy it is to escape, just pack your bag and head away into the hills. On my last really great trip, my group was at least three days walk in any direction from anyone else. We had a great time visiting a very remote lake on the West Coast of New Zealand called Ivory Lake. But what if we had gotten into trouble? Would one of us have to walk out for three days to get help? Over the last year I've been training in Land based Search and Rescue. In New Zealand many tourists, hunters, trampers, and outdoors adventurers of all disciplines get into trouble every year and need help. For a well prepared group any emergency would soon be followed by a radio broadcast, or the setting off of a Personal Locator Beacon. This immediately notifies the appropriate rescue personnel to the scene. In some cases, especially with solo outdoor people, the emergency services don't find out until many days after an incid...

Online Collaborative Playlists for Spotify

I'd like to announce a website that I've created in my spare time over the last few months. The idea is very simple, you invite people to collaborate on a music playlist. For example in a week my flat is hosting a Piano Evening  to celebrate getting our piano tuned. We're inviting friends who play around to each play two pieces. I posted a link to PartySense on the facebook event page and asked people to add their two songs. Surprisingly, people have done so! As you can see on the right hand side, with Spotify we can preview the playlist. I'm still working on a few more features like dragging songs in from the Spotify desktop program. Its currently in beta, but feel free to check it out and give me any feedback! http://partysen.se Its the first project I've done that heavily uses AngularJS, although I've now done a few smaller sites at work that use AngularJS. For this site the authentication is done with Facebook, music data is sourced from Spotify a...

AngularJS and Django

Two excellent tools for creating websites are Django and AngularJS , unfortunately they both use the same {{ syntax}} for templates which makes it a bit messy to include both in the same file. This isn't necessarily a bad thing as mixing server and client rendering just sounds like a recipe for a vulnerability. The method that has been working for me is to completely separate any client side templates from server side templates. For example I serve from a static apache instance a file like this: < section id = "search" ng-controller = "MyCtrl" > < input type = "search"   ng-model = "searchTerm"   ng-change = "doSearch()" results = "10"   placeholder = "Search for track to add" autofocus   autocomplete = "off" > < table class = "table" ng-show = "result.tracks" > ...