Category Archives: Exercise

Barcelona Triathlon 2017

Had a great day in Barcelona today at the Barcelona Triathlon.

The sea was calm, very little wind and sunny.

The sea was easily warm enough to swim without a suit, but I decided to wear mine anyway to help with buoyancy to keep the legs up. Off the beach start went well starting just behind the front to not get run over in the surf. I was well up the field by the first mark of the q shaped course, and by the end we were deep into the back of the previous wave. The watch measured 1625m in 27mins which is on a par with the times I’ve been doing in the pool recently.

T1 went smoothly and on to the ride. The course was pretty flat, not too technical and draft legal for the whole field. I managed to average 34+kph and spent most of the time hopping between groups. Ended up about 1:08

T2 again went smoothly and there was a surprisingly small number of racked bikes, then on to the run. This was a hard slog, along the beach before heading up towards the centre of the city. By this point it was starting to get properly warm pushing up towards 29degrees. The last 200m included a steep ramp up from the beach side path to the board walk area which I really could have done without, but managed to get round in less than 50mins.

Total time by my watch 2:30:01 (so close!). The official results say 2:30:03

The only down comment for the day was the arrangement of the starting sequence. Transition was only open from 6am-8am with the first start at 8:10am. This was a small wave of VIPs. Then 2 more waves at 10min intervals, followed by 20+min break before 3-4 more waves, another 20min break then the next batch of starts. So my start in wave 10 was at 9:50, nearly 2 hours after transition closed so a fair bit of waiting around. The rest of the organisation was great.

Update on Garmin Forerunner 935

It’s been a few weeks since I picked up my Garmin Forerunner 935. I must say I’m pretty impressed.

Step counting

I’ve been using it to record my day to day step count and all day heart rate data as well as all my training and the London Triathlon.

The battery life is great, I’m getting a good 2 weeks out of a charge even when using it to record activities with GPS and ANT+ sensor data. It seams to take about 2 hours to fully charge.

Having it sync with the phone is useful as it means I don’t need to keep a Windows box kicking around just (OK, I do still need one for Zwift but that is less regular) to run the Garmin Connect application to upload my workouts to the web and Strava. There is built in WiFi support as well which can allow it to sync without having the phone, I’ve not enabled this at the moment as even if I’m not always carrying my phone while training it is pretty much always going to be around when I get back.

Another change is that the ANT+ sensors now live in a collective pool rather than being bound to something like a bike profile so you don’t need to remember to pick the right profile if you have multiple bikes. The watch will just pick all the relevant sensors it can see as you select the activity type. The only downside I can see to this is if you lend somebody a bike and both go riding at the same time. To get round this you can force it to pick one if it can see multiple versions of the same sensor. But it does mean I don’t need 3 different profiles, one for the Propel, Defy and the Defy on the turbo trainer.

Rest indicator

The new training tracking feature is also helpful, giving indications of how much rest time you should take between activities and also a training load number. The training load number is supposed to unique to each user so not something you can compare with others, but should show if the system thinks you are over training (looks like I need to back off a little)

Training Load

The only extra I have purchased is a glass screen protector as I managed to get a very small scratch in the plastic face on the first day wearing it. I’ve no idea how it did it as I doing remember knocking or catching it against anything. The protector is very thin and fits nearly flush with the bezel and you can’t tell it’s there. Given I’m planning on wearing this as my day to day watch as well as for activity tracking this is a little disappointing, but this is probably why it’s cheaper than the equivalently spec’d Fenix 5.

London Triathlon 2017

As I mentioned in the last post, I did the London Triathlon at the weekend. I got round in a total time of 2:40:33 which is 3min quicker than WTS even in Leeds I did about a month ago. I’m slowly working my way back towards the sub 2:30:00 times I managed in 2015.

The weather forecast changed all week but always with rain at some point in the day, early on it looked like it might stay dry until at least the run, but this was dashed when I got properly soaked while riding from Leytonstone down to Excel before the start.

As usual The London Triathlon runs a number of different courses over the weekend, I was racing the “shortest” loop version of the Olympic distance which was made up a 2 lap swim, 4 lap bike and a 4 lap run.

The “long” loop version on Sunday morning is a 1 lap swim and a 1.5 lap bike (down to Parliament and back) and a 3 lap run which I’ve done a couple of times before.

Swim

There was a break in the rain just in time for the start of the swim

The 2 lap swim has it’s good and bad points over the 1 lap version

  • good: you can see the between all the turning buoys. For the 1 lap version you can’t see the first buoy from the start line.
  • bad: Waves set off in 2 halves with 2 mins between halves and 20mins between waves, which means that as you start your pretty much straight into the back of the mid pace swimmers from the wave before on their second lap. Also with the shorter legs the waves don’t spread out as much so the was a lot more bumping and jostling all the way round and especially at the run in to the exit.

Ride

By the time I was out of the water and on to the bike the rain had well and truly kicked back in. The course was a 10k loop between 2 roundabouts, but the turns were the short way round the which made them very tight, this combined with a little technical section just west of Excel made for some treacherous areas. The course was pretty much pan flat except the climb over the flyover just before the first turn. I averaged 30kph, over the 40km which is OK considering how wet it was.

Run

It stopped raining again for the run which is again nearly totally flat, apart from the climb up into the Excel each lap to pass the turn to the
finish straight. The indoor loop was a bit longer this year.

The new Garmin 935 worked really well, the triathlon mode is very similar to the 910XT with the lap button being used to move between disciplines. One feature that I think is new is the ability to set the auto button lock on a per activity basis, I used this to lock the buttons for the openwater swim. I did this because unlike the 910XT the the start/stop and lap button are on the right hand edge of the watch and as I wear my watch on my right wrist this put the buttons up against the edge of my wetsuit so I was a little worried they might get push by accident. This just meant I had to press and hold one of the buttons when I got out of the water to unlock things before pressing the lap button to signal entering T1.

Garmin Forerunner 935

My trusty Garmin Forerunner 910xt has finally been put out to pasture, 2 years ago the barometric altimeter failed and I got it replaced with a refurbed version and over the last 3 months the power button has been getting harder and harder to push. My best guess is that the micro switch has lifted off of the board so it needs to be push at just the right angle to get it to line up with the contacts and actually activate.

My Fitbit HR had also given up the ghost as well in the last few months so I went looking for a replacement that would cover for both. I looked at both the Garmin 735 and the 935. Both do step counting and have a optical HR sensor in the back. Reviews of the HR sensor on the 735 were not so great and it was missing a barometric altimeter so that didn’t help it’s case. Wiggle were also doing a week of extra discount (17%) at the time as well which helped to bring the price of the 935 down to something slightly more sensible than list price.

So as you can guess by the title of this post I opted for the 935. It arrived this morning so I don’t have a lot to say about it just yet, but the first impressions are:

Garmin forerunner 935
Garmin forerunner 935
  • It’s a lot smaller than the 910xt and even a bit smaller than the Suunto Vector that I have been wearing as a day to day watch
  • It’s also lighter than I expected, I’m used to wearing something with a bit of heft (My first serious sailing watch was a Citizen Yatchmaster which was stainless steel, when I took it off my arm used to float) to it so this it will take a day or two to get used to how light it is.

A lot of the features need a bit of time to learn my training pattern and my day to day activity profile so I’ll give it a week to bed in and write some more about it, I’m also doing the London Tri next weekend so that will be a good chance to give it a proper workout.

Both the 735 and the 935 both support the 2 new HRM belts from Garmin that support recording HR data while swimming (the HRM-Tri and HRM-Swim), while I already have a ant+ HRM belt I’m seriously tempted by both of these (mainly for the geekiness) so I may have to grab one or both soon.

Contributing to OpenStreetMap

I had a day off on Monday, there were a couple of things I needed to get done and I just needed another day out of the office.

On the Sunday evening while working out what to do with the rest of the day I happened to be looking at the OpenStreetMap site for the area round my flat. I noticed that the latest set of roads for the second phase of the development hadn’t been included yet.

As it was
As it was

I use data from the OpenStreetMap project on my Garmin Edge 810 cycle computer to provide both maps and routing information (it’s free vs paying Garmin for map packages) so I really appreciate all the work that has gone into this project so I decided to have a look at how to contribute these new roads.

I knew that people tended to upload GPS data in the form of GPX files that then got used to build the maps. The best tool I had to record the GPS data was my Garmin Edge 810 so I decided to have a quick ride round the new roads.

Strava’s preview has dropped a lot of points, but the actual track looked more like this.

gpx trace

As well as using the 810 I put my Garmin Virb Camera on to record a video of the ride. I mainly did this to catch the street name signs so I could name things properly.

YouTube Preview Image

Signing up on the OpenStreetMap site was trivial, just fill in a username and email address, then click on the link in the email that was sent to verify the address. Now I had the option to upload the GPX file. From there I followed the instructions here and use the Potlatch 2 editor to overlay my GPX trace on the existing map. I then traced on the extension of Tinning Way and George Raymond Road and added Annealing Way. I need to go back over the video to double check the names of the other new roads so I can add them as well.

OpenStreetMap tiles get regenerated from time to time so after an hour or two my updates became visible to everybody else.

After adding new roads
After adding new roads

I’ll have to regenerate the maps for my Garmin Edge 810 sometime to see if it now directs me via these new roads when I set off on my next ride.

Openstreetmap Video overlays

So as I mentioned in my last post I’ve been playing with generating map overlays for the cycling videos I’ve been making while out training. I’d run into a rate limiting problem when using Google Maps static map API.

To work round this I thought I’d see what I could do using Openstreetmap. Openstreetmap doesn’t have a static image API so I’m going to try and build something similar using LeafletJS and a way to grab images of the pages generated.

<html>
<head>
	<title>Maps</title>
	<link type="text/css" href="leaflet.css" rel="stylesheet"/>
	<script type="application/javascript" src="leaflet.js"></script>
	<style >
	#map { 
		height: 250px; 
		width: 250px;
	}
	</style>
</head>
<body>
	<div id="map"/>
	<script type="application/javascript">
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

var args = getUrlVars();

var line = args["line"].split("|");

var last = line[(line.length - 1)];

var centre = [last.split(',')[0], last.split(',')[1]];

var map = L.map('map',{
	zoomControl: false,
	zoom: 15
});
map.setView(centre, 15);

L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 
	{
		maxZoom: 20,
	}).addTo(map);

var latlngs = [];

for (var i=0; i<line.length; i++) {
	latlngs.push(L.latLng(line[i].split(',')[0],line[i].split(',')[1]));
}

var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
	</script
</body>
</html>

This generates the map tiles and overlays the route, but it’s as a web page, now I needed a way to convert this into a PNG image. There are two options, html2canvas or PhantomJS. I decided to go with PhantomJS first. The following loads and renders the page and then generates a PNG image.

var page = require('webpage').create();
var system = require('system');


page.onConsoleMessage = function(msg, lineNum, sourceId) {
  //console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};

page.viewportSize = {
  width: 265,
  height: 250
};

var url = "file:///opt/share/playing/map-overlay/index.html?" + system.args[1];

console.log(url);

page.open(url, function(){
  setTimeout(function() {	
    page.render(system.args[2]);
    phantom.exit();
  },500);
});

The coordinates for the line are passed in on the command line along with the file name to write the file to.

test

phantomjs --local-to-remote-url-access=true --max-disk-cache-size=1024 --disk-cache=true map.js [Path] [file name]

Running PhantomJS with the disk cache enabled should keep the load on the Openstreetmap servers to a minimum but I’m also looking at how easy it is to set up my own tile server.

I can now feed this in to the scripts I spun up last time.

YouTube Preview Image

DIY Video overlay

I got myself a Garmin Virb Elite in the post Christmas sales, the plan was to use it while riding my bike and when snowboarding.

The camera will shoot in full 1080p HD and has a super wide angle lens to grab loads of what’s going on.

I finally managed to get out on my bike at the weekend and remembered to hook the camera up so it was hung under the handle bars. The raw video looks pretty good.

Having got some video I wanted to overlay some of the stats from my Garmin 810 cycling computer like location, speed, elevation, gradient and heart rate. Garmin provide some software called Virb Edit which will do all this, unfortunately it only runs on Windows or OSx. No problem I thought, I’ll just throw it in the same Windows 7 VM I use for Garmin Express, the app I use to upload my workouts. This was going well until I tried to view one of the videos I’d just imported and it complained about not having DirectX 10 support. This is the bit of Windows that handles all the multimedia stuff and for video tends to need access to a GPU to accelerate things. While it is possible to get things like this to work with a VM it is a lot of work and requires the machine your using to have 2 graphics cards1.

Since the standard software wasn’t going to work I thought I’d have a go at trying to build some scripts to do this with Linux. I decided to start with a simple map overlay. I’ve played with Google Map’s static maps API before so I ran up some simple NodeJS code to read a TCX file I generated from the FIT file created by the camera.

var tcx = require('tcx-js');
var http = require('https');
var fs = require('fs');

var parser = new tcx.Parser();
parser.parse_file("test.tcx");

var tail = [];


parser.activity.trackpoints.every(function(element, index, array){
	
	var filename = index + '.png';
	var url = "https://maps.googleapis.com/maps/api/staticmap?center=" + element.lat + "," + element.lng + "&zoom=16&size=300x300";
	if (index != 0) {
		url = url + '&path=color:0x0000ff80|weight:2|' + tail.join('|');
	}
	console.log(url);


	 (function(uri,fn){
	 	http.get(uri, function(res){
	 		//console.log("statusCode: ", res.statusCode);
 //  			//console.log("headers: ", res.headers);
	 		var data = '';
	 		res.setEncoding('binary');
	 		res.on('data', function (chunk){
	 			data += chunk;
	 		});

	 		res.on('end', function(){
	 			fs.writeFile(fn, data, 'binary', function(err) {
	 				if (err) {
	 					console.log(err);
	 				}
	 			});
	 		});
	 	});	
	 })(url, filename);


	tail.push(element.lat + "," + element.lng);
	if (tail.length >= 25) {
		tail.shift();
	}

	if (index != (array.length-1)) {
		var now = new Date(element.time);
		var then = new Date(array[index +1].time);

		var diff = Math.abs((then.getTime() - now.getTime() ) / 1000);
		//console.log('%d', diff);
		for (var i=0; i<diff; i++) {
			fs.appendFile('list.txt',filename + '\n',function(err){});
		}
	}

	return true;
	
});

This worked pretty well until I hit Google’s rate limit so only got the first 100 map titles.

I used the ImageMagick scripts to build a composite image of the map tile on transparent background.

Create an empty 1920×1800 image with a transparent background

$ convert -size 1920x1080 xc:transparent background.png

Overlay the map title in the bottom right hand corner

$ composite -geometry 300x300+1520+700 1.png background.png scaled/1.png

The script also generates a file called list.txt which contains a list of the filenames and how many times to repeat them at 1 frame per second to match up with the orginal video. Using this list with mencoder to generate the video like this.

$ mencoder mf://@list.txt -mf w=1920:h=1080:fps=1:type=png -ovc copy -oac copy -o output.avi

Finally I used OpenShot to generate the composite video.

I’m going to have a look at using OpenStreetmap instead of Google Maps to avoid the rate limiting and also trying to generate some gauges for speed, cadence, altitude and heading.

1 The laptop I’m doing this on does actually have 2 graphics cards, but I’m using the better one to actually run the OS and it’s a royal pain to switch them round.

Wiggle Portsmouth Olympic Triathlon 2013

After doing the Blenheim Triathlon earlier in the year I’ve been looking have a go at something a bit further, so last weekend I did the Wiggle Portsmouth Olympic Distance Triathlon.

Olympic Triathlons are basically double all the distances of the Sprint version, so 1500m swim, 40km cycle and a 10k run.

I got round Blenheim in 1:30:02 (if I’d known I was that close, I’d have managed to sprint a little harder) so I was aiming to get round this course in sub 3 hours.

Swim 1500m

The swim was in the sea from down by Southsea Castle to the Pier. It was first sea swim and I was a bit concerned about waves and basically having my face stuck in salt water for about 30mins. The weather was pretty good and with no wind the water was totally flat. What I hadn’t really thought too much about was the tide, it was great on the 3 sides of the rectangle, just having to adjust a little as I crossed the short ends, but on the way back it was a hard slog. I stormed the first 1k in about 15mins, but the last 500m took 25mins.

Again Strava seams to be showing a strange time for the swim.

Time: 0:41:56

T1

I clocked this at 4:39 which includes the run up from the beach and I also didn’t hit the button until I’d been on the bike for about 200m so this was probably actually a bit quicker than Blenheim (4:25).

Cycle 40km

This was a really nice flat course with a long first lap up round the naval base followed by 4 laps round the sea front at Southsea. I pushed pretty hard on this leg and was pleased to average more than 30kph but was still getting passed by guys going a lot quicker on serious all carbon tri bikes.

Time: 1:16:12

T2

2:08 this time, which is about the same as Blenhiem(2:05)

Run 10km

The run was 2 laps of a loop the other way up the sea front from the cycle leg, again nice and flat apart from a really short climb up over the old defensive wall. I probably set off a little bit too quick as I had aimed for a 50min 10k and was doing 4:30 to 4:40 k’s early on, but I ended up with a total average of 4:55.

Time: 0:46:47

Total time 2:51:47

I came 176th out of 313 (including relay teams) and 46th in my age group. I was well under my 3 hour goal and I think if there had been no tide I could have taken nearly 10 more mins out of that as I can cover a 1500m in the pool in under 30mins.

One of the new challenges for this distance was working out how to take on food while on the move, as the research shows you can go for about 90mins on the reserves and carb loading before an event. I had tried a couple of flavours of gels the week before (I should have sorted this out a lot earlier) and not been too impressed with the black cherry or the chocolate orange. In the end I plumped for a lemon & lime flavoured one, I took the first one as I was starting the second lap on the bike along with a hand full of jelly babies. I saved the second one for while I was running the first lap.

I think I’m up for doing some more Sprint and Olympic distances, but I’m not mad enough to try a 70.3 or a Iron Man yet. Targets for the next Sprint is 1:15:00 and Olympic has to be 2:40:00 with a stretch of closer to 2:30:00

Blenheim Triathlon 2013

Last weekend I took part in the 2013 Blenheim Sprint Triathlon, it was my first full distance sprint with an open water swim. I had done 2 previous sprints but they had both had 400m pool based swims with no wet suites.

The first thing I’ll say is that the setting was amazing, from racking for transition in the court yard,

Racking in the court yard

To the view of the lake

Dragging the wetsuit on

To the riding and running round the grounds.

Swim 705m

I knew going in that the ride and the run wouldn’t be a problem and I knew I could cover the distance for the swim in a pool, but the mass deep water start did concern me a little and also trying to swim in a straight line with no rows of titles to follow. I was lead to expect the start would be a total washing machine of arms and legs everywhere, but actually wasn’t that bad. There was the odd finding a foot when reaching out and when rolling my head out to breath finding somebody right there that I couldn’t see though the murky water.

Time for the Swim: 14mins 15seconds.
I’m happy with that but think I’ll be able to improve on it for next time.

(Strava seams to have messed up the swim time for some reason)

T1

After the swim the 400m meter run up from the lake to transition was hard work while barefoot and trying to fight my way half out of the wetsuit. I wasted some time trying to get some socks on, but I needed them because my bike shoes are a just a bit too big to wear without them.

Time for T1: 4min 25seconds
They say transition is the 4th discipline and mine needs work.

Ride 20k

The cycle course was pretty good, it was made up of 3 laps with 2 decent climbs and lots of downhill. The only downside was because the foot bridge over the course had been hit by a bus on Friday night a compulsory dismount was added to each lap just before you got back to the palace. This messed with everybodies rhythm a bit and must have stuck a couple of mins on the time.

Time for Ride: 43mins 07seconds
I would have liked to have pushed this under 40mins

T2

A lot less to do this time, just needed to re-rack the bike, dump the helmet and swap the shoes

Time for T2: 2mins 17seconds
Again this needs to be a bit quicker, maybe some elastic laces will help.

Run 5.5k

The run starts with a evil climb over a foot bridge over the bike route. With the post ride jelly legs this is no fun at all as it’s pretty steep. Once that’s over it’s about 1k of flat before a steep down hill to round the other end of the lake

Time for Run: 25mins 59seconds
I know I can run this distance a lot quicker than this without the other 2 parts so I would like to get this down by a couple of mins as well.

Total Time: 1:30:02

I had a lot of fun doing it and I think with a little bit more work I can take a few minutes off all the legs and get it down to closer to 1:20 next year, but I’ve already starting thinking about the Olympic distance tri at Dorney Lake in September.

Man vs Horse

Today I did something a little different, instead of going to the local park to run 5km at Parkrun I set off to the New Forest to take part in a little event that Helen Bowyer had put together. The plan was to run 15km across the New Forest broken up in to 3 5km between pubs in a race against Helen on her horse Muttley. There where 7 runners from the ETS team, Me, James, Luke, Graham, Joe, Dominic and Peter also Rob on his road bike.

The runners and the Helen would be taking the same route with the runners getting a 10min head start on each leg. Rob had a route that was about twice as long and set off at the same time as Helen.

Leg 1

From The Rock at Canada Common to The Lamb at Nomansland. We set off across Canada Common from the back gate of The Rock, reasonably early on myself, James and Luke hit the front. Luckily Luke had run the route for this leg before so we didn’t have to do any looking at the map and managed to make our way to the Dealze Wood easily enough. We could probably have cut the corner a bit at the end and shaved some more time off. We had about a 5 min lead on Rob and another 3 over Helen (though she did have to detour a little to point Peter in the right direction).


View Leg 1 in a larger map

Leg 2

From The Lamb to The Royal Oak at Fritham. This was the shortest leg, but after a short climb through Bramshaw Wood it was across the open plain. The good view meant that Helen could see us and helped by the soft ground meant Muttley could go faster and caught us up with about 800m to go. Rob arrived pretty much at the same time as well.


View Leg 2 in a larger map

Leg 3

From The Royal Oak to The High Corner Inn. Jame, Luke and me hit the front again setting off, but the fact I’ve not been doing much more than 5ks recently really started to bite. I managed to stick with them both for the first half until we crossed the stream then we started to spread out. The spread ended up big enough that I lost site of Luke and James was long gone. I had a small nav failure at the bottom of the last climb up to the High Corner Inn, I think it was just my subconscious not wanting to climb, as I went past by about 400m and had to turn round and come back. Rob was first back this time.


View Leg 3 in a larger map

After we’ve finished we all went back to The Royal Oak for some lunch. It was a really good day out and I’m really up for having another go next year and maybe even have a look at the full marathon version at some point.