You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
Hi,
I'd like to ask a question about the fit file structure how it should be implemented in our use case:
We have two arrays containing gps location data and other array contains information such as heart rate, power. These two arrays of data have in common the timestamp.
If I wan't to create a fit activity file containing this type of information, would an approach to save first the gps data as records and after that heart rate, power information as records be good? In my tests with Garmin connected showed that the fit file worked just fine (I was able to see the route and heart rate from the posted activity) which was constructed with that approach, but I'd like to know is it right way to make a fit file.
The problem is that the gps location data stored in the first array can be saved depending on user settings and environment - the frequency when its saved can be say every 10 seconds. The heart rate, power information can be saved say every second. If the requirement of constructing the fit file is that the record would contain both arrays rather than record per array item it'd require interpolation of the gps location data - and I'd rather not implement that unless I have to.
Problem is that I used the fit file in Strava upload as well, and it didn't seem to work that well at all - for example the total length and time of the saved trip didn't show up at all, the route wasn't visible either. That said Strava upload accepted the file just fine. Also Javawa RWTool did show the route just fine in the fit file.
Hi,
I'd like to ask a question about the fit file structure how it should be implemented in our use case:
We have two arrays containing gps location data and other array contains information such as heart rate, power. These two arrays of data have in common the timestamp.
If I wan't to create a fit activity file containing this type of information, would an approach to save first the gps data as records and after that heart rate, power information as records be good? In my tests with Garmin connected showed that the fit file worked just fine (I was able to see the route and heart rate from the posted activity) which was constructed with that approach, but I'd like to know is it right way to make a fit file.
The problem is that the gps location data stored in the first array can be saved depending on user settings and environment - the frequency when its saved can be say every 10 seconds. The heart rate, power information can be saved say every second. If the requirement of constructing the fit file is that the record would contain both arrays rather than record per array item it'd require interpolation of the gps location data - and I'd rather not implement that unless I have to.
Problem is that I used the fit file in Strava upload as well, and it didn't seem to work that well at all - for example the total length and time of the saved trip didn't show up at all, the route wasn't visible either. That said Strava upload accepted the file just fine. Also Javawa RWTool did show the route just fine in the fit file.
The specs are not overly precise, so I'd assume that your file structure is "legal". On the other hand, the primary implementation is Garmin's (with one record per time stamp, in increasing time order). So you can be sure that most applications that interpret .FIT files take this as the gold standard. Deviant file structures could cause them to stumble. You might then "complain" that your file structure is legal - but that won't help much.
If your primary concern is that GPS data might be available every 10 seconds, other data every second, the solution is simple: no record message has to contain ALL properties. So you can have 9 subsequent records without GPS data and a 10th one with GPS data. Perfectly legal and frequently used by e.g. Garmin devices.
Cheers,
OMB