Locus activity export to FIT format

Mick FU shared this problem 7 months ago
In Progress

Hello,

I am new on this forum, but I use Locus highly : mapping, orienting, navigating, analyzing activities, modifying activites, etc…...


Sometimes I need to modify activities imported from plateforms, which Locus do perfectly (import fit file and then modifying), but when I export them again into fit format, files seems not properly/completely formatted (at least mine), not following the official sdk requirements, and thus not handled properly by some other tools : at least it is my own analysis.

I definitely decide to join this forum, to see if I can get some assistance and/or changes with fit files export function from Locus (for activities). I searched for other issues like this, but it seems not totally the same.


In summary, some mandatory messages are missing for exported activity file (SESSION, ACTIVITY) and some messages defined “correctly” but are missing some data.

I also try the add-lon locus-out-fit, but result is not good also, so I preferred to analyze direct locus fit export.

Is it possible, and for sure I can provide as many example or tests, to update Locus activity fit file export so that it follows the fit SDK which some 3rd party tools are following religiously ?


Thanks a lot in advance.


Here are some details and explanations, regarding one activity file generated by Locus : not changed at all : locus_fit_SnowShoeing_2021-12-30T12_15_35.fit

If I convert this fit file into CSV (attached also), here are my findings :

  1. There is a LAP message :
  2. In LAP definition there are correctly the mandatory timestamp and start_time : Definition,0,lap,timestamp,1,,start_time,1,,start_position_lat,1,,
  3. But missing timestamps and start_time data in LAP message : Data,0,lap,start_position_lat,"510378757",
  4. In the same LAP message :
  5. There is a total_descent definition : total_elapsed_time,1,,total_ascent,1,,total_descent,1,,max_altitude,1,,
  6. But no total_descent data in the message : total_ascent,"389",m,max_altitude,"1749.0",m,
  7. There is an EVENT message :
  8. With timestamp in the definition : Definition,0,event,event,1,,event_type,1,,event_group,1,,timestamp,1,,
  9. But no timestamp data in the message: Data,0,event,event,"0",,event_type,"9",,event_group,"0",,,
  10. According to FIT SDK requirements (https://developer.garmin.com/fit/file-types/activity/) , an activity file (type 4) must contain mandatorily an Activity Message AND an SESSION message
  11. And there are none in the Locus fit file ☹

If I tweak manually the csv file to add missing informations (LAP/EVENT ones + ACTIVITY + SESSION), the fit file becomes “OK” for uploading into other parties that are really strict regarding fit content. I also attached OK tweaked csv and fit files.

Replies (4)

photo
3

Hi Mick,

thank you for the very precise test & suggestion.

Indeed, I may confirm your observations, so I made a few changes that may cover mentioned problems. Give a try to the next app version (will be published most probably till the end of January) and let me know. Thanks.

photo
1

Wow, so quick. Thanks a lot.

Eventually, before I could test on my own, would it be possible to share some fit files for you to import, export again and share them back to me? I would be able to check if they are digested by 3rd party platform (Suunto API FYI).

Thanks again.

photo
2

Hi Mick,

best you may do if you want to spend some more time on this and verify that problem is really fixed, is to use fresh Beta version. More about it here: https://forum.locusmap.eu/index.php?topic=7632.msg66753#msg66753 . Link to Beta versions is visible in my signature on the forum.

photo
1

Hi Menion,

Fresh beta works...............99% : Locus activity fit export file is well properly imported by Suunto : so many thanks.

Last 1% might be debatable :(

It is about Total_Elapsed_time vs Total_timer_time.

Values in fit file seems to be correletated to Locus data : Total_elapsed_time = Track time (3h41m28s) and Total_timer_time=Track time (movement)(1h28m01s) for my example.

No pauses, just slow movement, and at the end, activity duration taken into account by Suunto (but also by Runalyze with manual fit import) is finally the result of Locus Movement time (not the real duration of activity).

In theory (at least my own understanding of the fit sdk), total_elapsed_time is including pauses, and total_timer_time is excluding official pauses , and it seems to exist a specific message for total_moving_time.

https://developer.garmin.com/fit/cookbook/durations/


What do you think, please ? Does it make sense and could be changed from Locus export side ?

Again, so many thanks for first successfull change.

photo
1

Hello,

In addition to my last question/request about total times, I would dare to ask if it could be conceivable to request to add to Locus export options, the "export to Suunto" ? Like the export to Runalyze :)

Not anything urgent or mandatory, if/when fit files will become perfect it is still manageable through other services, but from Locus, would be so perfect.

Thanks.

photo
1

Hi Menion,

sorry to insist :)

Do you think you can change Locus fit export : Total_timer_time value to its "real" meaning = total time of activity in terms of timer, and not moving time ?

Thanks.

As you tagged this problem message as "solved", i am not sure wether you read it again :( :)

photo
2

Hello Mick,

we are reading all comments also for topics that are already marked as "closed".

I'm looking at what you wrote and you are of course correct. The app is not perfectly ready for this kind of value, but I'll try to improve it. Give a try to the next Beta version please (will be published till the end of the week), thanks.

photo
1

Hi Menion

Thanks a lot, i will test further with next beta. And sorry to have imagined one didn't read all comments :( I am working with some teams and job is managed by tickets. Once ticket is said as solved......... ;) But it is another part of the world and business. Thanks for all your job with Locus.

photo
1

No problem, every company = different ).

Menion

photo
1

Trying current beta 4.5.7.4_1058 again with another activity, I found another point related to time, but at fit import process.

Attached an original fit file from my watch device. It is importing well in Locus, but :

in Locus , the activity duration is different from original

Locus After import : 2:26:31 = 8791s

Original activity : 1:58:19 = 7099s = Total_timer_time from original file

Total_elapsed_time is longer : 8814s (due to a pause (timer stop) during 1715s)


it seems Locus is not taking into account the pause, but even not really taking into account fit value (8791 is not 8814).

After analysis, i may understand that locus takes first and last records with GPS values, and track time is calculated from timestamps difference, but without pause.


Would it be possible that locus takes fit total_timer_time as activity track duration ?

Would it be possible that locus takes into account the pauses in activities at import ?


Deeper analysis :

First track point in Locus, created on Jan 23, 2022, 11:33:52 = timestamp 1011868432 = first point with GPS data in fit file

Last track point in Locus, created on Jan 23, 2022, 14:00:23 = timestamp 1011877223 = last point with GPS data in fit file

1011877223-1011868432 = Duration = Track time in Locus = 2:26:31 = 8791s

photo
1

Thanks for the observation. Generally, Locus Map does not keep any hardcoded values, everything is computed on the fly. So there is no option to "locus takes fit total_timer_time as activity track duration". Anyway, pause should definitely be considered. May you please share with me any FIT file with this pause so I may test it also on any file not directly exported by the Locus Map? Thanks.

photo
1

oh, sorry, i forgot to attach the file :(

here it is and thanks.

photo
1

Hi Mick,

as I see, support for pauses is missing in the import, but also in the export where app simply always export only a one "lap" message. As I see, it is a lot more work than simple bug fix and my tasks-queue is currently quite full. I've added this as another task to my queue on later. I'll keep you informed here once this will be done, but please do not expect it too early, we really currently have a little different priorities. Thanks for understanding.

photo
1

Hi Menion, i understand, no worries (and even i could say i was "guessing" this ;) )

i will not expect it to arrive soon, but i know it will arrive, and i will wait eagerly :)

fit files are nice, but can contain so many different informations, and maybe not all usefull for all parties. I understand Locus (you) have to be sure to manage things completely/fully (import/export, with "just" mandatory data).

Thanks in advance.

photo
photo
1

Hi Menion,

Hope you are fine.

Any news on this please ?

Thanks.

photo
1

Hi Mick,

as I wrote before, this really does not have a priority now, sorry. I have this task in my todo list together with bunch of cca 200+ items. Thanks for understanding.

photo
photo
1

Hi Menion,

Just a kind ( and full of respect for the whole job done) reminder about this topic.

Lack of pause management in Locus for fit files, makes this almost useless 😔 to work with this file format.

photo
1

Hello Mick,

give a try to the latest version from the Google Play. I made just a small change where app exports multiple "laps" based on breaks. Hope this is what you needed.

Jiří M. aka Menion

photo
1

Hi Menion,

First for all, thanks.

Second, i tried this new 4.10 version (this one, right ?), and i am confused : i did a very small test, walking and recording for few seconds, pausing (not stopping), resuming, a couple of times, and save this test. I export this activity to fit file, and ......, only one lap message in the result.

I am even not sure how to see breaks in Locus ? Any link to wiki ?


and i tried to import a fit file with pauses, it is still doesn't show any changes, i guess it is expected to behave like this currently, right ?

photo
2

Hello Mick,

this was result of very quick "fix" right before the release and here it is > bugged functionality, sorry.

Will be improved in the next app version for export and also import.

Jiří M. aka Menion

photo
1

Rodger. Thanks for all.

And if import is also considered it is even closer to be perfect 👌 👏

photo
photo
1

Hello Menion,

How is going this topic ? is there any beta i could test ? I would be happy to do so.

thanks.

photo
1

Hello Mick,

it has been almost two months since previous published version. And finally today we will be publishing a new version so give it a try please. I remember I did some changes regards this issue so I hope it will be fixed, finally. Thanks for the patience.

photo
1

Hi Menion

Thanks, i tried the latest beta RC, and i see now some changes.


I think lap management could be good (not tested deeper), but pause management seems not good :(

to me, pause is not a matter of lap, but a matter of times differences (elapsed and total) AND events (stop/start timer = break)


I did the following test :

- I record the same test activity, both in Locus and with my GPS watch (trying to push buttons at the same time)

- Start recording + move around 42 seconds + pause (around 34 seconds) + unpause + move around few more seconds (26s)+ stop recording and save

--> total including pause = 102, total exluding pause = 68, pause = 34


Then I :

- import my watch activity fit file ("watchfit") into locus and then export it again from Locus into another fit file ("watchlocusfit")

- export locus native activity into fit file ("Locusfit")


Results : i use fit file viewer to compare quickly


Locus activity in Locus

TrackTime = 1:07 = 67

TrackTime (movement) = 1:07 = 67

Can't find any info about pause (does locus can display this pause ?)

Export to Locusfit file:

Session data

total_elapsed_time(s)= 67

total_timer_time(s) = 32 --> strange, as first walk was 42 seconds --> could it be more the pause time ?

total_moving_time(s) = 67 --> strange to be moving more that timer time

Lap data

One lap with

total_timer_time(s) = 67

total_elapsed_time(s)= 67

Event data

Only two events (one start and one stop_disable_all)


Watch activity imported in Locus

TrackTime = 1:38 = 98 (= timestamp difference of first and last point with lon/lat data), why not.

TrackTime (movement) = 1:38

Can't find any info about pause

Original Watchfit file:

Session data

total_elapsed_time(s)= 102

total_timer_time(s) = 69

no total_moving_time(s)

No Lap data


Event data

4 events (2 starts and 2 stops) and timestamps duration between stop1 and start2 = 34 --> pause


Watch activity exported from Locus

Watchlocusfit file:

Session data

total_elapsed_time(s)= 98 logic but false

total_timer_time(s) = 98 no pause any more

total_moving_time(s) = 98

Lap data

One lap with

total_timer_time(s) = 98

total_elapsed_time(s)= 98

Event data

Only two events (one start and one stop_disable_all)


My conclusion, but i might be wrong :

Fit import doesn't take pause into account (pause managed with event starts/stops and not laps (laps are not pauses).

Fit export depend on wether activity is recorded in Locus (wrong calculation ?) or imported (no more pause after export).

photo
1

in addition to time comments (pause management vs laps), i discover that locus doesn't export speed values into fit files :(

speed messages are there, but with value = 0 :( :(

photo
1

Hi Mick,

you are the "victim" of the task, where developer (myself) know that there is a problem, but nobody except the single user (you) is interested in fix. Sorry for this and thanks for the patiance.

I've found that app incorrectly computed second and following "laps". It always used also last point from previous lap so values in "lap" message was incorrect.

Btw. Locus Map does not use "laps" at all, so I cannot see difference between "lap" and "pause", sorry.

Speed values : is it correct to export speed from GPS? Because in GPX files, only speed from sensors should be included. Speed from GPS may be computed from coordinates and time difference. I've then removed invalid "0.0" values from speed column (so GPS-based speed won't be export at all) ok?

You also mentioned that Locus Map ignore lap from imported "watchfit" file. Do you still have this file for test? Thanks.

photo
1

Hi Menion,

No worries, always loves your answers :)

1- for speed values, i would say : export into fit file the values used to display the speed graph in Locus :) There is a graph, so there are values, so why not exporting them :) ? Either from GPS or Sensors, Locus knows speed.

2- about Lap/Pause topic : i can reasonnably live without real laps (which are not used in Locus as you said)

It was not the original issue i had, and the discussion seems to have deviated :)

Laps are events during the total duration which defines intervals, with their own durations (between two trigger of lap event). If not managed in Locus, why not :)

But pauses are stops in the time recording (breaks) (triggered by timer stop events and then start again), and then the total duration splits is well explained here https://developer.garmin.com/fit/cookbook/durations/

total_timer_time (track time in locus) = total_elapsed_time - pauses (breaks)

Pauses duration is sum of duration between each single timer stop and the next timer start.

Moving time is another layer (track time (movement) in Locus), not important for me, but is a calculated duration and could be exported in total_moving_time, if needed.

And finally, not sure to retreive where i would have mentionned the Locus ignore lap from watchfit file (which i didn't have anymore, sorry).

photo
1

Hello Mick,

1) this should be now correctly working in the new 4.11.1 version.

2) understand, thanks. Because Locus Map is made mainly for hike & bike and not directly to measure some sports activities, there exists only a system of pauses, not laps. Currently, export to FIT file, split track based on pause intervals, and use them as "laps" for export. This probably causes a small mess in export files.

So the solution I see is not to use "Laps" for export at all. Instead, any field that matches recording pauses better. For example "Session" message is defined here https://developer.garmin.com/fit/file-types/activity/ ?

photo
Leave a Comment
 
Attach a file