Fix NuPlan scene-to-asset-folder mapping for MTGS renderer#111
Fix NuPlan scene-to-asset-folder mapping for MTGS renderer#111WCJ-BERT wants to merge 3 commits into
Conversation
| "%s missing central_log or central_tokens, skipping", yaml_file.name | ||
| ) | ||
| continue | ||
| road_block_name = ( |
There was a problem hiding this comment.
Since cfg comes from yaml.load(), can we simplify this to: cfg.get("central_log", "") or f"{central_log}-{central_tokens[0]}"
|
This looks directionally right, but I think Right now the cache path sets Can we read
when both Could we also add a small test for |
Multiple scene tokens sharing the same MTGS road block config were each trying to resolve their own asset folder (named after their unique token), which only exists for the first token (road_block_name). Fix via two complementary layers: 1. Runtime resolver in main.py (no cache regen required): at server startup, read all MTGS config YAMLs from the configs/ directory and build a token → road_block_name mapping. This is injected as asset_folder_resolver into TrajdataDataSource so any token resolves to its shared asset folder regardless of cache state. 2. Cache pipeline fix in scene_loader.py + nuplan_utils.py: propagate road_block_name as asset_folder through central_tokens_config → scene record → data_access_info so newly built caches also carry the correct mapping. Also add nuplan_private → private to DATASET_NAME_MAPPING in the MTGS server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yaml.load() always returns a dict, so the isinstance/getattr branch is redundant. Use cfg.get() directly, per code review suggestion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the suggestion! Updated the fallback and added a regression test. |
|
Thanks, I will trigger CI. |
|
/ok to test ce985d2 |
Multiple scene tokens sharing the same MTGS road block config were each trying to resolve their own asset folder (named after their unique token), which only exists for the first token (road_block_name).
Fix via two complementary layers:
Runtime resolver in main.py (no cache regen required): at server startup, read all MTGS config YAMLs from the configs/ directory and build a token → road_block_name mapping. This is injected as asset_folder_resolver into TrajdataDataSource so any token resolves to its shared asset folder regardless of cache state.
Cache pipeline fix in scene_loader.py + nuplan_utils.py: propagate road_block_name as asset_folder through central_tokens_config → scene record → data_access_info so newly built caches also carry the correct mapping.
Also add nuplan_private → private to DATASET_NAME_MAPPING in the MTGS server.