Examples — CLI demo binaries¶
VDSim 의 10 CLI binaries. build/bin/ 에 위치.
| Binary | Purpose |
|---|---|
vdsim_bicycle_run |
Single tier (Ld1-Bicycle, Lc4-Pedal) scenario runner |
vdsim_scenario_run |
Scenario YAML → 14-column time-series CSV |
vdsim_l1_vs_l2 |
동일 scenario 의 Ld1 vs Ld2 paired CSV |
vdsim_ax_track_demo |
Lc5-AxTarget PID step profile on Ld2 |
vdsim_path_tracking |
Lc4 ← Lc5 ← Lc6 ← Lc7 cascade on figure-eight |
vdsim_driver_demo |
DriverModel (latency + Gaussian noise) on Ld2 |
vdsim_l3_demo |
Ld3-FourteenDOF transient trace with susp_velocity dump |
vdsim_split_mu_demo |
Open / Locked / LSD differential comparison |
vdsim_l1_vs_l2 (paired) |
identical scenario, two dynamics tiers side by side |
vdsim_scenario_run |
flexible scenario runner with time-varying mu |
Quick example¶
# Resolve presets via vdsim_lab (catalog-backed), then run a binary:
python3 -c "import sys; sys.path.insert(0,'python'); from vdsim_lab import Vehicle,Tire; \
v,t=Vehicle.preset('sports'),Tire.preset(); print(v.vp,t.tp)"
build/bin/vdsim_path_tracking /tmp/vehicle.yaml /tmp/tire.yaml /tmp/path.csv 8.0
Outputs /tmp/path.csv with t, x, y, yaw, vx, ... columns. Visualize with
either:
- Python:
matplotlibon the CSV. - Browser: load the CSV into the 3D viewer.
Python (pybind11)¶
import sys; sys.path.insert(0, "build/python")
import vdsim
import sys; sys.path.insert(0, "python")
from vdsim_lab import Vehicle, Tire
vp = Vehicle.preset("sedan").vp
tp = Tire.preset().tp
sp = vdsim.SolverParams()
dyn = vdsim.create_seven_dof()
dyn.initialize(vp, tp, sp)
s = vdsim.State(); s.velocity = [10.0, 0.0, 0.0]; dyn.reset(s)
contacts = [vdsim.ContactPoint() for _ in range(4)]
for c in contacts: c.is_valid = True; c.normal = [0,0,1]; c.mu_long = c.mu_lat = 1.0
cmd = vdsim.CmdL4(); cmd.steer_angle_wheel = 0.05
for _ in range(1000): dyn.step(cmd, contacts, 0.005)
print(f"vx_end = {dyn.state().vx():.3f}, r = {dyn.state().yaw_rate():.4f}")
Sweep across parameters¶
3 × 3 = 9 cells (aero_drag_coeff × initial_vx) → /tmp/sweep_out/<tag>/ per cell.