Generate CARLA blueprints dynamically#401
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #401 +/- ##
==========================================
- Coverage 89.70% 89.65% -0.06%
==========================================
Files 48 48
Lines 13190 13190
==========================================
- Hits 11832 11825 -7
- Misses 1358 1365 +7 🚀 New features to boost your workflow:
|
get dimensions for all blueprints fallback for 0.9.14 0.0 dims bug hard-code blueprint vehs with no base_type
dfremont
left a comment
There was a problem hiding this comment.
Looks good in general. Besides some minor comments above, my only suggestion is that since blueprints.py is now very long and difficult to read, let's try splitting it into two files. The non-autogenerated part can stay in blueprints.py, but let's move the giant _IDS and _DIMS dictionaries into a separate _blueprintData.py module and then do from _blueprintData import _IDS, _DIMS. The make_blueprints.py script can then just generate _blueprintData.py.
|
@dfremont Thanks for the review. I split out |
dfremont
left a comment
There was a problem hiding this comment.
Looks good, thanks Lola!
Description
This PR generates CARLA blueprints dynamically (per CARLA version).
-
snapshot_blueprints.py: connects to CARLA, collects blueprint IDs and bounding-box dimensions for the running server version, categorizes them for Scenic, and writestools/carla/snapshots/blueprints_<VERSION>.json.-
make_blueprints.py: reads all snapshot JSONs, sorts/normalizes them, and regeneratessrc/scenic/simulators/carla/blueprints.py.-Generated
blueprints.py: selects the best-matching snapshot for the installed CARLA version and exposes ids, dims, and helper functions.-Handles versions that lack certain categories (e.g., CARLA 0.10.0 has no bicycles).
-Uses measured dimensions when available; otherwise falls back to defaults.
-Adds
vanModelsandbusModelscategories based on CARLA’sbase_type.Issue Link
N/A
Checklist
pytestand/or other meansAdditional Notes
N/A