← Files text-to-cadARCHIVED FILE
skills/sdf/references/smoke-tests.md
3.29 KB · Oct 6, 2026 · 00:02 UTC
# SDF smoke tests Use smoke tests after the SDF passes bundled validation. The goal is to catch simulator and spatial failures that dependency-light XML checks cannot detect. ## Recommended checks ### Bundled validation ```bash cadgen sdf validate path/to/model.sdf cadgen sdf validate path/to/model.sdf --strict ``` Use `--strict` when warnings should block handoff. It is safe on any machine: the default `--gz-check auto` notes a missing `gz` as `info` rather than a finding against the file, so `--strict` fails only on the document's own warnings. ### SDFormat parser check `cadgen sdf validate` already runs `gz sdf --check` whenever `gz` is on PATH. Run it directly to read the parser's own output: ```bash gz sdf --check path/to/model.sdf ``` or make it mandatory, so a missing `gz` is an error instead of a note: ```bash cadgen sdf validate path/to/model.sdf --gz-check required ``` Use the exact simulator environment that will consume the file when possible. ### Simulator load check Load the model or world in the target simulator and check: - no parser warnings or plugin load errors; - model appears at the intended pose; - visual and collision assets resolve; - collision geometry is not visibly offset from visuals; - dynamic model does not explode, fall through the floor, or produce invalid inertia warnings. ### Joint motion check For each non-fixed joint: - command a small positive motion; - confirm the moving child moves in the expected direction; - confirm limits stop motion where expected; - confirm continuous joints can rotate continuously if intended. ### CAD Viewer static review After generating or modifying an `.sdf`, show it ([Show the model](../SKILL.md#show-the-model)). Report any failure explicitly. - confirm direct model links, joints, frames, visuals, and collisions are placed correctly; - confirm includes, plugins, sensors, lights, nested models, and unsupported geometry are listed as static metadata; - record any simulator-only behavior that CAD Viewer cannot execute. ### Sensor and plugin check For each sensor or plugin: - confirm plugin library loads; - confirm expected topics/services appear; - confirm frame names match the design ledger; - confirm update rate and namespace behavior; - capture one sample output if practical. ### Visual review Return the live CAD Viewer link, or explicitly report why launching failed. Visual review is useful but insufficient: it can catch gross placement and mesh problems, but it cannot prove axis frames, inertials, dynamics, or plugin behavior. ## Report format Use a compact report: ```text Checks run: - bundled SDF validation: passed - gz sdf --check: skipped, gz not installed - simulator load: passed in Gazebo Harmonic - joint motion: shoulder_pan positive motion verified; gripper joints skipped - plugin startup: camera plugin unresolved, requires target simulator package Assumptions: - Assumed mesh units are meters. - Assumed lidar frame is coincident with lidar_link. ``` ## When to stop Stop and fix the SDF (or its upstream assets) when: - bundled validation has errors; - `gz sdf --check` fails under a required external-check policy; - the simulator reports invalid inertias or unresolved required assets; - a joint moves opposite from the documented positive direction; - plugin startup fails for a plugin required by the task.
SHA-256: 41b14a43a643a803923e31503962b051ce49704b25ea9332de64d18a88161025