Skip to content

show progress arc while waiting for first map and clean up atomic state#17

Open
JohnN193 wants to merge 6 commits intopr-b-configfrom
pr-c-state-cleanup
Open

show progress arc while waiting for first map and clean up atomic state#17
JohnN193 wants to merge 6 commits intopr-b-configfrom
pr-c-state-cleanup

Conversation

@JohnN193
Copy link
Collaborator

Two related changes: a user-visible feature and the internal state refactor it motivated.

Progress arc
While a job is running but no map has arrived yet, PointCloudMap returns a point cloud arc instead of the blank default. The arc grows from a small sliver to a full circle over 5 minutes, giving visual feedback that the session is active. (Text label added in the next PR.)

Atomic state cleanup

  • Merge activeJob (job ID string) + jobStartTime into a single activeJobState atomic struct — both fields are now updated in one atomic swap, eliminating the window where one is set and the other isn't. Nil pointer replaces the empty-string sentinel.
  • Wrap updatingMapName / updatingMapVersion into an updatingMapInfo struct; nil replaces the != "" guard and fixes a latent bug where version could be set alongside an empty name.
  • Clear activeJob in StopJob to stop the polling loop, while preserving lastPointCloudURL so the final map stays visible after the session ends.
  • machine_part_id is now required at startup (matching machine_id behavior) — safe now that it's auto-populated from the env var.
  • Store logger on AppClient at construction; removes the logger parameter from CheckSensorsDataCapture.

Fix

  • Add page=slam to the StopJob return URL (without it the app backend redirects to /fleet/location/...).

Part of a series: [PR A] → [PR B] → PR C → [PR D]

@JohnN193 JohnN193 mentioned this pull request Mar 20, 2026
@JohnN193 JohnN193 force-pushed the pr-c-state-cleanup branch 2 times, most recently from c2df93b to 71b5798 Compare March 20, 2026 19:58
@JohnN193 JohnN193 force-pushed the pr-b-config branch 2 times, most recently from 6a13444 to de03d7f Compare March 20, 2026 20:08
@JohnN193 JohnN193 force-pushed the pr-c-state-cleanup branch from 71b5798 to 151372c Compare March 20, 2026 20:08
JohnN193 and others added 6 commits March 20, 2026 16:16
While a job is active but no map has been received yet, PointCloudMap
returns a PCD point arc instead of the blank default. The arc grows from
a small sliver to a full circle over 5 minutes, giving the user visual
feedback that the session is running.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- merge activeJob + jobStartTime into activeJobState struct; nil pointer
  replaces empty-string sentinel, and startedAt replaces the separate
  jobStartTime atomic so both fields are updated atomically
- wrap updatingMapName/updatingMapVersion into updatingMapInfo struct; nil
  replaces the != "" guard and fixes a latent bug where version could be
  set with an empty name
- clear activeJob in StopJob (stops polling) while keeping lastPointCloudURL
  so the final map stays visible after a session ends
- store logger on AppClient at construction; drop logger param from
  CheckSensorsDataCapture

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
part_id is now required (from config or env var), matching the existing
machine_id behavior. removes the dead partID != "" guard in initialize.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
// generateProgressRingPCD generates a point cloud of a progress arc indicating elapsed time.
// The arc grows clockwise from 0 to a full circle over progressRingDuration, giving the user
// visual feedback while waiting for the first cloudslam map to appear.
func generateProgressRingPCD(elapsed time.Duration) ([]byte, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when running cloudslam there is always a period of waiting for the job to start, because we have to spin up a job and setup the machine.

now we display something that moves, and in the next pr we expand on that further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant