Code Monkey home page Code Monkey logo

telemetryexporter's Introduction

Telemetry Exporter

Export telemetry data (frames) from Garmin activity.
Since Garmin Virb is not so usable, this program will replace part of its functionality related to exporting the png overlays.
Although this project gives opportunity to develop any kind of widget, depends on demands

presentation.mp4

Download

  • Go to Releases page and download the latest
  • No need install
  • Extract .zip contents
  • Open TelemetryExporter.UI.exe

For now only Windows 10, 11 is supported (MacOS could be added in future, but may need help)

Usage

Check the video below for detailed usage:
Usage

  • You need the .fit file activity from Garmin device or downloaded from their website (https://connect.garmin.com/)
  • Open Telemetry Exporter and select the .fit file
  • In Telemetry Exporter configure the settings you want and select widgets
  • Click Export and take a coffee :)

User data privacy

  • This program doesn't use any personal data
  • This program doesn't share data to 3-rd party service
  • This program doesn't require registration
  • It's free and open-source, the owner (developers, contributors) doesn't take responsibility for any malfunctions caused by the bugs
  • Using this program is at your own risk

Detailed description

  • In the first page you need to enter the .fit file from Garmin
  • After loading the file, the second page with settings appears
  • The settings: settings-1
  1. The elevation profile (calculated from active time)
  2. The activity range (showing total elapsed time)
    • Consist of two black sliders (start/end)
      • Move this slider smoothly, they are buggy
    • The blue area is the selected area for export
    • the thin red lines indicates paused intervals
  3. The start and end of the sliders - local datetime
    • The dates blinks in green background when ranges sliders moved (if not, try move sliders again), green background indicates the value of the slider is saved.
  4. Start/end since beginning (00:00:00 default for start) (default for end is the duration of the activity)
  5. Distance and duration of the selected range

More settings:
Settings-2

  1. The frames per second
    • It's highly recommended to use lower value here, because of duplicated frames. 60 will generate a lot of duplicated frames which is unnecessary. Later in the video-editing program change the duration of the imported frames 2fps = 500ms, 4fps = 250. In general duration = 1000 / fps
  2. This checkbox will threat the left marker as beginning of the activity
    • It's good when you want to show a part from your activity

Widgets:
Settings-3

  1. Each category is expandable where widgets can be selected
  2. ?
  3. Browse save location, final result is zip archive with name in GUID format (152a22da-d19e-4b87-bd85-153f9a0f3633.zip), default location is desktop
  4. The export button initiating the process of generating frames
  5. With the Cancel button generation of frames can be stopped
  6. The status of overall export process
  7. Each widgets reports its progress (this could be removed in future)

Widgets selection:
Settings-4 Each category may contain one or more widgets presented with an example image. To select widget click the checkbox below the widget.

At least one widget needs to be selected.

Development

  • Visual Studio 2022 (or newer) with installed tools for MAUI development
  • img
  • Set-up TelemetryExporter.UI as start-up project
  • Hit F5 to run te project
  • .NET 8 with C# 12

Checkout more info about Getting started with MAUI and Visual Studio 2022 MAUI release

Contribution

  • It's absolutely free for anyone to open PRs with fixes or new functionality
    • If need help use Discussion tab
  • For problems and bugs use Issues page

Technical info:

In case of error, this temporary directory contains generated frames:

C:\Users\<your-user-name>\AppData\Local\M-Yankov\com.telemetryexporter\Cache

Contents can be safety deleted.

Future

  • More widgets will be added (from garmin virb)
  • Each widget could have separate settings (size, font, color scheme etc.)
  • More configuration settings will be added, check Issues
  • integrating map layers as navigation
  • quick fixes
  • Possibility to set exact start/end times (to second)
  • The MAUI seems not a stable technology for extensibility, may try something different in future

telemetryexporter's People

Contributors

m-yankov avatar

Stargazers

 avatar

Watchers

 avatar

telemetryexporter's Issues

The standalone installer

Just find how to make a standalone installer as any other program (Next, Next), Nullsoft installer, etc.

Widget settings

Each widget could have a setting page/pop-up/modal where user sets specific widgets settings like colors, sizes etc.
all widgets will receive a settings data object where they can take specific settings.

Move sliders with arrows ⬅️➡️

  • Click one slider
  • It gets highlighted
  • click arrows moves the slider left/right with one second change (±1s)
  • click Crtl + arrows moves the slider left/right with one minute change (±1m)
  • click Crtl + Shift + arrows moves the slider left/right with one hour change (±1h)

Keep in mind the limits, to not overflow sliders

Zip Archive or plain image folders

It's more useful to have images directly exported to be ready for use.
Zip archive can be used to move files somewhere else before use.

Approx export size

The formula will be:
approxSize = (selectedRange).TotalSeconds * fps * (sumOfSelectedExampleWidgetSizeInKb)

It should located somewhere at the bottom near export Button.

Architecture suggestion

The application have 3 main loops:

  1. Map data from FitMessages to Customdata regarding framerate (saved in collection over 10k objects). usually is very fast
  2. Calculate widget data into images (frames)
  3. Save frames into physical device (this step waits completion of 100 object results from the previous steps, blocks the thread, process and returns back to previous step)

The example below suggest a solution for non blocking thread (safe-thread) showing last two steps separated in classes using concurrent Queue. (Code samples are generated from Open AI ⚠️ )

using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;

public class DataFiller
{
    private readonly ConcurrentQueue<int> _dataQueue;
    private readonly SemaphoreSlim _dataAvailable;

    public DataFiller(ConcurrentQueue<int> dataQueue, SemaphoreSlim dataAvailable)
    {
        _dataQueue = dataQueue;
        _dataAvailable = dataAvailable;
    }

    public async Task FillDataAsync(int count, CancellationToken cancellationToken)
    {
        Random random = new Random();
        for (int i = 0; i < count; i++)
        {
            await Task.Delay(100, cancellationToken); // Simulate some delay
            int value = random.Next(1, 100);
            _dataQueue.Enqueue(value);
            _dataAvailable.Release(); // Signal that new data is available
        }
    }
}

Processor:

using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;

public class DataProcessor
{
    private readonly ConcurrentQueue<int> _dataQueue;
    private readonly SemaphoreSlim _dataAvailable;

    public DataProcessor(ConcurrentQueue<int> dataQueue, SemaphoreSlim dataAvailable)
    {
        _dataQueue = dataQueue;
        _dataAvailable = dataAvailable;
    }

    public async Task ProcessDataAsync(CancellationToken cancellationToken)
    {
        int sum = 0;
        while (!cancellationToken.IsCancellationRequested)
        {
            await _dataAvailable.WaitAsync(cancellationToken); // Wait for data to be available
            if (_dataQueue.TryDequeue(out int value))
            {
                sum += value; // Process the data
                Console.WriteLine($"Processed value: {value}, Current Sum: {sum}");
            }
        }
    }
}

program.cs

using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;

public class DataProcessor
{
    private readonly ConcurrentQueue<int> _dataQueue;
    private readonly SemaphoreSlim _dataAvailable;

    public DataProcessor(ConcurrentQueue<int> dataQueue, SemaphoreSlim dataAvailable)
    {
        _dataQueue = dataQueue;
        _dataAvailable = dataAvailable;
    }

    public async Task ProcessDataAsync(CancellationToken cancellationToken)
    {
        int sum = 0;
        while (!cancellationToken.IsCancellationRequested)
        {
            await _dataAvailable.WaitAsync(cancellationToken); // Wait for data to be available
            if (_dataQueue.TryDequeue(out int value))
            {
                sum += value; // Process the data
                Console.WriteLine($"Processed value: {value}, Current Sum: {sum}");
            }
        }
    }
}

Show original route that was following

Depends on #30 (needs to be integrated)
You are doing some outdoor activity by following some track. but at some point you get out of track for some reason.
The original path needs to be shows in the trace widget. Try something like overlapping, the down layer is the following track, above it is the recorded track.
If the trace widget is slowed down drastically, the image size is too large or it's too difficult, then the solution could be to export only one image and then to be handled in the video editor.

Wrong postion of sliders

image
Sliders gets out of sync

steps (for left):

  • move left slider (without release the the button)
  • move mouse up or down in such way it lose tracking the slider
  • move right slider

This happens for both sliders

possible solution:
when moving one slider, calculate position for other slider too.

Possiblity to mark only a part of the activity for export

If the activity is too long and need to export the data only for a certain period (like a crash, jump, some highlight) it should be possible to provide to dates (during the session) and extract the data between them.

  • additionally for all the widgets which are showing data since the beginning (distance, trace, elevation etc) there should be an option to render them like the beginning /ending is from selected date ranges (like the range in the dashed red lines)
    frame_6862

Memory drop on second export

In diagnostics tool the memory drops like 500MB when export starts for the second time. It seems some objects are left in memory unused (not disposed) and GC cleans the. But the fact is that the code produces too much memory constantly.
TODO:
{ScreenShot}

Color palette

Add SKPaint variables in a common class. To be shared. They have common settings like font, width, style etc. Or method than can construct the paint settings.

  • Optionally a method that can recolor some parts of the widgets, (like Garmin main/secondary color) also colors for texts.

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.