MorphSat Tool

Tacx Training Software

Moderators: nzuraw, mcorn

Post Reply
eri
Balance Bike
Balance Bike
Posts: 20
Joined: Mon Dec 23, 2019 5:20 pm
USER_FLAG: United States of America

Hey all, long time no see.

For past few years I've been emailing with folks who are trying to make their own virtual rides and it bothers me how much difficulty people have manipulating workout files, like it is some sort of magic.

For a while now I've wanted to make a tool to help people realize their dreams and finally started into it in december 2023.

I've got something now that is just dipping its toe into the potential, and which might be useful. I probably have 100 hours into this now, maybe 60 hours of that was banging my head against RLV file generation. Ended up using google's or-tools constraint satisfier to solve the underconditioned set of equations that is the RLV. I feel like I must be missing some really obvious easy way but that is how I did it.

I just published a win64 binary command line app onto github:

The repo is here:

https://github.com/ericchristoffersen/MorphSat_Public

To get the binary you click 'tags' on the right. then V0.1, and you'll see a zip file to download.

This is a stable spot. Hopefully lots more cool code to come.

Some examples:

read tts and write it out as both gpx and rlv:

Code: Select all

C:\MorphSat.exe -i "ES Alto del Angliru 2011.tts" -o es.gpx -o es.rlv
MorphSat Version:0.1
--------------------
read file:         0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
file written:      0:                       es.gpx - 1970-01-01T00:00:00Z (4238)    27070.6m (100.54%)      4237s(   100%)
Computing RLV Rates: (127) 4236/4236 epsilon:     1e-05 max epsilon: 0.00125
file written:      1:                       es.rlv - 1970-01-01T00:00:00Z (4236)    26923.1m (   100%)   4236.98s(   100%)
compare the 3 files:

Code: Select all

C:\MorphSat.exe -i "ES Alto del Angliru 2011.tts" -i es.gpx -i es.rlv -c
MorphSat Version:0.1
--------------------
read file:         0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
read file:         1:                       es.gpx - 1970-01-01T00:00:00Z (4238)    27070.6m                4237s
read file:         2:                       es.rlv - 1970-01-01T00:00:00Z (4236)    26923.1m             4236.98s
Comparing WorkoutFiles:
     0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
     1:                       es.gpx - 1970-01-01T00:00:00Z (4238)    27070.6m                4237s
     2:                       es.rlv - 1970-01-01T00:00:00Z (4236)    26923.1m             4236.98s
Available Field Comparison
                        0  |      1  |      2
      Grade:          All  |   None  |   None
      Watts:         None  |   None  |   None
   Distance:          All  |    All  |    All
        Lat:          All  |    All  |   None
        Lon:          All  |    All  |   None
        Alt:          All  |    All  |   None
      Speed:         None  |   None  |    All
         HR:         None  |   None  |   None
       Time:          All  |    All  |   None
  MediaTime:          All  |    All  |    All
  MediaRate:         None  |   None  |   None
       Temp:         None  |   None  |   None
    Cadence:         None  |   None  |   None

  track point count difference comparing 0 and 2:2
read the tts and output as a csv (to read and edit in a spreadsheet):

Code: Select all

C:\MorphSat.exe -i "ES Alto del Angliru 2011.tts" -o es.csv
MorphSat Version:0.1
--------------------
read file:         0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
file written:      0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m (   100%)      4237s(   100%)
read csv and write it back out as fit:

Code: Select all

C:\MorphSat.exe -i es.csv -o es.fit
MorphSat Version:0.1
--------------------
read file:         0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
Encoded FIT file ExampleActivity.fit.
Decoded FIT file es.fit
file written:      0: es.fit - 2106-02-07T06:28:16Z (4238)    26924.2m (   100%)      4237s(   100%)
Compare all the written files:

Code: Select all

C:\MorphSat.exe -i es.csv -i es.fit -i es.gpx -i es.rlv -i "ES Alto del Angliru 2011.tts" -c
MorphSat Version:0.1
--------------------
read file:         0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
Decoded FIT file es.fit
read file:         1:                       es.fit - 2106-02-07T06:28:16Z (4238)    26924.2m                4237s
read file:         2:                       es.gpx - 1970-01-01T00:00:00Z (4238)    27070.6m                4237s
read file:         3:                       es.rlv - 1970-01-01T00:00:00Z (4236)    26923.1m             4236.98s
read file:         4: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
Comparing WorkoutFiles:
     0: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
     1:                       es.fit - 2106-02-07T06:28:16Z (4238)    26924.2m                4237s
     2:                       es.gpx - 1970-01-01T00:00:00Z (4238)    27070.6m                4237s
     3:                       es.rlv - 1970-01-01T00:00:00Z (4236)    26923.1m             4236.98s
     4: ES Alto del Angliru 2011.tts - 1970-01-01T00:00:00Z (4238)    26924.2m                4237s
Available Field Comparison
                        0  |      1  |      2  |      3  |      4
      Grade:          All  |    All  |   None  |   None  |    All
      Watts:         None  |   None  |   None  |   None  |   None
   Distance:          All  |    All  |    All  |    All  |    All
        Lat:          All  |    All  |    All  |   None  |    All
        Lon:          All  |    All  |    All  |   None  |    All
        Alt:          All  |    All  |    All  |   None  |    All
      Speed:         None  |   None  |   None  |    All  |   None
         HR:         None  |   None  |   None  |   None  |   None
       Time:          All  |    All  |    All  |   None  |    All
  MediaTime:          All  |    All  |    All  |    All  |    All
  MediaRate:         None  |   None  |   None  |   None  |   None
       Temp:         None  |   None  |   None  |   None  |   None
    Cadence:         None  |   None  |   None  |   None  |   None

  track point count difference comparing 0 and 3:2
Post Reply