Recording Boulder

Hi all,

I am about to write my first app for Garmin watches. It is to record my boulder sessions.
I know there are already apps doing this but as far as I know they all require me to start and stop every single boulder and need to set grades. Way to much to push and press during an activity. My goal is that the app recognises when I am in a boulder and when I finished it. The app is mainly to count boulders and their height and may be a few more things. I nearly finished the basic tasks: I see when I am bouldering and when I am resting. I count the boulder and see their hight. I have a little chart, displaying them during the session.

All my questions are related to the following session configuration:
_activityRecording = ActivityRecording.createSession({
:sport=>Activity.SPORT_FLOOR_CLIMBING,
:subSport=>Activity.SUB_SPORT_BOULDERING,
:name=>"Bouldering"
});
a) Start / Stop Boulder
When I use this configuration, whenever I start the app, it immidiatly starts counting boulder and because I don't plan to use buttons the boulder stops when I stop the app. How can I programmatically start and stop boulder during a running session?
b) Hight of a boulder
When starting an activity, I see the altitude. But when starting at an altitude of lets say 400m then a boulder hight of 2 to 3 meters is not realy visible in the default views of CIQ web portal. In case of a) and I can manage every single boulder, is there a way of setting my own properties for this?
c) Custom FitContributions
When I work with the session settings from above, custom fitcontribution fields aren't displayed in CIQ web portal. But when I use :sport=>ActivityRecording.SPORT_GENERIC for session settings, they are perfectly shown.

Any help is appreciated
Thanks in advance

  • I saved all relevant files plus a view screenshots in my repo at

    https://github.com/henry-1/Test_Garmin_Laps_with_Bouldering_Activity/

    I also saved iq-files and fit-files which can directly used with monkeygraph to spare time rebuilding the app.

    feel free to ask for more, if something else is needed and thanks for the review.

    Henry

  • I don't have Stryd, but I think that's a different story, because we're not talking about a CIQ app or datafield that tries to write to cadence field, but instead the Stryd is connected via bluetooth to your watch and I'm pretty sure it reports the cadence and I THINK that in fact the watch does use what it reports and the watch uses that instead of what the watch detects. I assume this based on my knowledge of how it works with heart rate monitors. Even when you use a non-Garmin hrm, like Polar H10, if you pair it to the watch then the heart rate reported by the Polar H10 will be used as official heart rate.

  • Sorry, that's a bit too much :) I meant just to include here the 3 (or 9? I wasn't sure) lines of code where you create the fields.

  • sorry, here it is: all relevant code is in the SessionController.mc.

    but you will also find parts of the definition as expected in the strings.xml and fitcontributions.xml

    _fitFieldBoulder = _Session.createField(
    WatchUi.loadResource(Rez.Strings.hight_label), // field name
    0, // filed ID
    FitContributor.DATA_TYPE_FLOAT, // type
    {
    :mesgType=>FitContributor.MESG_TYPE_RECORD,
    :units=>WatchUi.loadResource(Rez.Strings.hight_units)
    }
    );

    _fitFieldBoulderHight = _Session.createField(
    WatchUi.loadResource(Rez.Strings.hight_label), // field name
    1, // filed ID
    FitContributor.DATA_TYPE_FLOAT, // type
    {
    :mesgType=>FitContributor.MESG_TYPE_LAP,
    :units=>WatchUi.loadResource(Rez.Strings.hight_units)
    }
    );

    _fitFieldBoulderCount = _Session.createField(
    WatchUi.loadResource(Rez.Strings.counter_label), // field name
    2, // filed ID
    FitContributor.DATA_TYPE_FLOAT, // type
    {
    :mesgType=>FitContributor.MESG_TYPE_SESSION,
    :units=>WatchUi.loadResource(Rez.Strings.counter_units)
    }
    );

  • So every second you write the current height to both _fitFieldBoulder and _fitFieldBoulderHight and then when you recognize that you jumped then you call addLap?

    And another question: does it work if you click on the lap button before you jump down?

  • TL;DR if I use the Stryd Zones data field (and Stryd footpod) with my Garmin watch when I run, it's possible to have two sets of "running power" and "run cadence" fields - one from native data, and one from CIQ data. Despite the fact that these two sets of data could be completely different and despite the fact that the developer fields have very similar names to the native fields, Garmin isn't stopping Stryd from doing this.

    Note that the Stryd Zones data field is necessary to make full use of the Stryd footpod when used with a Garmin device. Stryd Zones records several fields which are used by the Stryd phone app (many more fields than can be communicated through standard sensor channels).

    I don't have Stryd, but I think that's a different story, because we're not talking about a CIQ app or datafield that tries to write to cadence field, but instead the Stryd is connected via bluetooth to your watch and I'm pretty sure it reports the cadence and I THINK that in fact the watch does use what it reports and the watch uses that instead of what the watch detects. I assume this based on my knowledge of how it works with heart rate monitors. Even when you use a non-Garmin hrm, like Polar H10, if you pair it to the watch then the heart rate reported by the Polar H10 will be used as official heart rate.

    Sorry that's incorrect. I understand why you would assume that under normal circumstances, but you're also assuming I have no idea what I'm talking about (thanks). I understand the topic under discussion (since I've written device apps and data fields which write to FIT fields and I've also used nativeNum).

    Yes, Stryd can optionally be paired as a footpod and a power meter (simultaneously), as well as pairing with the Stryd Zones data field (see below), but the Stryd Zones data field is the only thing that's necessary for the data needed by the Stryd phone app to be written to the FIT field. Pairing as a footpod is optional, and pairing as a power meter is pointless unless you have another data field that wants to do something with power data.

    Yes, in the case of pairing stryd as a footpod, native cadence will be populated from the Stryd. IIRC, this wouldn't work with for power, since Garmin doesn't allow native running power to be populated by a 3rd party sensor.

    we're not talking about a CIQ app or datafield

    I should have clarified this - I am literally talking about using the Stryd Zones CIQ data field (for running), which records power, cadence and several other "running dynamics" developer FIT fields that the Stryd (phone) app uses to calculate certain training metrics. All of this happens regardless of whether you pair Stryd natively as a foot pod / power meter or not. (I usually pair natively as a foot pod, since there's no point in pairing natively as a power meter, for various reasons.) You actually need to use the Stryd CIQ data field if you use your Stryd with a Garmin, otherwise not enough data will be collected (power isn't enough, and power + cadence also isn't enough.)

    a CIQ app or datafield that tries to write to cadence field

    Ofc we already established that simply isn't possible, if you mean "native" cadence field.

    nativeNum is the closest alternative, but we all know it's ignored. I think you mean a CIQ app or datafield that tries to write to its own "Cadence" field (perhaps a 3rd party field named "Cadence" or "Run Cadence", or some other name similar to "cadence"). The claim made by phil-w is that Garmin wouldn't like this. My claim is they don't care, since Stryd Zones literally does this.

    Here's an example from one of my own activities.

    Native cadence field:

    Stryd Zones IQ fields (Cadence and Power):

    Now you're thinking, but if I paired my Stryd as a footpod, won't (native) "Run Cadence" and (Stryd) "Cadence" be the same (except that Stryd's cadence is halved.) But I don't have to pair my Stryd as a footpod, in which case native cadence would come from the watch and the IQ Cadence field (from Stryd Zones) would come from the footpod. If I kept my watch arm unnaturally still for the whole run, it would be possible for there to be almost zero correlation between the two fields.

    Similarly, if I enabled power from the wrist (which I don't) and still used the Stryd Zones data field, native power and IQ power (from Stryd Zones) would be completely different. This is actually why I disable power from the wrist - I don't want 3rd party sites to use Garmin running power, I want them to use Stryd running power. Since some 3rd party sites prioritize native power over IQ power, the only way to get them to use IQ power is disable native power.

    Here's some of the additional fields that Stryd Zones records:

  • Can you clarify something? When you pair Stryd then how many cadence fields you see? And are they in sync?

  • @flocsy: this is all about adding laps programmatically nd has nothing to do with Stryd. 

  • Every second I write to _fitFieldBoulder and before I start a new lap I write to _fitFieldBoulderHight and befoer I quit the session I write to _fitFieldBoulderCount

    I ignore the Lap button as such in my code because I do not want to use it. I only use it to quit the app by now. During all my experiments in the past I tried it and a number picker (for the grades) showed up.

  • Which sounds logical, given you finished a boulder and it wants to know the grade.

    I wonder if the way you "ignore" the lap button in your code can cause it not to record laps when you call addLap?