Excel’s pants

I want to make a 3D graph from my flight stats i.e. given 3 columns, says X, Y and Z from the ground facing video (x 2) and down-facing LiDAR, I want a 3D picture.  It turns out you can’t just plug in these 3 columns into a 3D surface chart, you need a mesh which Excel doesn’t support directly, so you have to purchase another app; the first one I stumbled across was called XYZ MESH which cost $90 for a single user.  So instead I’ve done a simple version with 85 lines of python code.

Python Excel Mesh

Python Excel Mesh

These are the results of another square flight this morning.  There’s lots more that can be done such as working out how XL chose these colours, and getting the points to join up, but this is the hard bit done.  Here’s the code.

import csv

min_x = 0.0
max_x = 0.0
min_y = 0.0
max_y = 0.0

with open("3DSquare.csv", 'rb') as fp_csv:
    fp_reader = csv.reader(fp_csv)
    row_num = 0
    data = []
    for row in fp_reader:
        if row_num == 0:
            column_num = 0
            for column in row:
                if column.strip() == "qdx_fuse":
                    x_index = column_num
                elif column.strip() == "qdy_fuse":
                    y_index = column_num
                elif column.strip() == "qdz_fuse":
                    z_index = column_num
                column_num += 1    
            print
            print x_index
            print y_index
            print z_index    
        else:
            x = float(row[x_index].strip())
            y = float(row[y_index].strip())
            z = float(row[z_index].strip())

            if x < min_x: min_x = x if x > max_x:
                max_x = x
            if y < min_y: min_y = y if y > max_y:
                max_y = y

            data.append((x,y,z))

        row_num += 1


x_increment = (max_x - min_x) / 250        
y_increment = (max_y - min_y) / 250        

print row_num        

map_dict = {}
x_dict = {}
y_dict = {}
for (x, y, z) in data:

    x_index = int(round(x / x_increment))
    y_index = int(round(y / y_increment))


    x_dict[x_index] = True
    y_dict[y_index] = True
    map_dict[(x_index,y_index)] = z

lines = []
line = ""
for x in sorted(x_dict.keys()):
    line += ", %f" % x   

lines.append(line + "\n")   

for y in sorted(y_dict.keys()):
    line = "%f" % y

    for x in sorted(x_dict.keys()):
        if (x, y) in map_dict:
            line += ", %f" % map_dict[(x,y)]
        else:
            line += ", "

    lines.append(line + "\n")

with open("mashed.csv", "wb") as mash:
    for line in lines:
        mash.write(line)                

The reason I want this will become clear tomorrow as part of my last post for a week while I’m at Disney.


Ah, that looks better…

Way cooler!

Way cooler!

Pi Zero – first impressions

For a headless robotics platform for Phoebe and Chloe, it’s nigh on perfect.  I have no idea how the A+ PCB has been shrunk by a factor of two, while providing the same function with more memory. It’s also really thin due to shrunk / removed connectors. And more flexible by not preinstalling the GPIO connector and leaving that up to the user to best fit their application. There’s really nothing more to say*; for the next generation quadcopter, it’s amazing.

However, for a fully fledged desktop computer, I’d still go for the RPi2.  Although the Pi Zero is only £4 compared to the Pi2 at £30, once you’ve thrown in the necessary USB and HDMI adapters (£4), a 4-way powered USB hub for keyboard, mouse and WiFi (£12 for a decent branded one) and perhaps a USB ethernet adapter (£8), you’re looking at £28 total.  For the extra £2, the RPi2 gives you all that along with double the memory (1GB) and 4 CPUs too!


*Being picky, there is more to say – because the Pi Zero fails miserably to fulfil the super cheap desktop role, I’d rather pay more for a Pi Zero as a better headless robotics platform, and get a 1GB, 4-core version. Also, even for the headless usage, you still need the powered USB hub to give you keyboard, mouse and internet access for all the initial configuration and app installation. But at least that’s a one-off – a single hub can be used to install however many Pi Zeros you want. And as always, in my rats nest of spares I have a couple of 10-port USB hubs kicking around.

Howdie Folks!

This site got a whole months worth of hits last night due to ping backs to my BYOAQ-BAT articles triggered by the launch of the new Pi Zero.  Welcome to PiStuffing, one and all.

My name’s Andy, Hove is a nickname from school that’s stuck.  The blog is mostly about my quadcopter project, with a few other side-projects included for variety.

My quadcopters, Phoebe and Chloe, are very much experimental; they’re written in Python running on a RPi A+ running the Jessie Raspian OS.  With the release of the Pi Zero, I hope to add a new member to the family soon.  When I started the project 3 years ago I knew nothing about the details of how quadcopters work, and so I set about working it out for myself from scratch.  Hence they are unique.  Phoebe and Chloe both run off pre-configured flight plans, no remote control.  Ideally, they should have GPS, altimeter and compass to be truly autonomous, but currently they only have an accelerometer and gyroscope, and so their flights only last a few seconds before they start drifting away from the flight plan.

Probably the best way to see progress is to check out the videos on Vimeo like this one:

Progress is now very slow now and the posts are pretty dull as they are full of tedious tiny details.  But there are interesting gems amongst of the noise – have a look at the front page to see if anything catches your eye!

Every man needs a castle…

a shed, a cave to retreat from the chaos of the rest of the family house.  This is my home office – the home of every inanimate object I rely on. But in this picture, I’ve kept it Pi focussed.  There are nine Raspberry Pi’s in this ordered chaos.  Can you find them?

Shed

Shed

There are 3 more RPi’s outside of the scope of this photo, two for the upcoming Cotswold Raspberry Jam, and one is my piPad.

Spoiler alert: one of nine is hinting at what Santa’s present to me in December will be.

Falling interest rates

🙁

Falling interest rates

Falling interest rates

Things are going to be moving a lot more slowly from now on. The current plan is to get motion tracking working on Kitty, and ultimately merged into the HoG code when the A2 is available; that’s currently pending a new E-paper screen as the one previously pictured turned out to be faulty (no fault of Percheron Electronics).

Other than that, there’s the Cotswold Raspberry Jam, and hopefully imminent arrival of a PaPiRus screen and Flotilla.

I suggest anyone who would still like to still follow the blog without checking it out daily should sign up to the RSS feed.

9.8696044010893586188344909998762…

Just in case you live on a different planet, you might not have noticed the Raspberry Pi 22 geddit) was released today.

Raspberry Pi 2

Quad-core Cortex-A7 processor with 1GB RAM (twice the B+), yet fully back-compatible with every previous Raspberry Pi.

Sadly the π2A+ won’t be out until the end of the year, so I’ll have to wait for the point when my Quadcopter code runs fast enough to pick up every sample of data delivered at 1kHz by the IMU.

Raspberry Pi B+ launched

In stock now at CPC / Farnell / RS

Cases from Pimoroni.

I already have both on order.  For me the advantages are

  • 4 USB ports – no need for a USB hub for keyboard, mouse, WiFi dongle + A.N.Other
  • reduced power usage
  • all GPIO pins now exposed
  • Better audio quality and 4-point jack for compsite video
  • Better connector layout
  • micro-SD card, so no sticky-outy bits

First thing I’ll be doing is replacing my GeneralPi and disposing of the USB hub – a much tidier desktop with fewer wires.

CamJam

Scary Mug Shot

Scary Mug Shot

I went to the Raspberry Pi Jam in Cambridge yesterday, and really enjoyed it.  Lots of interesting presentations, lots of kit for sale, interesting projects to chat with people about and a nice relaxed atmosphere.  If you have a Jam near you and haven’t been to one yet, go along and have a look.  I really enjoyed it!

If you were there, and didn’t spot me, here’s a scary mug shot for next time!