Repository navigation
Laps on loop routes - #68
Merged
Merged
Conversation
The ride engine can now lap a closed route: distance stays the position on the loop while lap and ridden count up, and recording uses ridden. Ghosts are off on lap rides; climbs and segments are timed every lap and keep the fastest. Engine only; the UI and ride wiring follow. Tested with eight new core tests; existing ride tests unchanged. Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lap rides now record, summarise and count towards goals by total distance ridden, and never set the route's best time. The ride request takes laps; the ride state reports lap and ridden; route_is_loop builds the route so old library entries offer laps. Core is tested by gate (fmt, prettier, tsc, clippy, tests); src-tauri was not compiled locally and is checked by CI. Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A closed route now offers a Laps choice in ride setup (once round, 2 to 20, or until I stop). On a lap ride the HUD shows the lap and total distance, and the glide, standings, landmarks and profiles wrap round the loop. Tested with tsc and Prettier; not run in the app. Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rivals, the chase camera and the crowd barriers now carry on across the start line on a lap ride instead of clamping at 0 or the end; the FINISH arch is left out. Distances wrap with wrapGap/wrapDist (page) and the same arithmetic in the native renderer, and the finish at distance == total is not folded back to the start. Page checked by gate (tsc, Prettier); native renderer checked by CI build. Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Explain the Laps choice on closed routes in the README, the wiki's Riding page and HANDOFF: distance on the loop versus ridden, the lap-ride rules agreed in pepperstm#67, and the wrap-around traps. Update the core test count to 107. Not yet smoke-run in the app. Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The road mesh ran from the first route sample to the last, so on a closed route the ground showed through a strip across the road at the line, which a lap ride crosses every lap. A closed route's road now has one more section, the first again, with the texture carried on; both renderers take the section count from the mesh. Also lists VP_SMOKE_LAPS with the smoke-test variables. Tested: road mesh test checks the closing section; npm run check passes; smoke runs across the line on the Demo Loop (three.js). Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs pepperstm#67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RalfLeonFasler
marked this pull request as ready for review
November 7, 2026 21:05
6 tasks
Contributor
Author
|
Hi! A gentle ping on this one, no rush. It still merges cleanly into Heads-up: #74 (pluggable connectors) also changes |
Owner
|
Sorry Ralf, getting around to all the PR's today! |
5 of 6 tasks
pepperstm
added a commit
that referenced
this pull request
Nov 12, 2026
## What Herne Hill Velodrome as a built-in track: the 450 m outdoor track in south London, at its real place, ridden in laps. It's on the home screen as "Herne Hill Velodrome", and ride setup asks which way round: anticlockwise as raced, or clockwise. **Builds on #68 (laps)**, now merged. ## The track - The route is the measuring line, exactly 450 m from the finish line. That's on the home straight just north of the pavilion, as on the aerial photos. It's the same oval as OpenBikeNet's `herne-hill-450` (OpenBikeNet/protocol#6), so riders from other apps line up. - Banked 7° on the straights, rising to 26° in the bends. Riders lean with it. - Painted with the light-blue côte d'azur, the black, red and blue lines, the finish line, the 200 m line and the pursuit lines. The paint stays on the inside whichever way you ride. - A galvanised railing on a kerb round the outside, plain-coloured boards along the straights (no real brands), and floodlights with arms over the track. ## The grounds - The pavilion: brick below, cedar above with the glazed club room, seating steps up to the terrace, dark columns, the wave roof curling over at the back, and the striped loop emblem on the south wall. No Olympic rings. - North of it: the bleachers, the club's containers, the white canopy on three masts, paving and a car park. - In the middle: the junior track, the hard standing, the path in, and the small shelter. - The ground is laid level and kept clear of trees and map buildings. Houses, roads and the railway round it come from the map as usual. No START/FINISH arches or village signs. ## Checked - `npm run check` passes, with 6 new tests: lap length and start point, both directions, banking, the track look, no race barriers, level ground and an empty infield. - Checked a live preview in demo mode on both renderers, riding each way round (`VP_SMOKE_ROUTE=herne-hill` or `herne-hill-clockwise`). - Not yet ridden with a trainer. ## Not sure about - The buildings are sized from OpenStreetMap and photos, so they're close but not surveyed. - The track is drawn round the measuring line, so it sits a few metres inside the real one. The buildings are placed by their distance from the drawn edge, so they still stand as close to it as they really do.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Laps on loop routes, as agreed in #67. On a closed route, ride setup offers Laps: Once round (the default, unchanged), 2, 3, 5, 10 or 20 laps, or Until I stop. It isn't offered on open routes.
crates/core/src/ride.rs):distanceis still the position on the route, in[0, total]. New fields arelap(from 1) andridden(total metres). On a ride without laps,ridden == distanceat all times, so existing behaviour can't change.counts_for_route_best()).ridden.GroupLink::sendalready sends the position on the route, so riders with different lap choices still see each other in the right place.route_is_loopcommand builds the route rather than reading the stored list. Loops imported before this change still get the Laps choice.World::road()adds one closing section). Before this, the ground showed through a strip across the road there, which a lap ride crosses every lap.Closes #67
How it was tested
npm run checkpasses locally (clippy only warns, in lines this PR doesn't touch), and on CI on my fork.VP_SMOKE_LAPS=2 VP_SMOKE_AT=99999. The ride starts 50 m before the line and crosses it. The HUD text readsLap 2 of 2 · 16.07 km, and the bots carry on round the loop.Not tested: the native renderer, which only runs on macOS. Its changes compile and follow the three.js ones line by line, but I haven't run them. Could you give a lap ride across the line a quick look on a Mac?
npm run checkpasses locallyTested on: Linux (Docker, Xvfb), three.js renderer, simulated rider; no hardware
Documentation
docs/wiki/updated, or not needed (Riding.md, Laps section)HANDOFF.mdupdated if structure, formats, decisions or traps changedAnything unfinished or risky?
🤖 Generated with Claude Code