Skip to content

auto-populate machine IDs from env vars and validate sensor config#16

Open
JohnN193 wants to merge 4 commits intopr-a-depsfrom
pr-b-config
Open

auto-populate machine IDs from env vars and validate sensor config#16
JohnN193 wants to merge 4 commits intopr-a-depsfrom
pr-b-config

Conversation

@JohnN193
Copy link
Collaborator

Config and validation improvements.

  • machine_id and machine_part_id now fall back to VIAM_MACHINE_ID / VIAM_MACHINE_PART_ID env vars injected by viam-server — neither needs to appear in the module config
  • Before starting a session, validate that each configured sensor has an appropriate data capture method enabled (NextPointCloud for cameras; any enabled method for movement sensors)
  • stop DoCommand now surfaces the session's error message when the job ended in failure
  • README updated to reflect optional status and env var defaults

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-b-config branch 3 times, most recently from 6a13444 to de03d7f Compare March 20, 2026 20:08
JohnN193 and others added 4 commits March 20, 2026 16:16
machine_id and part_id are now optional in config — if not set, they fall
back to VIAM_MACHINE_ID and VIAM_MACHINE_PART_ID env vars injected by the
Viam agent. machine_id is still required (either via config or env).

Also fixes Config.Validate signature to match updated rdk interface
(now returns required deps, optional deps, error).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before starting a cloudslam session, check that each configured sensor
has an appropriate data capture method enabled in the machine part's
config. Cameras require NextPointCloud; movement sensors require any
enabled capture method.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After stopping a mapping session, fetch the session metadata and return
an error with the failure message if the session ended with END_STATUS_FAIL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
machine_id and machine_part_id are now auto-populated from viam-server
env vars, so they no longer need to appear in the example config.
Update attribute table to reflect optional status and defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
// CheckSensorsDataCapture verifies that all of the provided sensors have at least one enabled
// data capture method configured in the machine part's config. Returns an error listing any sensors
// that are missing enabled capture.
func (app *AppClient) CheckSensorsDataCapture(ctx context.Context, partID string, sensors []*cloudslamSensorInfo, logger logging.Logger) 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.

The most common failure for cloudslam was the machine being misconfigured, since we rely on data capture for using cloudslam. Been wanting this check for awhile tbh

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