Giter Club home page Giter Club logo

fit2gpx's Introduction

fit2gpx

Конвертер файлов Garmin .FIT в GPX, CVS, HR, HRV, SpO2, Stress, SQLite. Версия 0.1.19

© Maks Vasilev, 2015-2020, http://velo100.ru/garmin-fit-to-gpx FIT Software Development Kit (SDK), http://www.thisisant.com

Информация по использованию:

java -jar fit2gpx.jar --help

Консольный режим:

java -jar fit2gpx.jar [параметры] <файл Garmin .FIT> [[<файл Garmin .FIT>] …]

Графический диалоговый режим:

java -jar fit2gpx.jar [параметры]

параметры:

--statistic             | -s    вывод итоговой статистики в консоль
--gpx                   | -g    Режим по умолчанию. Выходной файл: трек в формате GPX
--csv                   | -c    выходной файл будет в формате CSV
--atomfast              | -f    выходной файл будет в формате трека Atom Fast CSV
--merge                 | -m    объединить все выходные файлы в один

Внимание! в объединённом файле данные могут быть не в хронологическом порядке! (см. issue #21)

    --iso-date=[yes|y|no|n] использовать для CSV формата дату в формате ГОСТ ИСО 8601-2001 (ISO 8601) (по умолчанию 'yes')
    --hr-only               | -hr   выходной файл будет в формате CSV, содержимое: только ЧСС и время
    --hrv                   | -vr   разбор файлов тренировки и запись в CSV интервалов R-R для анализа вариабельности
    --hrv-filter            | -vf   тоже самое, что и --hrv, но используется пороговый фильтр для устранения всплесков
            --filter=n      где: n - уставка порогового фильтра (для -vf) в % от 1 до 99 (по умолчанию 30)
            --hrv-mark-filter       записывать в выходной файл все интервалы, только отмечать плохие в поле "fileter"

    Файлы мониторинга (не тренировок):
    --monitor-all           | -ma   синоним: --monitor-hr --monitor-oxy --monitor-stress
    --monitor-hr            | -mh   разбор файлов мониторинга пульса (не тренировки), выходной файл будет в формате CSV
    --monitor-oxy           | -mo   разбор файлов мониторинга и запись в CSV значений оксигенации SpO2
    --monitor-stress        | -ms   разбор файлов мониторинга и запись в CSV значений уровня стресса
            поля в CSV: Дата время; Индекс Стресса Garmin; Уровень батареи тела; дельта; неизвестно

    --db-sqlite             | -dbs  сохранять результат не в файл, а в базу данных SQLite
            --db-connect=база       строка подключения к базе данных. Для SQLite "база" - путь к файлу
                    базы данных, если не указан, то по умолчанию "fit_db.sqlite3" в директории запуска программы
            --db-prefix=префикс     префикс имён таблиц/схемы для сохранения в базе измерений нескольких человек.
                    Если не задан, по умолчанию в SQLite данные будут сохраняться в таблицы с префиксом "_no_person"
                    Если указан не существующий профиль, он автоматически добавиться в базу со всеми таблицами
            --person=префикс        аналогично --db-prefix=, но запрещает создание новой базы и добавление нового
                    профиля если таких не существует. При указании не существующего профиля программа завершается с ошибкой.
            --tags=                 тэги для файла или группы файлов, при сохранении в базу, для поиска и обработки

    --save-empty            | -se   сохранять файлы без координат (пустые треки)
    --full-dump                     сделать полный дамп записей файла в тестовый файл  

Конвертер имеет два режима работы: консольный и графический. При запуске без указания файлов для конвертации запускается диалоговое окно выбора файлов для конвертации. Если при запуске в качестве аргумента передать имя файла, то происходит конвертация без запуска диалоговых окон. В случае успешной конвертации никакой информации в консоль не возвращается. Консольный режим работы можно использовать в различных скриптах для автоматизации.

Конвертер поддерживает режим пакетной обработки файлов, для этого в консольном режиме укажите имена всех файлов в качестве аргументов программы. В диалоговом режиме просто выберите несколько файлов в диалоге выбора.

Дамп всех заголовков файла (отладочный режим):

java -cp fit2gpx.jar DebugDecode <файл Garmin .FIT>

Минимальная версия Java - 11.0

Примеры использования:

RU: https://github.com/MaksVasilev/fit2gpx/blob/master/Examples_RU.md

Актуальный релиз:

https://github.com/MaksVasilev/fit2gpx/releases/latest

текущая бинарная сборка (возможно не стабильная):

https://github.com/MaksVasilev/fit2gpx/raw/master/out/jar/fit2gpx.jar

Возможности добавленные после релиза 0.1.5

  • 0.1.9 - обработка всех заданных режимов, можно указать несколько параметров для работы одновременно
  • 0.1.8 - запись измерений HRV (RR, HR, фильтр) в базу SQLite
  • 0.1.8 - запись параметров пульса из тренировок (HR-only) в SQLite
  • 0.1.7 - запись параметров мониторинга (HR, SpO2, GSI) в базу данных SQLite
  • 0.1.6 - для HRV с фильтром запись всех значений R-R и отметка плохих в поле filter

English

Converter Garmin .FIT files to GPX, CVS, HR, HRV, SpO2, Stress, SQLite. Version 0.1.19

© Maks Vasilev, 2015-2020, http://velo100.ru/garmin-fit-to-gpx FIT Software Development Kit (SDK), http://www.thisisant.com

Usage: java -jar fit2gpx.jar --help

Console mode:

java -jar fit2gpx.jar [options] <file Garmin .FIT> [[<file Garmin .FIT>] …]

Graphic dialog mode:

java -jar fit2gpx.jar [options]

options:

--statistic             | -s    output of final statistics to the console
--gpx                   | -g    Default mode. Output file: GPX track
--csv                   | -c    the output file will be in CSV format
--atomfast              | -f    the output file will be in format Atom Fast CSV
--merge                 | -m    merge all output files in one file
Attention! the data in the merged file may not be in chronological order! (see issue #21)

    --iso-date=[yes|y|no|n] use for CSV date in GOST ISO 8601 format (by default 'yes')
    --hr-only               | -hr   the output file will be in CSV format, content: heart rate and time only
    --hrv                   | -vr   parsing training files and writing R-R intervals to CSV for variability analysis
    --hrv-filter            | -vf   same as --hrv, but threshold filter is used to eliminate spikes
            --filter=n      where: n - threshold filter value (for -vf) in % from 1 to 99 (default 30)
            --hrv-mark-filter       write all RR intervals to out, but mark bad in "field" field

    Monitoring files (activity tracking, not a activities):
    --monitor-all           | -ma   alias for: --monitor-hr --monitor-oxy --monitor-stress
    --monitor-hr            | -mh   parsing heart rate monitoring files (not training), the output file will be in CSV format
    --monitor-oxy           | -mo   parsing monitoring files and writing SpO2 oxygenation values in CSV
    --monitor-stress        | -ms   parsing monitoring files and writing Stress values in CSV
            fields in CSV: Date time; Garmin Stress Index; Body Battery; delta; unknown

    --db-sqlite             | -dbs  save the result to a SQLite database instead of a file
            --db-connect=base       the connection string to the database. For SQLite, "base" is the path to the database
                    file, if omitted, the default is "fit_db.sqlite3" in the program launch directory
            --db-prefix=prefix      prefix names of the tables/schema to store in the database the dimensions of a few people.
                    If omitted, by default, data in SQLite will be saved in tables with the prefix "_no_person"
                    If a non-existent profile is specified, it is automatically added to the database with all tables
            --person=prefix         alias of --db-prefix=, but it prohibits creating a new database and adding a new profile
                    if there are no such profiles. If you specify a nonexistent profile, the program fails with an error.
            --tags=                 tags for a file or group of files, when saving to the database, for search and processing

    --save-empty            | -se   save files without coordinates (empty tracks)
    --full-dump             create full text dump of all messages  

The Converter has two modes of operation: console and graphic. When running without files in parameters, a dialog box opens for selecting the file to convert. If you use the file name as an argument at startup, the conversion occurs without launching dialog boxes. If the conversion is successful, no information is returned to the console. The console mode can be used in various automation scripts.

Converter supports batch mode file processing for this in console mode, specify all file names as arguments to the program. In dialog mode, simply select multiple files in the selection dialog.

Dump all the headers of the file (debug mode):

    java -cp fit2gpx.jar DebugDecode <file Garmin .FIT>

The minimum Java version is 11.0

Examples of usage:

RU: https://github.com/MaksVasilev/fit2gpx/blob/master/Examples_EN.md

Actual release:

https://github.com/MaksVasilev/fit2gpx/releases/latest

Last binary (possible unstable):

https://github.com/MaksVasilev/fit2gpx/raw/master/out/jar/fit2gpx.jar

Features after 0.1.5 release

  • 0.1.9 - processing all set modes, you can specify several parameters to work
  • 0.1.8 - store HRV measurements (RR, HR, filter) to SQLite database
  • 0.1.8 - store heart rate parameters from training sessions (HR-only) in SQLite
  • 0.1.7 - store monitoring parameters (HR, SpO2, GSI) to the SQLite database
  • 0.1.6 - for HRV with a filter, record all R-R values and mark the bad ones in the filter field

fit2gpx's People

Contributors

maksvasilev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fit2gpx's Issues

Developer data from FIT

Information that fields and widgets on Connect IQ write to the FIT file: W'bal, TRIM ZCW...

Power data to GPX file

No power data in GPX file.

Workaround (Strava variant):

<extensions>
 <power>147</power>
...

Problem with fit file created by Suunto watch

When I try to convert my fit file I get following exception:
"C:\Program Files\jdk-16\bin\java.exe" -jar fit2gpx.jar Mountaineering_2021-08-14T08_08_21.fit
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at Converter.fix(Converter.java:413)
at Converter.run(Converter.java:194)
at fit2gpx.main(fit2gpx.java:260)

Mountaineering_2021-08-14T08_08_21.zip

Default values for enumerate

java -jar fit2gpx.jar --full-dump
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 99 out of bounds for length 5
at fit2gpx.main(fit2gpx.java:117)

Running dinamics

Message number: 20 Name: "record" Fields: 20
Field num: 253 Name: "timestamp" Units: (s) [841083683]
Field num: 0 Name: "position_lat" Units: (semicircles) [802104488]
Field num: 1 Name: "position_long" Units: (semicircles) [652181821]
Field num: 5 Name: "distance" Units: (m) [17015.7]
Field num: 2 Name: "altitude" Units: (m) [101.39999999999998]
Field num: 6 Name: "speed" Units: (m/s) [3.714]
Field num: 39 Name: "vertical_oscillation" Units: (mm) [72.2]
Field num: 40 Name: "stance_time_percent" Units: (percent) [38.25]
Field num: 41 Name: "stance_time" Units: (ms) [243.0]
Field num: 83 Name: "vertical_ratio" Units: (percent) [5.65]
Field num: 84 Name: "stance_time_balance" Units: (percent) [48.5]
Field num: 85 Name: "step_length" Units: (mm) [1227.0]

Field num: 87 Name: "unknown" Units: () [0]
Field num: 3 Name: "heart_rate" Units: (bpm) [155]
Field num: 4 Name: "cadence" Units: (rpm) [95]
Field num: 13 Name: "temperature" Units: (C) [3]
Field num: 42 Name: "activity_type" Units: () [1]
Field num: 53 Name: "fractional_cadence" Units: (rpm) [0.0]
Field num: 78 Name: "enhanced_altitude" Units: (m) [101.39999999999998]
Field num: 73 Name: "enhanced_speed" Units: (m/s) [3.714]

Use enhanced_altitude and enhanced_speed

Must use enhanced_altitude and enhanced_speed instead of speed and height, because they have a large bit depth. Speed is currently limited to 65.535 m / s (235 km / h)

English translation

This just looks just like what I need.

Please translate your readme/issues also to English, so everybody can profit and contribute from your project.

Thanks!

fit2gpx vs. Bryton

Добрый день.

Очень хорошая утилита, в т.ч. и тем, что распознает "нестандартные" .fit-файлы, записанные моим Bryton Rider 530.

В ходе обсуждения на веломании (мой диалог с pavlinux) выяснилось, что по сути корректно их распознает только страва. Я заметил, что после обработки fit2gpx (без ошибок) получившийся .gpx выглядит несколько странно - одна и та же секунда повторяется по 2 раза с разными данными. А чуть позже на глаза попалась эта тема.

GoldenCheetah анализирует этот .gpx криво, результаты абсолютно бесполезны. Имеющиеся решения не подходят - GPX/TCX из стравы получаются какими-то куцыми...

Проблему для себя я решил локально - написал на VBA )) маленький фикс, обрабатывающий .gpx. Он объединяет данные с одним и тем же временем и добавляет координаты в те точки, когда скорость равна 0 и работает Smart Pause.

Я не программист и понимаю, что мое "решение" работает только для моего набора (530+текущая прошивка+HR). Что будет с другими .fit от других пользователей Bryton - не представляю. На Bryton надежды нет - их support пребывает в зачаточном или предсмертном состоянии.

Поэтому, так как

Любые предложения приветствуются!

я вношу свои: 1) добавить в fit2gpx функцию объединения данных из "record", имеющих "same timestamp", а также 2) добавить координаты и заодно elevation (и то, и другое из ближайшей из ранее записанных точек, где эти данные есть) в тех случаях, когда велосипед не движется и устройство переходит в режим паузы.

Bryton.zip

fit2gpx on Android

Программа уже написана на java. Могли бы Вы адаптировать её для Android?

Empty point at the end of the GPX

Hello,

A bug is happening with some fit files (example attached):
It creates a last point with empty lat/lon:

<trkpt lat="" lon="">
    <time>2022-04-17T11:53:08Z</time>
    <ele>95.0</ele>
    <extensions>
     <nmea:speed>0.028888888889923692</nmea:speed>
     <gpxtpx:TrackPointExtension>
      <gpxtpx:atemp>17</gpxtpx:atemp>
      <gpxtpx:speed>0.028888888889923692</gpxtpx:speed>
      <gpxtpx:course>73134.1</gpxtpx:course>
     </gpxtpx:TrackPointExtension>
    </extensions>
</trkpt>

While other FIT 2 GPS translator doesn't put such empty point at the end
f06ae542-b465-44f4-b3ff-edce1314043a.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.