Skip to content

sectore/fit-activities-rerun

Repository files navigation

fit-activities-rerun

Load *.fit file data and stream it into Rerun.io for interactive visualization of fitness activities.

Features:

  • Map views: OpenStreetMap (default) or Mapbox (access token required)
  • Charts: speed, heart rate, altitude, temperature
  • Summary info panel
  • Build in Rust or Python
  • Free and open source
Table of Contents

Preview

Dark theme

preview - dark theme

Light theme

preview - light theme

Requirements

With Nix (recommended)

cd into root directory. If you have direnv installed, run direnv allow once to install dependencies. Otherwise run nix develop. This will set up Rust, Python, uv and all system dependencies you need.

Without Nix

You can use either Python or Rust to run fit-activities-rerun:

Python

Setup uv

uv venv .venv
source .venv/bin/activate
uv sync

Rust

Usage

Python

fit-activities-rerun --fit <path-to-fit-file>

Rust

cargo run -- --fit <path-to-fit-file>

CLI

Python

fit-activities-rerun --help
Output
usage: fit-activities-rerun [-h] --fit FIT [--blueprint {none,vertical}] [--map {osm,dark,light,streets,satellite}] [--headless] [--connect] [--serve] [--url URL] [--save SAVE] [--stdout]

Visualize `*.fit` data using Rerun.

options:
  -h, --help            show this help message and exit
  --fit FIT             Path to the .fit file. (required)
  --blueprint {none,vertical}
                        Blueprint to use. (default: vertical)
  --map {osm,dark,light,streets,satellite}
                        Map tile style. To use styles other than 'osm', set the environment variable RERUN_MAPBOX_ACCESS_TOKEN. (default: osm)
  --headless            Don't show GUI
  --connect             Connect to an external viewer
  --serve               Serve a web viewer (WARNING: experimental feature)
  --url URL             Connect to this Rerun URL
  --save SAVE           Save data to a .rrd file at this path
  --stdout              Log data to standard output, to be piped into a Rerun Viewer

Rust

cargo run -- --help
Output
Usage: fit-activities-rerun [OPTIONS] --fit <FILE>

Options:
      --spawn
          Start a new Rerun Viewer process and feed it data in real-time

      --save <SAVE>
          Saves the data to an rrd file rather than visualizing it immediately

  -o, --stdout
          Log data to standard output, to be piped into a Rerun Viewer

      --connect [<CONNECT>]
          Connects and sends the logged data to a remote Rerun viewer.

          Optionally takes a URL to connect to.

          The scheme must be one of `rerun://`, `rerun+http://`, or `rerun+https://`, and the pathname must be `/proxy`.

          The default is `rerun+http://127.0.0.1:9876/proxy`.

      --server-memory-limit <SERVER_MEMORY_LIMIT>
          An upper limit on how much memory the gRPC server should use.

          The server buffers log messages for the benefit of late-arriving viewers.

          When this limit is reached, Rerun will drop the oldest data. Example: `16GB` or `50%` (of system total).

          Defaults to `25%`.

          [default: 25%]

      --newest-first
          If true, play back the most recent data first when new clients connect

      --bind <BIND>
          What bind address IP to use

          [default: 0.0.0.0]

      --fit <FILE>
          Path to the .fit file

      --map <MAP>
          Map tile style. To use styles other than 'osm', set the environment variable RERUN_MAPBOX_ACCESS_TOKEN to enable Mapbox instead

          Possible values:
          - osm:       OpenStreetMap
          - dark:      Dark style (Mapbox)
          - light:     Light style (Mapbox)
          - streets:   Streets style (Mapbox)
          - satellite: Satellite style (Mapbox)

          [default: osm]

      --blueprint <BLUEPRINT>
          Blueprint layout to use

          Possible values:
          - none:     No custom blueprint (auto-layout)
          - default:  Default horizontal layout (Map left, Info+Metrics right)
          - vertical: Vertical layout (Map top, Info+Metrics bottom)

          [default: vertical]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Customize MapView

To use a map tile style other than the default osm (OpenStreetMap), set a Mapbox access token as the environment variable RERUN_MAPBOX_ACCESS_TOKEN:

  • A) In .env:

    RERUN_MAPBOX_ACCESS_TOKEN=your_token

    See .env.example for reference.

  • B) Or by exporting it directly:

    export RERUN_MAPBOX_ACCESS_TOKEN=your_token
  • C) Or by setting it in Rerun's Settings -> Map view -> Mapbox access token.

License

MIT

About

Visualize `FIT` activity data in @rerun-io

Resources

License

Stars

Watchers

Forks