Skip to content

[MAINTENANCE] Build and run CRM terrain demos without Chrono::VSG#758

Open
DanNegrut wants to merge 2 commits into
mainfrom
feature/crm-headless-demos
Open

[MAINTENANCE] Build and run CRM terrain demos without Chrono::VSG#758
DanNegrut wants to merge 2 commits into
mainfrom
feature/crm-headless-demos

Conversation

@DanNegrut

Copy link
Copy Markdown
Contributor

Summary

src/demos/vehicle/terrain/ returned early unless CH_ENABLE_MODULE_VSG was enabled, so the CRM terrain demos could not be built headless even though demo_VEH_CRMTerrain_WheeledVehicle and demo_VEH_CRMTerrain_TrackedVehicle have complete no-VSG code paths (guarded includes, render = false fallback). In addition, both demos unconditionally dereferenced the (null) visualization system inside the simulation loop, so a headless build would have crashed at the first step.

Changes:

  1. Build the two headless-capable CRM demos whenever CH_ENABLE_MODULE_FSI_SPH is enabled, with or without VSG. With VSG enabled, the built demo set is unchanged. demo_VEH_CRMTerrain_MovingPatch includes VSG headers unconditionally and remains gated on VSG (possible follow-up).
  2. Guard the vis->Synchronize() / vis->Advance() calls with if (vis) in both demos, and include chrono_vehicle/ChVehicleVisualSystem.h directly in the tracked demo (previously reached only transitively through the VSG headers).

Related Issue(s)

None open. The null dereference was unreachable before, precisely because the CMake gate made headless builds of these demos impossible.

Author(s)

Dan Negrut, University of Wisconsin-Madison ([email protected])

Licensing

By submitting this pull request, I agree, that my contribution will be included in Chrono and redistributed under the BSD-3-Clause License.

Backward Compatibility

None affected. With CH_ENABLE_MODULE_VSG=ON, the demo list and runtime behavior are identical to before; the if (vis) guards are no-ops when a visualization system exists.

Detailed Description

Verified headless (no VSG/Irrlicht/OpenGL modules) on Windows 11 building with the AMD HIP SDK 7.1.1 on a Radeon 8060S (gfx1151): both demos build and run; the wheeled demo drives the full CRM patch to completion, and the tracked demo advances with per-step RTF telemetry and CSV output. The underlying null dereference is platform-independent; any headless CUDA/Linux build of these demos would crash the same way.

Post Submission Checklist

  • The pull request is complete
  • The feature has been verified to work with the CMake based build system

DanNegrut added 2 commits July 2, 2026 17:04
The vehicle terrain demo directory returned early unless
CH_ENABLE_MODULE_VSG was enabled, so the CRM terrain demos could not be
built headless even though demo_VEH_CRMTerrain_WheeledVehicle and
demo_VEH_CRMTerrain_TrackedVehicle have complete no-VSG code paths.
Build those two whenever CH_ENABLE_MODULE_FSI_SPH is enabled.
demo_VEH_CRMTerrain_MovingPatch includes VSG headers unconditionally and
remains gated on VSG. With VSG enabled, the demo set is unchanged.
Both demo_VEH_CRMTerrain_WheeledVehicle and _TrackedVehicle dereferenced
the null visualization system in their simulation loops when built and
run without a run-time visualization module. Guard the Synchronize and
Advance calls with if(vis), and include ChVehicleVisualSystem.h in the
tracked demo (previously pulled in only transitively through the VSG
headers). Verified headless on Windows 11 with an AMD Radeon 8060S
(gfx1151, HIP backend); the null dereference is platform-independent.
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