Git Product home page Git Product logo

trainerjs's Introduction

trainer.js

trainer.js is a Typescript application that lets you experience recorded gpx tracks on your home trainer.

Features of the webapp are:

  • loading and smoothing of a GPX route
  • connecting to your bike trainer (via WebUSB)
  • collecting metrics like power, speed, cadence and heart rate
  • adjusting slope depending on your current position on the GPX route
  • rendering your position into a 3d environment via CesiumJS
  • exporting your stats as a GPX file, so you can share your efforts on Strava or elsewhere

Supported Trainers

Currently there's only one supported bike trainer, but adding others should be fairly easy. With you support, I hope, more trainers will be added soon!

  • Tacx Bushido (t1980)

Adding a new trainer

Connecting your trainer to the Simulation requires a driver first. What is special about trainer.js is, that it already provides a basic ANT+ driver implementation that works via WebUSB. New drivers can build upon this functionality and will work out of the box. A user only needs to load the webpage and all USB control will be handled by bike.js.

WebUSB Driver

Checkout the basic ANT+ driver file for a very lightweight ANT+ driver. It yet handles the very basic message formats, that were needed for the Bushido (t1980).

The Bushido driver builds up on the ANT+ driver and adds only some proprietary messages and the special communication logic. It is capable of reading speed, distance, power, cadence and heart rate from the Bushido control unit. Furthermore, it lets you control the device's simulated slope. The Bushido communication protocol is closed source. However, there have been successful attempts in deciphering the different messages. You can find the documentation here.

trainerjs's People

Contributors

floschnell avatar robertaistleitner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

trainerjs's Issues

Cesium.js doesn't exist

Hi, as referenced here cagnulein/qdomyos-zwift#824 , would be very fun to have a sort of integration from QZ to trainerjs. I was trying to make it up and running but i got this error on npm start

Am I missing something?

ERROR in ./src/index.ts 12:15-34
Module not found: Error: Can't resolve './Cesium' in 'C:\Users\violarob\Downloads\trainerjs-main\src'
resolve './Cesium' in 'C:\Users\violarob\Downloads\trainerjs-main\src'
  using description file: C:\Users\violarob\Downloads\trainerjs-main\package.json (relative path: ./src)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: C:\Users\violarob\Downloads\trainerjs-main\package.json (relative path: ./src/Cesium)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\violarob\Downloads\trainerjs-main\src\Cesium doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\violarob\Downloads\trainerjs-main\src\Cesium.tsx doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\violarob\Downloads\trainerjs-main\src\Cesium.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\violarob\Downloads\trainerjs-main\src\Cesium.js doesn't exist
      as directory
        C:\Users\violarob\Downloads\trainerjs-main\src\Cesium doesn't exist

ERROR in C:\Users\violarob\Downloads\trainerjs-main\src\index.ts
./src/index.ts 5:28-38
[tsl] ERROR in C:\Users\violarob\Downloads\trainerjs-main\src\index.ts(5,29)
      TS2307: Cannot find module './Cesium' or its corresponding type declarations.

webpack 5.73.0 compiled with 2 errors in 22762 ms

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.