Tag Archives: open source

GPS tracking and statistics

I’ve always had “a bit of a thing” for GPS devices, and have owned a dozen or more for different purposes – CF card receivers that plugged into Windows Mobile devices, a Garmin standalone device for hiking, a TomTom when I owned a car etc. Of course these days every smartphone has GPS built in – but as ever with such convergent devices, the battery life is the problem.

A few years ago I wanted to start geo-tagging my photos. Although a few more cameras now come with GPS receivers, it’s still not a common feature. But the way around it is to log your position every few seconds, and then use these data when you get home to tag photos with their position. The key thing here is to make sure that the camera has the correct time set, and then software interpolates between subsequent GPS points to find an approximate location for the picture, and writes these data into the EXIF header.

There are quite a few devices that do this, but my latest is the PhotoTrackr Mini (DPL900). With a 17 hour battery life and a 2MB flash memory storing up to 250K points it is easily capable of recording a day hike or bike with 1 s resolution.

Gisteq PhotoTrackr Mini
Gisteq PhotoTrackr Mini

Since I use Ubuntu, the bundled software doesn’t get used. Fortunately the Skytraq chipset is well supported by other tools, in particular gpsbabel which, as the name suggests, is capable of grabbing GPS data from a range of devices and converting into different formats. For those interested, data can be dumped and erased with:

gpsbabel -i skytraq,erase -f /dev/ttyUSB0 -o gpx -F gpsdata.gpx

I usually then use gpscorrelate to read a set of files and a GPS track, perform the interpolation and write the data back to the photos. All in all a pretty painless experience.

But it’s not just about tagging the location of photos, as a data junky one can never have too many data! Being able to look back at speeds, distances, altitudes etc. is very cool. And because I’ve just found the WP-GPX-maps plugin, here are some data from a recent bike ride:

Download file: bike.gpx

Neat eh? 🙂 And of course this is only the tip of the iceberg – aggregated over time such statistics can be great for training – of course these days there are a million and one apps to help you do this, but there’s still something neat about Doing It Yourself.

Evernote on ubuntu

Evernote is one of the few apps that I regularly pay real money for – as productivity apps go, you really can’t beat it! For those who don’t know it, Evernote is a note taking application that syncs to the web. It has clients for Windows, Mac, various mobile platforms and a pretty full-featured web interface. Each note can contain rich text, “clippings” from web pages, and file attachments. Notes live in notebooks, which can be grouped into stacks (e.g. I have one notebook per project, and all of my work notebooks in a stack). In addition, notes can be tagged, are full-text searchable (including inside images and PDFs!) and there is a comprehensive power-user-friendly search syntax.

The typical usage case that Evernote gives is snapping a picture of a wine bottle, having the label automagically searchable from any client etc. For me, Evernote is more of an electronic lab notebook – in fact I discovered it in 2008 whilst trying to fulfil that need. Before this I was using a blogger weblog to store my notes – mainly so that I didn’t have to lug paper between my office and lab during my PhD, and so that it was always backed up and in sync. Since then I’ve moved from mainly being a Windows user, to exclusively using ubuntu, and now also Android. The mobile clients are really coming along in leaps and bounds – offering full offline sync for Premium users, and a nice tablet-friendly interface (great for my Nexus 7). But the linux space is not so lucky. Unlike some other companies (Dropbox, Google, Spotify etc.) Evernote chose not to develop a linux client; this was no doubt a wise strategy given the low number of users. They do, however, provide an well-documented API, in theory allowing a client to be built for any platform.

My first experience of using Evernote on ubuntu was using the Windows client via wine; with the current version of the client this works surprisingly well! However, a few things don’t work (import folders etc.), and it can be a bit “finicky”. In addition in the latest ubuntu (12.04 and above) there is a problem connecting with SSL – however, installing an older version of wine (1.4) using PlayOnLinux works OK.

Fortunately, a project sprang up to fill the gap and provide an open source native (well, java/QT!) client: Nixnote (formerly Nevernote). This is a fully-fledge desktop client which syncs with the Evernote service, and it probably ties with my web browser for the app I spend most time in! Pretty much all of the Windows/Mac client functionality is reproduced; in fact there are some great novel features like embedding LaTeX equations, and offering a “quick link” function which creates inter-note links based on the highlighted text. On the downside it takes quite a lot of memory. However, Nixnote 2 is under development, which should offer some improvements in this area.

A newcomer to the scene is Everpad, which doesn’t aim to be a complete desktop client as NixNote does, but offers excellent integration with ubuntu and unity. Everpad runs in the background and synchronises all notes, and then provides a few ways to access them. A unity lens allows one to search and filter notes, an indicator applet shows the most recent notes (and “pinned” favourites), and a unity launcher provides a shortcut to create a new note. The note display and editor is atypical in that it separates out attachments, rather than displaying them inline, but it is early days and the app shows a lot of promise.

As well as these client apps, there are various web services which integrate with Evernote via the API. For example the online markdown editor markable imports and exports notes from your Evernote account.

To sum up – I’m “happy-ish” with the various solutions for using Evernote on linux – none is quite as robust or slick as the Windows or Mac desktop clients, but Nixnote and Everpad both have unique features. So give them a try – and let me know if you have another solution!

Granular simulations using LIGGGHTS

As promised in my last blog entry, having talked a little about why I am interested in simulating granular material (i.e. materials made up of distinct particles), I want to talk a little now about some of the tools I’m using. Of course all are free and open source – so you can download them and give it a try yourself!

Granular materials are oddities – sometimes they can behave like solids, and form stable structures, and sometimes they behave like liquids, and flow and pour. And sometimes they transition readily between the two! Because of this wide ranging behaviour, we don’t (yet!) have a nice set of equations to describe their bulk behaviour (as we for do, say, for gases). Instead, it is possible to build numerical models of granular systems by modelling the behaviour of individual particles, their interactions with other particles, walls, etc. This may sound complex, but much of the complexity is in how to computationally deal with tracking enough particles to be useful, not in the underlying physics. So if we can correctly describe the interactions of a pair of particles, we should be able to describe a system of billions of such particles – providing we have enough time and computing power!

LIGGGHTS logoThis technique is called the Discrete Element Method (DEM) and is an extension of  molecular dynamics to deal with larger particles which have a finite size and  a rotational degree of freedom. There are several open source codes available which you might like to look into – I have played with three: ESyS-Particle, YADE and LIGGGHTS. Each has its own advantages, and in fact I ended up using bits of each (a geometry building module from ESyS called LSMGenGeo, some YADE scripts to build ballistic aggregates, and LIGGGHTS for my “grunt work”). In this post I’ll focus mainly on LIGGGHTS, since it is the engine at the heart of most of the calculations I’m working on right now.

LIGGGHTS is a fork of the popular molecular dynamics code LAMMPS with enhancements to better deal with the macroscopic particles used in granular mechanics  simulations. As such, the computational complexity of stably integrating the equations of motions for millions of particles, and figuring out which particles are interacting, is already well-validated by the many LAMMPS users. The enhancements made by the LIGGGHTS team focus on the contact models (the physics of two particles interacting), linking the DEM model to a fluid dynamics code (OpenFOAM), allowing importing of CAD meshes for greater flexibility, and a host of utilities to enable generating of complex particle packings, support for non-spherical particles and so on.  You can check out a recent presentation by the LIGGGHTS team [PDF] for more details!

My aim is ultimately to come up with a validated model of a cometary surface which accounts for low gravity, the various inter-particle forces, and the surface environment. But before one can run, one has to learn to walk – hence I’ve been playing with LIGGGHTS and trying to make a set of simulations that demonstrate the main features I want to include in my model. So for the the next few posts, I’m going to link a few YouTube videos showing output from LIGGGHTS and talk a little about them. If you want a sneak preview, you can jump to the YouTube playlist of these videos!

zotero, zotfile and zandy – publication syncing heaven

“Back in the day” I used to use EndNote as a literature database – this, together with a precious photocopy card, a sturdy filing cabinet and a supply of yellow markers made for a fairly robust method of filing and tracking interesting papers. Of course these days it’s all different – now we have online journals, vast abstract databases, full-text searching and the like. In fact it’s almost too easy to acquire a possibly vaguely relevant paper – the need for a good archiving methodology is paramount!

I stuck with EndNote for a while, and started storing PDFs of my articles there. But, gradually (and more rapidly when I started to switch from Windows to linux!), I started to look for something (a) less bloated, (b) free/open source and (c) cross platform. Around the time I moved to Austria, I made two significant (to me) discoveries – one was Evernote, but I’ll talk more about that another time. The second was zotero. Continue reading zotero, zotfile and zandy – publication syncing heaven