Problem creating workout file with relative heart rate targets

Hi,

I'm creating fit (cycling) workout files using the java FIT-SDK (v21.40.00). I'm succeeding in creating a workout with relative power targets. For each interval I create a WorkoutStepMesg with target type WktStepTarget.POWER, and a customTargetValueLow and customTargetValueLow in the range between 0..1000 to get a relative power value.

I'm trying to do the same for heart rate. According to https://developer.garmin.com/fit/file-types/workout/ I should be able to achieve this by setting target type to WktStepTarget.HEART_RATE and then setting customTargetValueLow and customTargetValueLow to a percentage of max heart rate.

I've done this, but then, in both a Garmin Edge 520 and a Wahoo Elemnt Bolt, the heart rate values are not shown. I am able to create files for absolute heart rate values, by using 100 + HR for both customTargetValueLow and customTargetValueLow.

If anybody can point out what I'm doing wrong then I would highly appreciate that.

Thanks!

Ilja

  • Without seeing your code or an example file, there is one thing that I would suggest looking at. When using custom target values the target value field need to be set to 0. The devices need to figure out if they should use the single target value field or the combination of the two customTargetValueLow and customTargetValueHigh fields. If the target value is zero, then the device will use the two custom target values instead.

    In pseudo code that looks like:

    workoutStep.targetType = WktStepTarget.HeartRate;

    workoutStep.targetValue = 0;

    workoutStep.customTargetValueLow =  65; // 65%

    workoutStep.customTargetValueHigh = 75; // 75%

    In the Workout Encode recipe there is the utility method CreateWorkoutStep() that shows how to set the values of the Workout Step message. It covers the most common use cases. 
    developer.garmin.com/.../

  • Setting workoutStep.targetValue to 0 indeed fixed the issue when deploying to a Garmin Edge.

    For me, it would make sense to provide this CreateWorkoutStep() function from the C# cookbook as a utility function in the SDKs themselves, to make it easier to use the SDK in the correct way.


    I can continue now. I'll just have to find out why things still don't work on the Wahoo Elemnt (but that's not Garmin's problem ;-) ).

    Thanks Ben!

    Ilja