autolap config in createSession - missing documentation?

Hi, 

I would like to trigger basic auto-laps based on distance when recording activity in watch app. 

However, based on documentation, I am unable to find out how to configure :autoLap dictionary, as I don't know what values can :type option get. 
https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html#createSession-instance_function

Can please someone share possibilities of this :autoLap implementation except documented :lines option? Thanks

  • So I'm just speculating / reading between the lines, but I would guess that :lines is the only supported :autoLap :type.

    (I'd be happy to be proven wrong, though.)

    Not to state the obvious, but If you want trigger laps based on distance, you could do so programmatically by checking the activity distance every second and calling addLap() when appropriate. (I assume your app would have to do other things every second anyway, such as updating the display.)

  • Ouch, I hope that is not the case :-o, and CIQ team didn't implemented it solely for that Garmin track-lap app when needed. I will rather not comment CIQ prioritisation again.. 

    Mentioned solution is of course possible, but it is not fast enough and UX suffers because of that. I wanted to have immediate triggers, not checking distance in the loop.

  • What other option would you want to have available?  Maybe do an improvement request (you can do this by way of a bug report).

    I handle autolaps in the way FlowState suggests, as it works on CIQ1/CIQ2 devices, and also the code is fairly trivial and within a second of accuracy (assuming a 1 sec timer for the info) - probably the same accuracy as if you include autolaps.when you create the session.

    No real looping involved - just a check to see if you've gone the "autolap distance" since the last time you did an addLap(), and if so, do the addLap() and save the current distance for the next compare.  Just a few lines of code.

    Same basic thing if you want to autolap based on location - say you want to autolap while moving around a track, but you want to use "about" the same location, as you might not be at the exact same location on each lap.

  • I also handle autolaps the same way FlowState and jim_m_58 describe, however I found that the accuracy is limited due to the fact that the elapsedDistance is updated only once a second, which means the length of a lap could vary several meters depending on the pace you are running.

    It is not a big problem, especially with an accuracy of 2 digits for the distance you do not even notice it, but if e.g. you edit your run in runalyze, you can see the varying length of the "autolaps" due to the 3-digit accuracy, which is not the case if you use the Garmin Run app. So a "Listener" that is triggered exactly after a certain distance would be nice.