Python API mode: set the weather from the YAML configuration

Open
#744 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
38/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read utils/carla_world_generator.py and trace where the world is loaded from the simulation configuration. Check the CARLA quick start page for the documented Simulation keys. Done means the YAML weather preset and optional overrides are applied before metrics are recorded, so the metrics JSON reflects the configured weather.

Written by the indexing model from the issue text.

Description

Expected behavior
The experiment YAML should allow setting the weather, so experiments are reproducible and match the conditions used to train the model, e.g.:

Simulation:
    Map: 'Town02'
    Weather:
        Preset: 'ClearNoon'
        sun_altitude_angle: 90
        cloudiness: 0

Actual behavior
The world starts with whatever weather the map or the server had. The recorded metrics store that weather, but it cannot be configured.

Steps to reproduce
Run any Python API config (e.g. default_carla_api.yml) and check the weather field in the metrics JSON: it is the map's weather (in my case cloudiness 60, precipitation 40, sun altitude 20).

Environment
Kubuntu 26.04.1 (Ubuntu base, X11 session), kernel 7.0, Intel i9-12900K, 32 GB RAM, NVIDIA RTX 5070 12 GB (driver 580.178.04), Python 3.10, CARLA 0.9.15 in Docker, Behavior Metrics noetic-devel (dec1502), Python API mode.

Possible cause
utils/carla_world_generator.py loads the map but never calls set_weather() from the configuration.

Possible solution
Right after sim_world = client.get_world(), read Simulation > Weather (a carla.WeatherParameters preset plus optional overrides) and apply it with set_weather(). It runs before ControllerCarla reads the weather, so the metrics JSON records the configured weather.

I have the patch ready (only utils/carla_world_generator.py), plus a documentation update for the Simulation key in the CARLA quick start page. The patch also applies cleanly on feature/carla-python-api-metrics, which changes the same file: happy to target whichever branch you prefer.

Related: #742 (external CARLA server in Python API mode, same test setup).

cc Daniel Guerrero (author of feature/carla-python-api-metrics)

Dominant language
Python
Stars
65
Forks
53
Avg merge
7m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JdeRobot/BehaviorMetrics

All issues in JdeRobot/BehaviorMetrics

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.