Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pufferlib/ocean/drive/drive.h
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,8 @@ void draw_agent_obs(Drive* env, int agent_index, int mode, int obs_only, int las
return;
}

int max_obs = 10 + 7*(MAX_AGENTS - 1) + 7*MAX_ROAD_SEGMENT_OBSERVATIONS;
int ego_dim = (env->dynamics_model == JERK) ? 10 : 7;
int max_obs = ego_dim + 7*(MAX_AGENTS - 1) + 7*MAX_ROAD_SEGMENT_OBSERVATIONS;
float (*observations)[max_obs] = (float(*)[max_obs])env->observations;
float* agent_obs = &observations[agent_index][0];
// self
Expand All @@ -2376,7 +2377,7 @@ void draw_agent_obs(Drive* env, int agent_index, int mode, int obs_only, int las
DrawCircle3D((Vector3){goal_x_world, goal_y_world, 0.1f}, env->goal_radius, (Vector3){0, 0, 1}, 90.0f, Fade(LIGHTGREEN, 0.3f));
}
// First draw other agent observations
int obs_idx = 10; // Start after ego obs
int obs_idx = ego_dim; // Start after ego obs
for(int j = 0; j < MAX_AGENTS - 1; j++) {
if(agent_obs[obs_idx] == 0 || agent_obs[obs_idx + 1] == 0) {
obs_idx += 7; // Move to next agent observation
Expand Down