-
Notifications
You must be signed in to change notification settings - Fork 14
Visualizer config fixes #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Greptile SummaryRefactored visualizer configuration handling by moving INI file parsing from Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant main
participant ini_parser
participant eval_gif
participant Drive_env
Note over main: Program starts
main->>ini_parser: ini_parse("drive.ini", handler, &conf)
ini_parser-->>main: Parse all config fields
Note over main: Initialize defaults from conf:<br/>show_grid, obs_only, lasers,<br/>goal_radius, init_steps, etc.
main->>main: Parse CLI arguments<br/>(override config values)
main->>eval_gif: eval_gif(22 parameters including<br/>dynamics_model, collision_behavior,<br/>reward values, map_dir, etc.)
Note over eval_gif: No longer parses INI file
eval_gif->>Drive_env: Initialize Drive struct<br/>with all configuration values
eval_gif->>eval_gif: allocate(&env)
eval_gif->>eval_gif: c_reset(&env)
eval_gif->>eval_gif: Render frames and<br/>generate video output
eval_gif-->>main: Return status
main-->>main: Exit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
pufferlib/ocean/env_config.h, line 90-95 (link)logic: Pre-existing bug:
atoi()returns 0 for string values like "control_vehicles" and "create_all_valid" in the INI file. The Python code correctly converts strings to integers (drive.py:90-109), but the C INI parser doesn't handle these string enum values.
2 files reviewed, 1 comment
| .reward_ade = conf.reward_ade, | ||
| .goal_radius = conf.goal_radius, | ||
| .dt = conf.dt, | ||
| .dynamics_model = dynamics_model, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpragnay what is the advantage of doing this? We can just directly take them from the drive.ini (see main)
Changed visualize.c defaults to ini configs so it's easier to debug