Custom fields rock climbing

Hi there

Trying to get my head around custom fields, I would like to extract some data from the fit-file in regards to rock climbing, so I can log them in intervals.icu
Things like Max grade, Total routes, and the grades of these routes.
Did anyone already got this working and willing to help me?
I searched trough the fitfile via fitfilvieuwer, but can’t really find wat I’m looking for, but this is all very new to me

Tia

1 Like

I had a look at your 12th June climbing activity and there is nothing climbing specific in there. Normally the fit fit is created when you upload from your watch and anything added after that (e.g. in Garmin Connect) doesn’t go into the file and isn’t visible to Intervals.icu.

So if you can add some of that stuff on the watch before uploading to GC you might be able to get it on Intervals.icu.

hi David, thanks for looking into this.

the 12 june file is directly from my watch (as is the 10 june file, all the other are manual entries), no data entered in GC, only entered the grades and the attepts on my watch.

In the screenshots you can see wat GC shows

(I hope you understand Dutch :slight_smile: )



Guido

Did some digging in some dummy fit-files directly taken from my watch.

Mesg_nr 312 contains the details about the climbed routes

Field 70 => the grade going from 0 to 29 (in french grade 1,2,3,4a,4b,4c,5a,5b,5c,6a,6a+,6b,6b+ until 9b)
Field 71 => route Completed (3) or Attempted (2) (Completed in 1 go without falling is Sent, but don’t see co a code for that).
Field 72 => number of falls

So the main details are there :slight_smile:

Some further digging to do

So after some more climbing, i’ve identifiled some more fields in Mesg_nr 312

The things I (think I) know for now are:

Field 9: climb/descent Time start
Field 26: Avg Heartrate (only on the climb)
Field 27: climb/descent Time end
Field 28: Calories burned
Field 70: Grade (numerical 0 to 29) (0=1 and 29=9b)
Field 13: just a incremental number, could be an array index number
Field 13: Elevation gain during climb
Field 72: number of Falls during climb
Field 0: status Climbing/Descending (9=climbing, 10=descending)
Field 11: Temperature???
Field 15: Avg Heartrate
Field 16: Max Heartrate
Field 32, 33 and 34: Temperature???
Field 71: status Climb Completed/Attempted (3=completed, 2=attempted)
Field 73: status Climb Sent (1=sent)

With these fields there is enough info to summerize the workout and perhaps even create/identify intervals (climbs) and “grade” them accordingly.

Now the fun part starts and I could rely use some help, for I think now there has to be a lot of stripting with arrays and I’m no scripting wizzard :wink:

TIA

In my attempt to get de maximum grade I climbed during a session, I made a custom activity field “maxGrade” which looks at FitFileField 312.70.
But whatever I try in the script, I only get the last value of all the rows and not the highest value (10, while it should be 12) as a result.
When trying things with an array index notation like maxGrade[0] I only get errors.
Am I missing something or or what am I doing wrong?

Follow-up question: Is it possible to acces multiple fields in the script?

Not yet. This is something I am aiming to support with custom activity traces. But even that won’t do this. I need to do something completely general. But it’s good that you have done this investigation as I now have this use-case to remember.

1 Like

that’s oke, I’ll wait patiently :slight_smile:

For the time being I can fill the fields manualy.

I must say I’m rely impressed with the whole devopment, been using Golden Cheetah for years, but this rely is another level :+1:
Still lots to learn but already such a great tool.

1 Like

Is this now solvable via the “computed fields from fit file messages”
If so, how? Still need to l earn a lot about scripting :slight_smile:
So if ne1 can give me hints on how to start, would be very helpful.

I edited your MaxGrade field: Changed “FIT file field” to “None” and added this script:

{
  let maxGrade = 0
  for (let m of icu.fit) {
    if (m._num !== 312) continue
    for (let f of m) {
      if (f.num !== 70) continue
      console.log("f " + f)
      if (f.value > maxGrade) maxGrade = f.value
    }
  }                    // 0   1     2     3     4    5      6      7     8     9      10    11     12    13
  let grades = [null, "4", "5a", "5b", "5c", "6a", "6a+", "6b", "6b+", "6c", "7a", "7a+", "7b", "7b+"]
  grades[Math.min(13, maxGrade)]
}

If you are happy with that please add a description and maybe a link to how the grades work and share it.

I referred to the JsFit object and other related fields to write the script.

David… a Big Thanks!!
Made some minor changes and based on this script made some other scripts.
Shared them all and hope others have some use for it or improve them.
Thanks again, learned some things again so that’s goed also :slight_smile:

1 Like

Any help on that ?
What did you use to log the climb first ?
I’m down to log my climbing activity too.
I wish it was possible to also log the climbing specific workout but i havent found a way yet.
Oh the app is garmin connect i guess ?

I use the Garmin Forerunner 955 to log my climbing. Works very well appart from the autostart the Garmin uses and is triggered by too small variations in barometric pressure.
I’m not sure what you mean by logging a “climbing specific workout”. But you can log a lot of different activities with the FR955,

The custom activity field works like a charm, but now I tried to make a custom graph from the custom field on the fitness page to see what is the highest grade I climbed during a period and there it does not work.

When recording two or more climbing activities on one day the Aggregate function of the custom activity field does not work. I gues it’s because the Aggregate can only work with numbers and not with the “grades” in the array.
When the values are the same in both sessions it shows up in the graph, but when the values are different, no matter how I set the aggregate sum/min/max/avg, is stays blank

In the attached picture you see a lot of climbing activities, the bottum dots (green and blue) represent the number of routes climbed. Above should reveal the max grade I climbed, but only three dots appear, all three ocasions where the max grade was the same in both sessions.

Is there a way to fix this?
The y-axis does show the grades in the right fashion so that works.

You can get this to work if you change the script to return a number instead of translating to text. You already have type of “select” and have mapped all the numbers to the appropriate text “6c” etc…

{
  let maxGrade = 0
  for (let m of icu.fit) {
    if (m._num !== 312) continue
    for (let f of m) {
      if (f.num !== 70) continue
      console.log("f " + f)
      if (f.value > maxGrade) maxGrade = f.value
    }
  }                    
  if (maxGrade) maxGrade = maxGrade + 1
  else maxGrade = null
  maxGrade
}

You need to do “Reprocess File” on your climbing activities after making this change.

Works great, thanks

One more question though.
When one activity returns a “null” for maxGrade send and another activity on the same day returns a value, the aggragated value is null, is this correct?
I would think the the aggregated value should be the value of the one activity with a value (see activities 5 nov 2023)

I just had a look at the 5h of Nov and it seems to be working as expected?

you’re right, I must putt on my glasses :-), been staring at to many graph’s

sorry for this, but let me repeat I love this platform, the knowledge, the support and all.

1 Like