cycling_ride (1.29.0)

Published 2026-10-06 15:02:58 +00:00 by Platform

Installation

dart pub add cycling_ride:1.29.0 --hosted-url=

About this package

The ride: session state machine, workout runner, ERG and SIM trainer control, recorder, journal, summary and FIT export. Dart port of CSharp.Package.Cycling.Ride.

cycling_ride

The ride: session state machine, workout runner, ERG and SIM trainer control, recorder, journal, summary and FIT export. Dart port of CSharp.Package.Cycling.Ride.

dart test

Tests shell out to java -jar test/tools/FitCSVTool.jar; Java 21 on PATH.

Traps

  • Corners are measured over a 10 m arc, not between vertices. A route is a polyline: a junction's whole turn sits on one vertex, and a few degrees of wobble between points 2 m apart reads as a 20 m radius. The radius of a bend turning theta over an arc L is L / theta. Braking takes distance, so the limit at s metres from a corner taken at v is sqrt(v^2 + 2as).
  • The cornering limit is a brake, not a display. It feeds back into the simulator at a bounded rate, so the rider loses real momentum and pedals back up to speed; capping only the shown number let the rider arrive at the far side at full speed.
  • Altitude and gradient come off ElevationProfile, never straight off the points. Routed elevations are whole metres a few metres apart, so a flat road reads +-15%. A triangular smoothing window cancels one-sample steps and keeps real hills; the grade is measured across a fixed baseline. Lookups are a binary search because the limiter calls them every tick.
  • A route of one point, or with repeated points, must still ride. A saved route whose geometry never loaded reaches the ride screen like that; a zero-length segment's heading looks outward for one that has a direction.
  • Rejoining part-way is a ride that starts there. Only the position along the route moves; distance, time and climbing start at zero.
  • Pedalling resumes a manual pause once power holds above a floor for a moment; a trainer reports a stray watt or two as the flywheel settles.
  • Wind is ramped in over 30 s, and the power split's wind figure is the difference the weather makes against still air, not the whole air resistance.
  • Shelter is not weather. WindReading.shelterFactor is the share of the wind left behind buildings and trees. It follows the rider within about 2 s, because passing a house at 30 km/h takes seconds; folding it into the speed would put it on the 30 s weather ramp and the shelter would arrive 250 m late.

The code carries no comments, and test/conventions_test.dart fails on one: a name or a named constant says what, and the why goes here or in the commit message.

Details
Pub
2026-10-06 15:02:58 +00:00
125
1.6 MiB
Assets (1)
1.29.0.tar.gz 1.6 MiB
Versions (26) View all
1.30.0 2026-10-28
1.29.0 2026-10-06
1.28.0 2026-10-02
1.27.0 2026-10-02
1.26.0 2026-10-01