Friday, December 13th, 2019 at 11:28 am - - Whipping

It was like an election between the nineteenth century novelist Jane Austen and Marie Antoinette who was running on the slogan: “Get Brexit Done, then we can have Cake!”

There will be no cake since the whole point of Brexit is to stop the imports of sugar and flour. Maybe this will unleash our revolution.

Now I’ve been on a lot of anti-Brexit marches in London. They don’t work; the politicians go on holiday and don’t hear a sound. Extinction Rebellion with all their road blocking hardly makes a dent on the normal traffic congestion. And labour strikes require a huge majority of a set of people who are all doing the same job to quit at the same time, which is very difficult to organize even when here are the right circumstances.

When any of these three actions are undertaken and don’t gain any result, it is demoralizing and self-weakening. It cannot be repeated again and again.

But there was one action that happened during this election that so many people got involved in, which was canvassing. In the last three weeks I’ve been door knocking and board running in Barrow, Lancaster, Bolton, Runcorn, Crewe, Clwyd and Aberconwy (all but Lancaster were lost).

Everyone I went out with, mostly just random people concerned about the political direction of this country and felt they had to do something, seemed pretty reasonable, thoughtful and politically informed.

The voters in their houses watching telly, however, were astonishing.

Now, you’re not supposed to say that all these people who want their Brexit done are stupid, but let me put it this way: People were promised various things in order to persuade them to vote for Brexit in 2016. (It’s not important what these things are, or what each of these persuaded voters personally believed, but it included things like: more money to the NHS, stop immigration, take back control of some unspecified laws from Brussels legislation, and so on.)

But get this: To a man and woman who said to me that they wanted their Brexit done, they have literally forgotten what it was they were hoping to get from it. I have combed through every ad from the Conservative Party and the Brexit Party, and not a single one says what Brexit is going to do for us either. (Although, to be fair, some say it’s going to “unleash our potential”.)

It is very much like you going out the door and down to the shops, and forgetting what it was you’re supposed to be buying. And I say: “What the hell are we continuing going towards the shops for when we don’t know what we want to buy? Why don’t we turn round and go home?”

After doing this a few times, people generally discover how to use a shopping list.

As Mark Lander of the New York Times said in The Daily podcast about the fix we are now in, this country is going to experience two major hang-overs as a consequence of this. The first hangover is that Brexit won’t be done on the 31st January 2020; that’s just the beginning. And the second hangover will be when we discover just what kind of US-vassal state, Singapore-on-Thames style Brexit the Tories in charge have signed us up for.

Congratulations. You went down to the shop to buy some oats, and you came back with a bag of Polonium. Now everyone in the house is sick and going to die. Be careful what you vote for.

Here’s a political action that could be organized.

On the anniversary of this election campaign next year, we ought to do some mass canvassing of the kind we were doing during this election. Pick some new Tory constituency with its hospitals and schools in crisis, round up 5000 or so people from around the country who have an interest because they have to live under this Tory administration, and organize board runners, door knocking, questions, surveys, and visits every house in the district on a single day, and get all the data from the ground about how people are feeling. Perhaps there is a candidate who can put their name on the leaflets, but it should mostly be about providing some PublicWhip type news-sheet about some of the most egregious things their MP has voted on recently in Parliament in their name that they have no idea about.

For this to work, we need some better software. I did get to spend an afternoon entering data from the board running sheets into the diabolical Contact Creator software, which some old duffers in Labour Party have contracted from Experian and probably thinks is ace. They spent half a million quid on it in the last few years. Here’s one of the invoices.

It seems to be a some kind of crappy customer-tracking [touchpoint] software, except it doesn’t track any customers because there’s no evidence they’re matching up voting data when people move. Here’s an even more crappy youtube promotional video from when it was launched in 2008.

There was also a web-app called Labour Doorstep, which did its best to interface to some API in Contact Creator software to make it portable, but there is only so much it could do when the underlying system is so awful. Most of the time it didn’t work.

Now, what you really ought to do is start with the web-app and base it on mapping from OpenStreetMaps. In some parts of the country (eg in parts of Runcorn) every house number assigned to a building outline, which means you can find your way around through all the addresses. This is particularly essential in places where there are stupid house names instead of numbers, like you get everywhere in Llanfairfechan. It would not take long to code up, and the OSM editor could be embedded into the app.

A phone-app could also be sharing live positioning with all the other door knockers in your team, so you’d get little dots of where people are and you won’t keep losing them. This tech is really easy to do through the internet.

How about this: you click on each building that is in green, and residents and their information pops up with some checkboxes for you to fill in when you are conversing with them at the door. Then, when you save the data the building polygon goes blue on the map, so no one else visits it. With 5000 people spread out through a whole constituency using their phones like this, they could do about ten houses each, have decent conversations and find out what’s going on out there, and maybe have time to move on to the next constituency in the afternoon.

You know, this would be rather edgy. It would get something done. You don’t need an insane number of people to participate, and then get ignored. It would be cumulative, and empowering. The Conservative Party would get annoyed and try to ban it, which is when it would get interesting.

We are expecting them to bring in Parliamentary gerrymandering and unnecessary voter-ID laws to suppress the turnout during this term. But when they try to ban citizens talking to other citizens about who they should vote for, that’s something that can be directly fought for.

There is a lot of anger out there, which is being mis-directed and then amplified by the billionaire press we have around. Door knocking is not usually like this, but here is an example of a bad one, which the individual was evidently proud of:

This can’t be healed if we leave people in their boxes, self-medicating on manufactured outrage and anger.

Monday, November 25th, 2019 at 3:44 pm - - Weekends 1 Comment »

The Toxteth Day of the Dead just happened on November 23. Here’s a picture from the final scene down in St James Park below where I live, where eight people were being mumufied. [larger image]

This was the culmination of a mysterious procession around the streets of Toxteth with various events, like singing choirs and speeches about famous dead people from the area, such as Tony Bradshaw:

There are a lot of little things that can be weaved together, such as a poetic rendition of something from Arthurian legend at the junction of Merlin Street:

It is a truism that, if there is no god, then all sacred rituals must be made up by humans. We are human. Therefore we should make up sacred rituals that work for us. The purpose of these rituals is to raise our consciousness of reality, and of life and death. Otherwise we will be so completely distracted by petty things that we will waste the time that we are alive, which will make us oh so sad when we suddenly realize what we have done.

At one stage in the afternoon we were all given little strips of white cloth and a marker pen on which to write the name of our ghost for the day, someone who is dead whom we dearly miss. Everyone has one. Then we’d pin their name close to our heart and they would be present with us during the remains of the procession, sharing the company and the fun we are having. You can spot them in the two pictures above. Then the last few hundred metres of the procession as we went down Canning Street and into the boneyard below were taken in silence to be with our ghosts, before we had to say goodbye to them, take them off and leave them behind in a basket.

I only live here. I didn’t know any of this was going to happen. My sister spotted this and got us tickets for the Here-after Party, where there was some crazy music:

In return I took her out canvassing for the Labour Party in Crewe and Nantwich.

This is where politics gets real. Knocking on doors of random strangers up and down the streets you have been assigned to ask why is it so goddamned hard to vote against a lying cheating tool of the billionaire class and the most right-wing and immoral government of our time with no plan for the future, but is however fully aligned with foreign forces that intend to end life as we know it in this land, and in favour of a guy who is honest, gives a shit, knows real history, and can’t be bought to sell you out.

The second photo is a selfie from outside the Costa Coffee in Crewe market square where me and Aidan were market-testing my PublicWhip app for advising people how to vote based on parliamentary policies during the 2008 Crewe and Nantwich by-election. My contemporaneous blogposts are The Public Whip Crewe and the The Public Whip Crewe Two.

After lunch in a polish restaurant to recover our senses, we played on some musical see-saws in a square behind the covered market.

What a long mysterious unexpected scary adventure this is all turning out to be.

Everyone I meet seems to be good, so why are we ruled by such bad people?

Wednesday, October 30th, 2019 at 6:44 pm - - Whipping

The BBC completed its China: A New World Order series with an exercise in political propaganda so ham-fisted that it rivaled the Chinese State TV on a bad day.

Remarkably, it asked the audience to be sympathetic to the greed of multi-billion dollar gene patenting US agri-corporations, and against the availability of cheap and plentiful solar panels.


So, after ten minutes of Chinese dictator footage, we get served the appetizer.

(more…)

Tuesday, October 15th, 2019 at 5:12 pm - - Kayak Dive

Someone who had been reading my blog wanted me to take them kayak diving with their Hobie Tandem Island. It’s a ridiculous object. Why would they call a thing that’s supposed to go places on the water an island?

I nominated Llandudno Pier for the dive, as it was not so far away to drive, nobody else dives it (it’s missing from the otherwise flawless North Wales Dive Guide), and there was nearby slipway access. The thing is so heavy that it needs to get into the water off a set of trolley wheels… which is required in addition to the boat trailer used for transporting it behind a car.

After several cancelled weekends we went out last Sunday in the pouring rain because we were tired of putting it off. Becka was with Chris on the Island, his son came out a Hobie MiragePeddleboard, and I was on my sensible Ocean Kayak Scrambler XT Dive Kayak with has no moving parts whatsoever, which explains how it’s lasted us 17 years so far.

We got out, anchored on the far side of the pier after 3 attempts to get it to bite, and went straight into the water. There was a lot of difficulty getting Chris’s sidemount tanks attached and the lanyards they hung off the boat from released in the strong current. The procedure requires more thinking. Normal single-hull kayak diving is simple.

Aside from the lack of slack, the water was not half bad with visibility far better then the anticipated pea soup. Lots of leathery starfish, sponges and anemones on the ironwork. I lined off the anchor.

I kept the dive short and avoided proceeding too far into the metalwork mess under the pier, as turning around and going downcurrent is always trickier than you’d think because you’re out of control and embedded in the cloud of silt you’re kicking up.


Back on the surface the rain was hammering down. It was easier to climb back aboard now that the anchor was loose and we were drifting with the current.

I had a brief ride on the peddleboard, but then someone thought it looked more fun and came to steal it from me.

This left me peddling the Island with its twin fish fins drive.

Then we unfurled the sail and got underway.

Keep peddling.

I had to look underneath to see what was going on.

I’ve no idea how I’ve never seen this thing before. It’s fascinating. And it would for sure be broken in a few months in my careful hands.

Thursday, September 12th, 2019 at 1:52 pm - - Whipping

One of the primary advantages told to us of Brexit is that it permits the UK to instruct its own civil servants to negotiate new international trade deals, and not have the work done by the EU civil servants.

How’s that getting along?

Let’s go on the Gov.UK website to “Find out which new trade agreements will be in place if there’s a no-deal Brexit”.

We’ve got listed, in approximate order of importance, South Korea, Switzerland, Israel, Iceland and Norway, Chile, the Andean countries, Carribean, Central America (does not include Mexico), Eastern and Southern Africa, the Pacific states, the Palestinian Authority, the Faroe Islands, Liechtenstein.

There are 26 other countries or trading blocks listed as “engagement ongoing” where we’ve got nothing.

Let’s take a look at what’s actually been done in the last three years.

Here’s a bit from the UK/Chile Agreement of 6 February 2019:

Basically this says:

At moment of Brexit the provisions of the EU-Chile Agreement (including the instruments referred to in Article 206) are incorporated here, but modified so it is as if it had been signed between the UK and Chile in the first place, except for what’s written here.

One of these exceptions (Article 5) is that references to the Euro are not going to be changed to UK Pounds, even though an Agreement between the UK and Chile would have obviously used UK Pounds.

Here’s that aforementioned Article 206 of the EU-Chile Agreement:

Pretty boring. Most of these treaties are 95% Annexes listing every kind of product and material.

(more…)

Tuesday, September 10th, 2019 at 11:47 am - - Kayak Dive

The Jurassic coast has been the top of my list for a big kayak diving adventure for a while. Enough so that I invested in a copy of a 2015 guidebook called Dorset Dives (review article), which is more of a picture book with some dodgy dive site information, rather than a quality guide book with some crappy photos to break up the text.

It was not great weather at the start of September, but this is the time to take advantage of the gap between the start of the school term and the University term when the season is winding down. We’re trying to economize now that Becka is working half-time and has too many days not to “waste” being at home.

We drove down to Reading on Tuesday 3 September and then on to Durdle Door Holiday Park (via a grumpy dive cylinder filling station on Swanage Pier) with two dive kayaks on the roof, two full sets of dive gear including four tanks, three drysuits, two wetsuits, a cheap pop up tent, a trangia cooking stove and two bikes rammed into the car getting crushed by all the stuff slumping onto them. We had to return after we set off to pick up the sleeping bags I’d forgotten.

The tent pitching ground is in a crow-infested forest. Crows poop just as much as pidgeons, except it’s brown so you don’t see it on the ground. They also make a lot of noise. We walked down to Durdle Door and attempted to walk barefoot on the gravel beach to Bat’s Head. This hurt too much, so we put our sandles back on, which instantly filled with gravel and didn’t make much difference. We got changed and swam through the Bat’s Hole (natural arch) to the other beach and felt better for the cold water experience.

That evening we walked to Lulworth Cove where the chip shop was already closed, but the pub wasn’t.

Thursday 5 September was calm enough weather to kayak-dive out of Lulworth cove going west towards Durdle Door. Going in the other direction was not allowed as it’s a live firing range on weekdays.

First dive was on a promising looking reef out from Bat’s Head called The Cow. The other reefs in the same line with Durdle Door are: The Calf, The Blind Cow, and The Bull. There was nothing interesting on The Cow, so we gave The Bull a miss and went straight to the dive on Durdle Door, where the guidebook says this:

(more…)

Saturday, August 31st, 2019 at 3:13 pm - - Canyon, Hang-glide

The dates were set by Becka planning to spend one night in Interlaken on Friday 2 August between four weeks on the CUCC caving expedition in Austria and a one week caving expedition up a hill called the Sagistal to the east of the city, followed by a weekend at Sinterlaken the Swiss Caving Congress. This was then intended to lead into two separate week-long caving expeditions back in Austria (Plankamira and Datchstein), capped by a caving holiday down in the Ardeche in early September. However, I said: “Could we do something together that’s fun for me, because you ought to have got enough caving done by then?” and so, at great sacrifice, a canyoning holiday was scheduled.

I drove out to Interlaken on my own with my hang-glider on the 30 July, booked into Manor Farm 1 at £28/night for a narrow slot, and showed up the next morning at the Landplatz Lehn where I knew there was an english professional tandem pilot employed by hang-gliding interlaken to fly tourists off the hill at the rate of up to six flights a day, which is a heck of a lot of work.

Their van took me up to their favourite Amisbuhl takeoff between the trees (the taxi rate is 7Fr), helped me over the tedious 15 minute carry up a private road, and took three complete rounds of passengers airborn in the time it took me to set up and stand on the edge gibbering about doing a nil-wind takeoff. I have an experience of completely screwing these up with two crashes on take-off at Ager last year.

They say they have 300 flyable days at Interlaken, which is true because there’s enough shelter that they can fly in almost any condition, between bands of rain and cloud. They’re not all good flyable days.

(more…)

Monday, August 12th, 2019 at 3:58 pm - - Flightlogger, Hang-glide

I thought I had published this long form article in the blog until I looked for it. Turned out I’d accidentally left it on github here. Text is below the fold.

(more…)

Monday, August 12th, 2019 at 3:32 pm - - Hang-glide

After many days at Interlaken, generally flying down from various takeoffs and ramps, I got the opportunity and nerve to finally fly at Fiesch, where I got to see over the glaciers.

Flight 1 was easy; up and across the ridge into the Goms valley, thus saving me from the landing field at the bottom of takeoff. At the end of the flight I was caught in the convergence in the middle of the valley that took me back to 2800m. The only way down was to go to the edge of the valley and circle down.

Flight 2 was harder as I had to get really high first and then there was no lift for miles along the side of the valley until I was saved by a very slow climb on a particular ground collapse. There were some moments of zero-G on that flight. No matter how high I got, there were still always rocks above me.

Saturday, July 27th, 2019 at 8:20 pm - - Flightlogger

I’ve been trying to use the BNO055 for hang-glider experiments for a while. My current serial micropython interface is here or here. The sensor contains its own dedicated microcontroller that continually reads the gyros, accelerometers and magnetometers at a high frequency, fuses them, and provides orientation in the form of a quaternion, and acceleration separated into it’s kinetic and gravity components. (I’d prefer a version where you set the device working, and it streamed the measurements down on the wire instead of needing to be polled every 100ms.)

After years of not really having a clue, I’ve got far enough to be able to make a movie with these frames from an overhead unit attached to the keel of the glider with the intention of measuring the control inputs (ie the pilot’s hang position which determins his weight shift) in relation to the aerodynamic response.

There are two objectives of this work — other than the byproduct of learning a whole load about sensors that ought make me useful for something.

Firstly, we’d want to quantify the hidden variables of a glider (eg glide angle, control responsiveness, etc) in order to better compare between them.

Secondly, I want to quantify pilot behaviour and rig this up on a flight by a top pilot who always seems to do well, and find out what they’re doing that’s different from what I’m doing in order to enable some form of effective coaching that would save me a lot of time. (Generally the top pilots don’t know what they’re doing as they merely report doing it by feel, and that feel very luckily for them happens to coincide with doing it right.)

However, I don’t really trust these accelerometer readings when I watched this. It seemed like it was sticky. That is, its mathematical filters sometimes hold one value until it is no longer valid, and then swings wildly to another other value.

GPS readings sometimes do this and have nasty discontinuities. This is going to happen when there are bimodal probability distributions of the error where there are two likely interpretations of the position from the same measurments.

Meanwhile, I was looking at namespaces in OpenCV and the function findChessboardCorners() caught my eye. I wondered what that was for. Turns out it’s used for Camera calibration — finding lens distortion and focal length.

Then I found out about ArUco Markers and tried to use them for measuring the pilot’s position (see above).

That didn’t work on half the frames because the light catches it badly.

This lead onto the amazing all-in-one charuco board technology which has an aruco tag in each white square of a chess board so that nothing can possibly get confused.

This is great, because it gives an external means of verifying the absolute orientation sensor. If I could get the numbers to agree, then I’ll have proved I’ve understood all the orientation decoding and would know the error bounds.

My code is in this Jupyter notebook, though the bulk has been moved into the videos module of the hacktrack library for safekeeping.

Here’s the procedure, with the unit up top under my thumb containing the orientation sensor, the video camera embedded in the main unit (with the orange light visible to show that it’s working) looking down past the randomly flashing LED light.

And this is what it looks like from the camera’s point of view:

The phone is running a very crude android app I wrote called Hanglog3 for receiving the orientation sensor data via wifi over a socket from the ESP32 attached to the sensor and storing it in the phone’s copious memory, so I don’t need to use a mini-SD card writer wired to the microcontroller that causes it to stall for up to 80ms when the data is flushed to it.

What’s that LED light doing in the view?

That’s used to synchronize the logged orientation data with the frames from the video. I’ve made an interactive function called frameselectinteractive() that lets you slide a box around the LED in the image, like so:

Then the function extractledflashframes() measures the mean red green and blue values in the box for each frame so you can see that there is a clear enough signal.

In this case, the 200 value in the red channel shows a clear enough signal, which can be converted to a boolean on or off, and aligned with the timestamped LED on and off commands in the flight data file that also carries the orientation sensor data. I’ve used the Dust measurement records from this to save reprogramming anything, as the Dust sensor no longer exists (it was a ridiculous thing to carry around on a hang-glider anyway; what was I thinking?).

videoledonvalues = ledbrights.r>200
ledswitchtimes = (fd.pU.Dust==1)  # one timestamped record for every on and off of the LED
frametimes = videos.framestotime(videoledonvalues, ledswitchtimes)

Since the LED flashes at random intervals, there can be only one way to align them, which allows me to assign a timestamp to each video frame, and consequently to any information derived from that video frame, such as camera orientation.

The function which extracts camera orientation from the video frame is findtiltfromvideoframes().

The code which does this from an image frame works like this:

# extract the DICT_4X4_50 aruco markers from the image
markerCorners, markerIds, rejectedMarkers = 
  cv2.aruco.detectMarkers(frame, aruco_dict, parameters, cameraMatrix, distCoeff)

# try harder to match some of the failed markers with the knowledge of 
# where they lie in this particular charucoboard
cv2.aruco.refineDetectedMarkers(frame, charboard, markerCorners, markerIds, 
                                rejectedMarkers, cameraMatrix, distCoeffs)

# derive accurate 2D corners of the chessboard from the marker positions we have
retval, charucoCorners, charucoIds = cv2.aruco.interpolateCornersCharuco(markerCorners, 
     markerIds, frame, charboard, cameraMatrix, distCoeffs)

# Calculate relative camera to charuco board as a Rodrigues rotation vector (rvec) 
# and translation vector (tvec)
retval, rvec, tvec = cv2.aruco.estimatePoseCharucoBoard(charucoCorners, charucoIds, 
                                            charboard, cameraMatrix, distCoeffs)

# Convert rvec to single vector of the vertical Z-axis kingpost
r = cv2.Rodrigues(rvec)[0][2]
row = {"framenum":framenum, "tx":tvec[0][0], "ty":tvec[1][0], "tz":tvec[2][0], 
                            "rx":r[0], "ry":r[1], "rz":r[2]}

Notice that this cannot work without accurate values for the cameraMatrix and distCoeffs (distortion coefficients), which in the case of this camera has been calculated as:

cameraMatrix = numpy.array([[1.01048336e+03, 0.00000000e+00, 9.46630412e+02],
                            [0.00000000e+00, 1.01945395e+03, 5.71135893e+02],
                            [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]])
distCoeffs = numpy.array([[-0.31967893,  0.13367133, -0.00175612,  0.00153122, -0.03052692]])

These numbers are not fully reproducible. However, they do make the picture look okay with the undistortion preview where straight lines look straight. Maybe there are too many degrees of freedom in the solution.

Now the hard part. The camera and the orientation sensor are not precisely aligned.

First the vertical axis of the orientation sensor, whose values are given in quaternions (pZ.q0, pZ.q1, pZ.q2, pZ.q3) needs to be extracted to provide a tilt-vector (of the Z-axis):

r00 = pZ.q0*pZ.q0*2 * pZ.iqsq
r33 = pZ.q3*pZ.q3*2 * pZ.iqsq
r01 = pZ.q0*pZ.q1*2 * pZ.iqsq
r02 = pZ.q0*pZ.q2*2 * pZ.iqsq
r13 = pZ.q1*pZ.q3*2 * pZ.iqsq
r23 = pZ.q2*pZ.q3*2 * pZ.iqsq
pZ["tiltx"] = r13 + r02
pZ["tilty"] = r23 - r01
pZ["tiltz"] = r00 - 1 + r33

Then the (rx, ry, rz) vectors from the video camera images needs aligning to the (tiltx, tilty, tiltz) vectors from this orientation sensor.

I have no idea how I cracked this one, but it went a bit like this:

# kingpost vertical vectors from camera
rx, ry, rz = tiltv.rx[t0:t1], tiltv.ry[t0:t1], tiltv.rz[t0:t1]

# Interpolated orientation tilt vector (so the timestamps are the same) 
ax = utils.InterpT(rx, lpZ.tiltx)
ay = utils.InterpT(ry, lpZ.tilty)
az = utils.InterpT(rz, lpZ.tiltz)

# Find the rotation between these two sets of points using SVD technology
# a[xyz] * r[xyz]^T
H = numpy.array([[sum(ax*rx), sum(ax*ry), sum(ax*rz)], 
                 [sum(ay*rx), sum(ay*ry), sum(ay*rz)], 
                 [sum(az*rx), sum(az*ry), sum(az*rz)]])
U, S, Vt = numpy.linalg.svd(H)
R = numpy.matmul(U, Vt)

print("Rotations in XYZ come to", numpy.degrees(cv2.Rodrigues(R)[0].reshape(3)), "degrees")


# Apply the rotations to the camera orientation
rrx, rry, rrz = \
(R[0][0]*rx + R[0][1]*ry + R[0][2]*rz, 
 R[1][0]*rx + R[1][1]*ry + R[1][2]*rz,
 R[2][0]*rx + R[2][1]*ry + R[2][2]*rz)

In this case, the rotations in XYZ came to [ 0.52880368 0.96020647 -80.29792978] degrees.

Thus, since I am now thoroughly running out of time, here is the comparison in XY of the unit vectors:

And this is how it looks to the individual components:

I am totally going to forget how any of this works when I get back. It is this hard to validate an orientation sensor against a video image, it seems.

Next is to make a charuco board with a flashing light in it with its own orientation sensor and pin it to the back of the pilot’s harness. Then maybe I’ll be measuring the glider relative to the pilot rather than the other way round.

All of this is so hard, and the main objectives haven’t even begun. Why is it so hard to get anywhere?