Skip to content

zyfgi/carsim-guide-skill

carsim-guide

Verified

Operate and automate CarSim simulations from an agent, including safe output and parameter discovery, named Run Control execution contexts, structured overrides, isolated batch sweeps, dataset dependency inspection, control-mode selection, result validation, diagnostics, and version-aware CLI/Simulink/VS API routing. Use for executing, configuring, exploring, or debugging CarSim. Do not use for vehicle-dynamics theory alone, generic dataframe work, or unrelated simulators.

FileKindSize
SKILL.mdskill md6.3 KB
examples/batches/friction_sweep.yamlconfig159 B
examples/batches/mass_friction_grid.yamlconfig198 B
examples/discovery/dataset_tree.pyscript693 B
examples/discovery/find_output.pyscript715 B
examples/discovery/find_parameter.pyscript761 B
examples/scenarios/basic_cruise.yamlconfig380 B
examples/scenarios/friction_change.yamlconfig379 B
examples/scenarios/steering_maneuver.yamlconfig377 B
examples/scenarios/tire_force_output.yamlconfig437 B
examples/scenarios/vehicle_override.yamlconfig376 B
examples/simulink_cosim.pyscript5.5 KB
examples/torque_vectoring.pyscript5.6 KB
references/advanced-controls.mdmarkdown4.0 KB
references/batch-workflows.mdmarkdown1.6 KB
references/compatibility.mdmarkdown1.4 KB
references/control-modes.mdmarkdown1.0 KB
references/database-exploration.mdmarkdown7.4 KB
references/dataset-syntax.mdmarkdown6.6 KB
references/outputs-and-units.mdmarkdown2.1 KB
references/parameter-discovery.mdmarkdown1.4 KB
references/parameters.mdmarkdown3.3 KB
references/python-interface.mdmarkdown7.9 KB
references/run-validation.mdmarkdown2.2 KB
references/scenarios.mdmarkdown3.3 KB
references/simulink-cosim.mdmarkdown4.0 KB
references/troubleshooting.mdmarkdown1.4 KB
references/version-compatibility.mdmarkdown811 B
references/vs-c-api.mdmarkdown3.3 KB
scripts/base_registry.pyscript4.7 KB
scripts/batch_runner.pyscript7.1 KB
scripts/carsim_batch.pyscript23.4 KB
scripts/carsim_errors.pyscript2.2 KB
scripts/control_modes.pyscript1.8 KB
scripts/cosim_model.mother4.7 KB
scripts/database_tools.pyscript16.5 KB
scripts/diagnose_run.pyscript444 B
scripts/diagnostics.pyscript6.9 KB
scripts/discovery_query.pyscript1.0 KB
scripts/dump_dll_exports.pyscript1.9 KB
scripts/output_registry.pyscript8.9 KB
scripts/override_registry.pyscript2.9 KB
scripts/parameter_discovery.pyscript8.6 KB
scripts/parameters.pyscript10.0 KB
scripts/result_contract.pyscript548 B
scripts/scenario_runner.pyscript11.3 KB
scripts/scenario_schema.pyscript4.0 KB
scripts/setup_paths.pyscript11.2 KB
scripts/tv_cosim.mother8.5 KB
scripts/validate_run.pyscript6.1 KB
scripts/version_compatibility.pyscript2.0 KB

references/scenarios.md

View on GitHub
# Generic scenarios (YAML → compile → run → manifest)

A generic scenario describes one ordinary CarSim run: base, timing, road
friction, maneuver profiles, vehicle parameters, extra scalar overrides and
requested output channels. Every registered channel, including tire forces,
is a legal output.

## Define

Start from an example in `examples/scenarios/` (bind the base name first —
see below). Full contract: `schemas/scenario.schema.json`.

```yaml
schema_version: 1
scenario:
  id: double_lane_change_mu08     # also the output directory name
base:
  name: distributed_ev            # resolved via the base registry, never "newest"
simulation:
  dt: 0.001                       # default 0.001 s; any value with integral steps
  duration: 30.0                  # seconds
road:
  friction: 0.8                   # uniform MU_ROAD_CARPET override
maneuver:
  speed_kmh:    [[0.0, 50.0], [30.0, 50.0]]        # closed-loop target table
  steering_deg: [[0.0, 0.0], [5.0, 20.0], [6.0, -20.0], [30.0, 0.0]]  # open-loop SW angle
vehicle:                          # typed VehicleOverrides fields (SI)
  sprung_mass_kg: 1250.0
parameters: []                    # ScalarOverride list: [{keyword: M_SU, value: 1250.0}]
outputs:
  channels: [Vx, Vy, AVz, Fx_L1, Fy_L1]   # exact CSV names; Time is automatic
validation:
  minimum_speed_mps: 1.0          # optional movement acceptance
```

Semantic rules enforced by `scenario_schema.validate_scenario`: dt/duration
positive, finite, integral step count (dt is a default, not a hard limit);
maneuver times start at 0, strictly increase, stay within duration; outputs
must be registered channel names (unknown units fail closed); scalar override
keywords are upper-case tokens with finite values and may not duplicate a
typed vehicle field or touch protected run keywords (TSTEP, TSTOP, ...).

## Bind the base once

```bash
python scripts/base_registry.py --registry bases.local.json --name distributed_ev \
    --base "C:/work/Run_all.par" --version 2024.0 --run-control "<id>" --vehicle "<name>"
```

Resolving re-verifies the SHA256 on every run; a changed base fails instead of
silently switching vehicles.

## Compile and run

```bash
python scripts/scenario_runner.py examples/scenarios/basic_cruise.yaml \
    --registry bases.local.json --out runs          # compile only
python scripts/scenario_runner.py ... --out runs --run   # + solver + validation
```

Compile writes the scenario directory (`base_Run_all.par` snapshot,
`override.par`, `simfile.sim`) and runs compile-time checks: TSTEP equals
EXT_MODEL_STEP, 64-bit DLLFILE pinned, PRODUCT_VER matches the pinned base
version, WRT list non-empty, base hash unchanged. `--run` then calls the
solver, validates the results (see run-validation.md) and finalizes
`run_manifest.json`.

## Artifacts

One directory per scenario: `run_manifest.json`, `base_Run_all.par`,
`override.par`, `simfile.sim`, then after `--run`: `run.csv` (native CarSim
units, 1 kHz), `run_echo.par`, `run_log.txt`, `solver_stdout.txt`. The
manifest records run status/timestamps, CarSim version + solver/DLL hashes,
base name + SHA256, the exact scenario config, artifact paths and input/output
hashes. `input_sha256["scenario.yaml"]` is the portable hash of the saved
scenario snapshot. Absolute PROG, DATADIR, solver, DLL, base, and artifact
paths record machine provenance; they are not portable identity.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall