Skip to content

WIP Optional ego-size inflation in control_sdc_only obs#475

Open
eugenevinitsky wants to merge 1 commit into
emerge/temp_trainingfrom
ev/ego-size-inflation
Open

WIP Optional ego-size inflation in control_sdc_only obs#475
eugenevinitsky wants to merge 1 commit into
emerge/temp_trainingfrom
ev/ego-size-inflation

Conversation

@eugenevinitsky
Copy link
Copy Markdown

Add env.ego_size_inflation (float fraction, default 0.0). When > 0 and control_mode == control_sdc_only, the SDC's own perceived length/width in its ego observation are scaled by (1 + ego_size_inflation); set 0.05 for +5%. Observation-only: actual sim_length/sim_width used for dynamics, collision, partner observations and rendering are unchanged. No-op in control_vehicles / control_agents / control_wosac.

Add env.ego_size_inflation (float fraction, default 0.0). When > 0 and
control_mode == control_sdc_only, the SDC's own perceived length/width in
its ego observation are scaled by (1 + ego_size_inflation); set 0.05 for
+5%. Observation-only: actual sim_length/sim_width used for dynamics,
collision, partner observations and rendering are unchanged. No-op in
control_vehicles / control_agents / control_wosac.

Plumbed through binding.c, drive.py (kwarg + attribute + C kwargs) and
drive.ini (default 0.0, documented).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 3, 2026 19:33
@eugenevinitsky eugenevinitsky changed the title Optional ego-size inflation in control_sdc_only obs WIP Optional ego-size inflation in control_sdc_only obs Jun 3, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new environment knob, env.ego_size_inflation, to optionally scale the SDC’s self-perceived length/width in its own ego observation (intended for control_sdc_only), without changing simulation dynamics/collision geometry.

Changes:

  • Plumbs ego_size_inflation from Drive(...) (Python) through env init kwargs into the C engine.
  • Applies the inflation factor in write_ego_obs() when writing the ego width/length observation features.
  • Exposes the new key in pufferlib/config/ocean/drive.ini.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pufferlib/ocean/drive/drive.py Adds ego_size_inflation parameter and forwards it into C init kwargs.
pufferlib/ocean/drive/drive.h Stores the new env field and uses it to scale ego width/length observation features.
pufferlib/ocean/drive/binding.c Unpacks ego_size_inflation from Python kwargs into the C env struct.
pufferlib/config/ocean/drive.ini Documents and sets a default value for ego_size_inflation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4598 to +4601
if (env->ego_size_inflation > 0.0f && env->control_mode == CONTROL_SDC_ONLY) {
perceived_width *= (1.0f + env->ego_size_inflation);
perceived_length *= (1.0f + env->ego_size_inflation);
}
Comment on lines +139 to +141
# SDC perceives its own size inflated by this fraction in control_sdc_only obs
# (0 = off, 0.05 = +5%). Observation-only; sim dynamics/collision unchanged.
ego_size_inflation = 0.0
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