road-vehicle-dynamics
Use HighwayEnv road, lane, vehicle, object, and custom-environment APIs to build and troubleshoot lower-level driving scenarios.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- road-vehicle-dynamics
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use HighwayEnv road, lane, vehicle, object, and custom-environment APIs to build and troubleshoot lower-level driving scenarios.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/custom-environments.md12.8 KB
- 参考文档references/road-vehicle-api.md16.0 KB
- 参考文档references/troubleshooting.md10.9 KB
- 脚本scripts/check_spline_interp.py3.4 KB
03 SKILL.md 正文
Road vehicle dynamics sub-skill
Use this sub-skill when an agent needs to build or inspect HighwayEnv road networks, lanes, vehicles, road objects, connected-lane neighbour detection, controller/behaviour classes, or a custom environment class.
Routing boundaries
- For high-level Gymnasium operation (
gym.make, registration/import fixes, reset/step/render loops, vectorization, multi-agent wrappers, finite-MDP helpers), read../simulation-environments/SKILL.md. - For observation/action/reward configuration details, spaces,
info["rewards"], goal observations, or action-space mismatches, read../observations-actions-rewards/SKILL.md. - For RL training, evaluation rollouts, videos, optional Stable-Baselines3/Torch usage, or long-run safety limits, read
../training-and-evaluation/SKILL.md. - Use this sub-skill for lower-level scenario construction: road topology, lane geometry, object placement, vehicle dynamics/behaviour, custom environment internals, and connected-lane neighbour semantics.
Runtime references and helper
- Read
references/road-vehicle-api.mdwhen constructingRoadNetworkgraphs, converting lane coordinates, adding vehicles/objects, choosing vehicle classes, or diagnosingRoad.neighbour_vehiclesresults across connected lane segments. - Read
references/custom-environments.mdwhen implementing a newAbstractEnvsubclass, overriding scene/reward/termination methods, registering an environment ID, or checking the custom-environment lifecycle. - Read
references/troubleshooting.mdwhen vehicles spawn off-lane, lane indexes are wrong, neighbour detection misses vehicles near segment boundaries, controller actions do not change speed/lane, collisions behave unexpectedly, custom environments fail during reset/step, or interpolation/spline checks fail. - Run
scripts/check_spline_interp.pyas a tiny deterministic smoke check for HighwayEnv's SciPy-freenumpy_interp1dhelper before relying onPolyLane/LinearSpline2Dgeometry in a custom scenario.
Safe default workflow
- Build a
RoadNetworkfirst, using node names plus lane IDs as stableLaneIndextuples such as("a", "b", 0). - Verify each lane with
lane.position(longitudinal, lateral),lane.local_coordinates(position),lane.heading_at(longitudinal), andlane.on_lane(position, ...)before spawning vehicles. - Create a
Road(network=net, np_random=env.np_random, record_history=..., neighbour_vehicles_connected_lanes=...), then append vehicles toroad.vehiclesand obstacles/landmarks toroad.objects. - Prefer
self.action_type.vehicle_classfor controlled ego vehicles inside custom environments; useother_vehicles_type/utils.class_from_path(...)only for non-controlled traffic. - If a scenario has several connected lane segments, set
neighbour_vehicles_connected_lanes=Trueintentionally and document whether old*-v0legacy behaviour must be reproduced. - For custom environments, implement
default_config,_reset, road creation, vehicle creation,_reward, optional_rewards,_is_terminated, and_is_truncated; then run one bounded reset/step smoke test.
Handoff contract
A successful use of this sub-skill should produce one or more of:
- a self-contained road-network and vehicle/object construction snippet;
- an explanation of which lane indexes, longitudinal coordinates, and connected-lane neighbour settings drive the scenario;
- a custom environment skeleton with registration and bounded smoke-test guidance;
- a route to another sub-skill if the blocker is Gymnasium operation, observation/action/reward configuration, or RL training rather than road/vehicle dynamics.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).