Autonomous Quadrocopter: What and Why?

It’s now been two years since I last did any work involv­ing autonomous vehi­cles, and I’m kind of dis­ap­pointed by the lack of that kind of work. Writ­ing soft­ware for big data acqui­si­tion sys­tems is all well and good, but it lacks a cer­tain some­thing — I just don’t get attached to them in the way that I do to vehi­cles such as this one.

One could prob­a­bly argue that devel­op­ing an odd fond­ness for robot boats is a bad thing, but unfor­tu­nately that appears to be the way my brain is wired. So, onwards!

Since no autonomous vehi­cle work seems likely to come my way pro­fes­sion­ally at the moment, the urge is ris­ing to build one in my spare time. This presents a prob­lem, in the form of a lack of time and money.

I’m unlikely to stum­ble upon a free RIB, jet­ski or min­isub that I could hack about with, and have nowhere to store one any­way, so those are prob­a­bly out. Cars would be the next obvi­ous choice, but if we had a car to start with, the fam­ily may object to me cov­er­ing it in sen­sors and fill­ing the boot with com­puter equipment.

I think we need to think smaller, and my co-conspirator @aefaradien sug­gested a quadrocopter.

Our first chal­lenge is to spec­ify the parts we want to use, which is the first point at which my exper­tise starts to become less use­ful. The nat­ural approach for me at this point is to spend about £20,000 on a cRIO and a bunch of PC104 boards and wire them all up in a big case — not only don’t we have any­thing like that amount of money, weight is now also an issue.

For the CPU of the device, we con­sid­ered a cheap Android phone, as this would give us GPS, a gyro­scope, WiFi and a cam­era with­out spend­ing too much money. How­ever, we would still need to use a sep­a­rate motor dri­ver board for the pro­pellers, and get­ting a phone to talk to it could be tricky. @aefaradien raised the issue of reli­a­bil­ity, too — a crashed phone means a crashed vehi­cle. Even with a watch­dog timer to reset the phone (poten­tially yet another board), Android’s boot time is going to leave our pre­cious ‘copter in a ditch somewhere.

An Arduino is look­ing like a much more appro­pri­ate solu­tion, espe­cially as they come with dig­i­tal and ana­logue I/O baked in, and read­ily avail­able “shields” that could drive the motors. How­ever, that leaves us sourc­ing our own gyro­scope, GPS and cam­era, as well as fig­ur­ing out how to remotely con­trol the vehicle.

Our notes are avail­able at sparktank.net, and more blog­gery will occur as the project progresses.

a thousand words: Finishing Touches

The vast major­ity of user-reported bugs and requested fea­tures on “a thou­sand words” have now been sorted out. As requested by my co-conspirator Eric, we now have an ‘adult con­tent’ fil­ter based on a date of birth field in users’ pro­files, and a ‘report’ but­ton to bring prob­lem­atic sto­ries and pic­tures to the atten­tion of the mod­er­a­tors. There’s also a DeviantArt-style “request cri­tique” option to let users know what kind of com­ments you’re look­ing for.

Time­stamps have been fixed, “no stars yet” rat­ings intro­duced, and text field poli­cies such as “mustn’t be empty” have been added across the site. A few ren­der­ing issues in IE have been sorted out, so it now looks much the same across all platforms.

The biggest change is unfor­tu­nately some­thing most of you will never see — the mod­er­a­tor con­sole. Pic­ture sub­mis­sions and reported stories/pictures now sit in queues that can be dealt with by mod­er­a­tors. An item enter­ing a queue trig­gers an e-mail to all mods, who are invited to review it and make changes as appro­pri­ate. Once changes are made, the affected users are then e-mailed to let them know what hap­pened (and in the case of reported items, to give them a chance to chal­lenge it).

There’s one major fea­ture request that’s not yet been imple­mented: file uploads. Once in the sys­tem this would allow users to sub­mit pic­tures from their hard dri­ves rather than from the web by URL, and would allow mod­er­a­tors to copy URL-linked pic­tures to the site to avoid hotlink­ing. (At present we don’t hotlink, but we do there­fore have to copy pic­tures to the site man­u­ally using FTP.) It could also allow users to use a non–Gra­vatar pic­ture for their profile.

Depend­ing on how things go, that may or may not be ready by tomor­row night. On Sat­ur­day morn­ing I jet off to sunny Saudi Ara­bia, so any changes not made by then are going to remain unmade for a while. From that point it’s in Eric’s capa­ble hands as to whether she wants to release the site or not. Even if the site does advance to release sta­tus, I’m still tak­ing bug reports (they’ll sit in my inbox until I get back), so keep on let­ting me know what’s bro­ken and what you’d like to see added!

a thousand words: Alpha, Beta

“a thou­sand words” has now reached a stage where every fea­ture that I give a damn about is imple­mented. Thus, we’re open­ing it up to a lim­ited beta test to iron out the wrin­kles and get a list of any fea­tures poten­tial users would like to see us launch with. If you’re bored or sim­ply have a love of break­ing other people’s shit, head along to http://athousandwords.org.uk and see what hell you can raise. As the Big Red Box Text warns you, really don’t sub­mit any work of fic­tion you care about, just in case some kind soul finds an SQL injec­tion vul­ner­a­bil­ity and trashes the database.

Since last time I bored the hell out of you all, vot­ing and com­ment­ing has been imple­mented, reg­is­tra­tion has been fixed, fil­ter­ing HTML tags from sub­mis­sions has been added, as has a word count and the pic­ture selec­tor on story sub­mis­sion. There’s been a bunch of behind-the-scenes tweaks to improve secu­rity too.

The one fea­ture that Eric def­i­nitely wants is a way to mark sto­ries accord­ing to their con­tent. We could do this in sev­eral ways — I would pre­fer, if any­thing, to just have a “not for kids” option on each post and a Date of Birth field asso­ci­ated with user accounts, so we can hide sto­ries as required. Other options include a range of rat­ings (U, PG, 12, 15, 18…) or tags for cer­tain con­tent (vio­lence, sex, lan­guage) so peo­ple can avoid what­ever they’re picky about.

This prob­a­bly ought to come with a Report but­ton so that users can report incor­rectly rated sto­ries, and I would add a sim­i­lar fea­ture to report pic­tures. (Pic­ture sub­mis­sions are mod­er­ated, so Goatse isn’t going to make it through any­way, but the mod team might miss sub­tler things like licenc­ing terms and copy­right infringement.)

At that point, all that’s left on my list is the admin inter­face and any­thing that users sug­gest dur­ing this beta. Hope­fully we’ll be ready to launch by the time I depart for sandier shores at the end of the week!

a thousand words: Hot Profilin’ Action

A few days’ lazi­ness (by which I mean a few days’ Star­craft) have passed with not much work being done on “a thou­sand words”. That came to an end tonight, with a pro­duc­tive evening result­ing in a work­ing pro­file sys­tem so that users can now add and dis­play per­sonal infor­ma­tion, change their reg­is­tered e-mail address and pass­word, etc.

There’s now a data­base back­end for the vot­ing and com­ment­ing sys­tems, which will be com­ple­mented by their GUI pages tomor­row night.

Once that’s done, that’s the last of the main func­tions out of the way and we’re basi­cally down to tweaks. I think we ought to, in no par­tic­u­lar order:

  • Decide on what for­mat­ting users can add to sto­ries, and fil­ter for it
  • Add a word count, and pos­si­bly limit sub­mis­sions to e.g. 600‑1400 words
  • Add a means of report­ing sto­ries and pic­tures for e.g. copy­right issues
  • Add a means of rat­ing sto­ries, so users can mark them as con­tain­ing sex, vio­lence etc.
  • Cre­ate an admin inter­face, so we don’t just have to run the site with raw SQL queries
  • Add ranks, etc. (incen­tives for achiev­ing high Total Stars)
  • jQuery up some of the main bits to improve user experience
  • Imple­ment the scrolling list of pic­tures for users to select when cre­at­ing a new story

At that point, I think it should be ready for open beta. Hope­fully we can get it all done within a week, before I depart for internet-less shores!

a thousand words: GETting and POSTing

Another day, another bunch of func­tion­al­ity added to a thou­sand words. With the main public-facing inter­faces largely com­plete, I have moved on to the guts of the site’s user inter­ac­tion. The site now has work­ing, but ugly, imple­men­ta­tions of:

  • E-mail address / pass­word authen­ti­ca­tion, with cookie sup­port based on a secret phrase gen­er­ated at registration.
  • Reg­is­tra­tion itself, includ­ing the set­ting of a dis­play name (users authen­ti­cate with their e-mail address, so we need some­thing friend­lier to dis­play in the UI). Accounts are cre­ated in an unac­ti­vated state, and an e-mail is sent allow­ing the user to use their secret phrase to acti­vate the account (GET­ted via a “click here to acti­vate!” URL).
  • Pic­ture sub­mis­sion, which adds the sub­mis­sion to a ‘queue’ table. In time there will be an admin inter­face for mov­ing items from the queue to the real pic­tures table, i.e. pro­mot­ing a sug­gested pic­ture to “pic­ture of the week” status.
  • Story sub­mis­sion, which adds the story to the live site and takes you there after sub­mis­sion. There’s cur­rently no edit capa­bil­ity, and the pic­ture that the story is based on must be man­u­ally spec­i­fied by ID num­ber. (The lat­ter will become a scrol­lable jQuery list of all pictures.)

A story edit/delete inter­face is my next task, and once that’s done, the core func­tion­al­ity (exclud­ing any user profile-related code) will be largely fin­ished. After that there’ll be a period of test­ing and improv­ing the inter­faces of the new func­tions, before I put a call out for a cou­ple of will­ing guinea pigs to try and break the site for me! If any­one out there is expect­ing to be really bored some­time this week, let me know!

a thousand words: First Sketches

With the main brows­ing UI for a thou­sand words up and run­ning, it’s time to bore the world with more point­less trivia before mov­ing on. Today: design sketches!

Pretty much every soft­ware project I under­take these days begins with a sketch of the user inter­face and an ini­tial struc­ture for the data­base. Labour­ing under the cruel ‘no white­board’ con­di­tions at home (maybe I should get one?), I drew these out on paper. Pass­ing the UI sketch over to Eric after about 5 min­utes’ work, she described it as “awe­some”. I think that’s the first time that’s ever hap­pened; the gen­eral response at work is along the lines of “but where are you going to put giant-ugly-element-X that I’ve just thought of and wasn’t in the spec?”. So that was that, and I’ve coded it up pretty much as it was on paper.

The data­base hasn’t changed much from the orig­i­nal design yet, but it will have to soon — as designed, the vote (‘stars’) sys­tem doesn’t record each user’s vote on each story, so it can’t sup­port users chang­ing their vote. Some­time dur­ing devel­op­ment I’ll have to devote a few hours to fig­ure out the best way of han­dling it, though that prob­a­bly comes down to a few min­utes as some­one on Stack Over­flow has inevitably asked about it already.

a thousand words UI Sketch

UI Sketch


a thousand words Database Design

Data­base Design

Next up on a thou­sand words is cod­ing the first few forms that will allow users to reg­is­ter and log in, sub­mit pho­tos and sub­mit sto­ries. That should be done within the next few days, and will allow me to play with actu­ally chang­ing the con­tents of the data­base, rather than just show­ing views of it.

a thousand words: A New Timesink has Arrived!

Some­how unable to cope with actu­ally hav­ing free time of an evening, I have taken on yet another project which will doubt­less push me deeper into the dark, untamed wilds of the inter­net, the land stalked only by the mys­te­ri­ous beast known as the “web developer”.

Eric has come up with the idea for a fiction-writing com­mu­nity known as “A Thou­sand Words”. The con­cept is simple:

  • Users sub­mit pho­tos or other images that they find interesting
  • Every week (or other suit­able period of time), one of these is cho­sen by the site staff
  • Users then write short sto­ries, of around 1000 words, inspired by the picture
  • Users rate, com­ment etc. on each other’s stories

I’ll be cod­ing up this site in my spare time over the next few weeks, and you can check out my cur­rent progress on the live site at a thou­sand words.  Cur­rently, the data­base design is done and I’m part­way through the UI of what will be the main page.  My todo list is roughly:

  1. Fin­ish the main page and story page UIs.
  2. Add bare-bones pages for all the GET/POST func­tions, e.g. reg­is­ter­ing accounts, sub­mit­ting sto­ries, sub­mit­ting pictures.
  3. Test all the functions.
  4. Work on their UIs.
  5. Start closed beta test­ing for any­one interested.
  6. Lib­er­ally apply jQuery to improve user experience.
  7. Add com­ment­ing, pos­si­bly via DISQUS.
  8. Add proper user pro­files, gra­vatar sup­port etc.
  9. Get every­one I can find to try and break it.
  10. Release!  Open the flood-gates, and despair at the drib­ble I receive.

As I go I’ll be post­ing updates and hopefully-interesting insights here, and you can always check the site at athousandwords.org.uk to see how I’m get­ting on.

Announcing: Westminster Hubble!

Ladies and gen­tle­men of the blo­gos­phere, I am proud to announce the release of a new web­site. This is what I have been wind­ing up most of my Twit­ter fol­low­ers for the last two months by refer­ring to it only as “Super Secret Project #1″. Its name is West­min­ster Hub­ble.

Westminster Hubble Logo

A joint ven­ture between myself and Chris Cox, West­min­ster Hub­ble helps you stay in touch with your rep­re­sen­ta­tives in Parliament.

Each MP has their own page, which you can nav­i­gate to by search­ing by name, con­stituency or post­code, or by select­ing from a map of the UK or a list of every­body in the data­base. Here’s an exam­ple for one of Westminster’s most tech-savvy, Tom Wat­son.

On each MP’s page, each item of their online pres­ence is listed: their web­site, blog, Twit­ter account, Face­book page, and so on. These are all editable, so that MPs or benev­o­lent users can help keep their page up to date. MP’s pro­files on They­Work­ForYou, the UK Par­lia­ment web­site and the Tele­graph news­pa­per are all auto­mat­i­cally linked to as well, and if they’re on record, the pages also list MPs’ con­stituency addresses and phone numbers.

Each of the online items is rou­tinely checked for updates by West­min­ster Hub­ble, and from them a feed is cre­ated. This feed forms the body of each MP’s page, and is a fil­ter­able list of all that MP’s activ­ity on all the web­sites we know about.

Of course, you can sub­scribe to an RSS feed for an MP too (or even a sin­gle feed for all 650 of them, if you’re that way inclined). Just click the “Sub­scribe” but­ton at the top of any feed.

So if you want a sin­gle feed of your MP’s speeches in Par­lia­ment, blog posts, tweets and YouTube videos, West­min­ster Hub­ble is a new site that will give you just that. If you want a sin­gle page that’ll give you quick access to all their pro­files across the inter­net, we do that too.

Please, spread the word!

Farewell, Dynamic Democracy

Back in April, the Dig­i­tal Econ­omy Bill was rushed through the wash-up pro­ce­dure of the out­go­ing gov­ern­ment with­out the due debate and con­sid­er­a­tion that I and oth­ers believe such a far-reaching bill deserved. My dis­il­lu­sion­ment with the gov­ern­ment decision-making process over the fol­low­ing week led me to set up and announce a new site, called “Dynamic Democ­racy”. It was an exper­i­ment to see what would be dis­cussed if every­one was involved — on an anony­mous basis — rather than just our elected rep­re­sen­ta­tives that often do not do a good job of rep­re­sent­ing us anyway.

The site allowed all users to cre­ate and com­ment on ‘Bills’, encap­su­lated ideas or laws that they would be push­ing for if they were in power. Reg­is­ter­ing gave users the abil­ity to vote bills (and com­ments) up and down, lead­ing to a list of highest-ranked bills that rep­re­sented the users’ favourite poten­tial policies.

Dynamic Democ­racy saw lit­tle suc­cess, pos­si­bly because writ­ing a full, well-thought-out bill rep­re­sented sig­nif­i­cant effort that a casual browser would be unlikely to com­mit. ‘Karma’, the point sys­tem that aimed to encour­age users to sub­mit bills and com­ments, did not prove to be a good enough incen­tive as there were so few users to com­pete with and no direct reward was ever imple­mented for reach­ing high karma levels.

What the site did bring, how­ever, was a num­ber of enquiries from like-minded indi­vid­u­als all over the world, keen to dis­cuss the ideas behind the site and whether or not some­thing like Dynamic Democ­racy could ever be imple­mented as a real gov­ern­ment policy-making tool. One of the more notable con­tacts, Denny de la Haye, stood as a can­di­date for Hack­ney South and Shored­itch in the gen­eral elec­tion and promised to imple­ment a crowd-sourced vot­ing sys­tem sim­i­lar to Dynamic Democ­racy for his con­stituents to voice their opin­ions in Par­lia­ment through him. (Denny, who sadly did not win his seat, now rep­re­sents the UK arm of polit­i­cal party DemoEx.)

I have decided that today is the day to close the Dynamic Democ­racy exper­i­ment, because today the UK gov­ern­ment announced their “Your Free­dom” web­site. While largely focussed on repeal­ing or chang­ing laws rather than the com­plete free­dom to sug­gest any­thing you like, Your Free­dom is cer­tainly in the same vein as Dynamic Democ­racy, with the cru­cial extra fea­ture that is endorsed and used by our gov­ern­ment and thus ideas pro­posed there stand at least some chance of mak­ing it into offi­cial gov­ern­ment policy.

Time will tell whether that really hap­pens, or if like the No. 10 Peti­tions site, sug­ges­tions will be responded to with an e-mail from the Prime Minister’s office explain­ing why thou­sands of users are all wrong. But I do still hold out hope.

Did Dynamic Democ­racy influ­ence the gov­ern­ment in their deci­sion to cre­ate Your Free­dom? Almost cer­tainly not. As my dis­cus­sions with vis­i­tors to the site have shown, I am far from the only per­son to have come up with this idea, and nei­ther am I the only one to have coded up a web­site around it. No — this is sim­ply an idea whose time has come. A vast gulf exists between West­min­ster and the world out­side, just as it always has, but these days the pub­lic are com­ing to ques­tion why that is and if we can do some­thing to cor­rect it. And nowhere is the desire to bridge that gulf stronger than among the tech-savvy youth that have the drive and the abil­ity to use the inter­net to that end. Sites like these will come and go a hun­dred times over the com­ing years and decades, and slowly but surely we’ll reshape our gov­ern­ment into what we want it to be.

So to every­one who con­tributed to Dynamic Democ­racy: thank you, and goodbye.

If you’d like to con­tact me about Dynamic Democ­racy (or any­thing else), you can still do that here. If you’d like to help get the Dig­i­tal Econ­omy Act repealed, please vote up and com­ment on one of these ideas on Your Free­dom. If any­one would like use of dynamicdemocracy.org.uk until my own­er­ship expires in 2012, let me know. Stay tuned for the announce­ment of another project that bridges pol­i­tics and the inter­net in the next few weeks.