Skip to content

Implement basic stop logic - #586

Open
Victorbares wants to merge 5 commits into
3.0from
vb/stop_logic
Open

Implement basic stop logic #586
Victorbares wants to merge 5 commits into
3.0from
vb/stop_logic

Conversation

@Victorbares

@Victorbares Victorbares commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

What

Adds stop-sign compliance logic and rewards to the PufferDrive C engine:

  • Infraction Logic: Detects stop-sign crossings. Agents must stop (≤ threshold) for ≥ 5 consecutive
    timesteps within 5m of the stop line.
  • Z-Axis Validation: Filters out false-positive violations for multi-level roads (e.g. overpasses)
    using Z_BUFFER.
  • Config & Metrics: Adds traffic_control_scope to configs and exposes stop_sign_violation_rate and
    reward penalties (sharing the reward_stop_line coefficient) to Python.

Why

  • Ensures realistic traffic compliance and prevents unsafe behaviors at intersections while avoiding
    false-positives on stacked/multi-level map geometries.

Notes

  • Fully compliant with safety-critical C standards (no malloc/free, zero warnings).
  • Shares the existing reward_stop_line coefficient to avoid config bloa

@Victorbares Victorbares changed the title Vb/stop logic Implement basic stop logic Sep 3, 2026
@Victorbares
Victorbares marked this pull request as ready for review September 3, 2026 08:27
Comment thread pufferlib/config/puffer_drive.yaml Outdated
Comment thread pufferlib/ocean/drive/constants.h Outdated
Comment thread pufferlib/ocean/drive/constants.h Outdated
Comment thread pufferlib/ocean/drive/constants.h Outdated
@Victorbares
Victorbares marked this pull request as draft September 3, 2026 08:35
@Victorbares
Victorbares marked this pull request as ready for review September 3, 2026 14:52
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.

2 participants