Creating my own Cycling Trainer App

I’m a big fan of Zwift, it’s a virtual cycling app that allows you to train and compete online in a virtual world.

I started training indoors in November 2018 when the weather was getting colder and I wanted a home setup that I could use if it was raining or snowing outside. Instead of buying an indoor cycling bike or spin bike, I invested in a smart bike trainer (Wahoo Kickr 2018) that I could use with my road bike (Trek Domane SL5). This would allow me to keep using my comfortable bike and it would allow an app to manage the resistance automatically (which isn’t common on a spinbike or a peleton).

The fun part is that Zwift would also allow you to train on courses inspired by real ones. For example, there is Alpe du Zwift which is a virtual copy of Alpe d’Huez in France:
Zwift only allows you to ride the courses they provide, some are made up, others are inspired by real cities/courses. 
But… what if I want to ride somewhere that is more familiar to me? I spend some weeks understanding how to control the smart trainer via ANT+ / Bluetooth and started to create my own bike riding software using Unreal Engine 4.
It’s still WIP, doesn’t have pretty rider graphics but it does read the sensor data (Power in Watt), runs physics calculations on it and turns that into speed (similar to what Zwift does). It then applies the slope % to the Wahoo smart bike trainer for the appropriate resistance and also read the Cadence/Heart rate sensor data. During the ride it will record your stats into a fit file that you can upload to services like Strava.
Basically I created a flow (by writing custom UE4 plugins) where I can import an elevation map (DTM), road information and turn it into an UE4 landscape. This means that I don’t have to create the virtual world with too much manual effort and allows me to recreate a map of any place in the world as long as there is enough (elevation) data available. Fortunately for the Boston area, there is very precise data available (1 meter precision).
I took a ‘virtual ride’ at my old neighborhood. With the super steep Lowell St.:
Another experiment was Mount Greylock which is in Western Mass:


Leave a reply