carla-map-asset-builder
Docker内のCARLAを使って、fbx + OpenDRIVE(.xodr) から
CARLAマップパッケージ(.tar.gz)をビルドするCLIツールです。
- 必要なファイル(fbx / xodr)は引数で渡す
- CARLAが読むメタデータJSONは引数から自動生成(ユーザーはJSONを意識しない)
- まずは CARLA 0.9.16 をサポート
前提
アセットのcook(取り込み)にはUnreal Engineを含む
ソースビルド済みのCARLA Dockerイメージが必要です。
公式ランタイムイメージ carlasim/carla:0.9.16 単体ではcookできません。
cook可能なイメージ名を --image で渡してください。
セットアップ
uv sync --extra dev
使い方
uv run carla-asset-builder build \
--fbx path/to/mymap.fbx \
--xodr path/to/mymap.xodr \
--image <cook可能なCARLAビルドイメージ> \
--output ./dist
主なオプション:
| オプション | 説明 |
|---|---|
--fbx |
取り込むマップのfbx (必須) |
--xodr |
対応するOpenDRIVE(.xodr) |
--name |
マップ名 (省略時はfbxのファイル名) |
--package |
パッケージ名 (省略時はマップ名) |
--image |
cook可能なCARLAビルドDockerイメージ (必須) |
--output, -o |
出力先 (デフォルト ./dist) |
--carla-version |
対象CARLAバージョン (デフォルト 0.9.16) |
--carla-root |
コンテナ内のCARLAソースルート (デフォルト /home/carla/carla) |
--use-carla-materials / --no-carla-materials |
CARLA標準マテリアル適用 |
--docker-arg |
docker run への追加引数 (複数可、例 --docker-arg=--gpus=all) |
--dry-run |
dockerを実行せず生成コマンドを表示 |
dry-run で中身を確認
uv run carla-asset-builder build --fbx mymap.fbx --xodr mymap.xodr \
--image carla-build:0.9.16 --dry-run
Python APIとして使う
CLIと同じ操作をPythonから直接呼び出せます。
from carla_map_asset_builder import build_map
artifacts = build_map(
fbx="path/to/mymap.fbx",
xodr="path/to/mymap.xodr", # 省略可
name="mymap", # 省略時はfbxのファイル名
image="carla-build:0.9.16", # cook可能なCARLAビルドイメージ
output_dir="./dist",
dry_run=False,
)
# artifacts: 生成された .tar.gz などのパス一覧 (list[pathlib.Path])
より細かく制御したい場合は BuildRequest を組み立てて build() を呼びます
(複数マップを1パッケージにまとめる等)。
from pathlib import Path
from carla_map_asset_builder import BuildRequest, MapAsset, build
request = BuildRequest(
package_name="my_pkg",
maps=[
MapAsset(name="town01", fbx=Path("town01.fbx"), xodr=Path("town01.xodr")),
MapAsset(name="town02", fbx=Path("town02.fbx"), xodr=Path("town02.xodr")),
],
output_dir=Path("./dist"),
image="carla-build:0.9.16",
carla_version="0.9.16",
)
artifacts = build(request)
公開シンボル: build_map, build, BuildRequest, MapAsset, get_ingestor,
SUPPORTED_CARLA_VERSIONS, DEFAULT_CARLA_VERSION。
動作の流れ
- 引数から
Import/レイアウト(fbx / xodr /<package>.json)を一時ディレクトリに生成 - その一時ディレクトリをコンテナに read-only マウントし、
コンテナ内で
make import→make packageを実行 Dist/に生成された.tar.gzを--outputに回収
開発
uv run pytest
テストはDockerを必要としません(メタデータ生成・staging・docker引数組み立てを検証)。
リリース (PyPI)
GitHub Actions による自動リリースを備えています(simple_lanelet2 / tier4/splatsim 方式)。
日常的な流れ:
- PR を作り、
release:major/release:minor/release:patchのいずれか 1つ をラベル付けする - その PR を
mainにマージする release.ymlが自動で:tools/bump_version.pyでpyproject.tomlと__init__.pyのバージョンを上げるvX.Y.Zタグを打って GitHub Release を作成- テスト再実行 → sdist/wheel ビルド → PyPI へ公開
その他の入口:
v*タグを手動 push → そのタグを直接ビルド・公開(hotfix 用)workflow_dispatch(手動実行)→ ビルドのみ、公開はしない(リハーサル)
初回のみ必要な PyPI 側設定(Trusted Publishing):
API トークンは使いません。PyPI の Publishing 設定で pending publisher を1度だけ登録します。
| 項目 | 値 |
|---|---|
| owner | hakuturu583 |
| repository | carla_map_asset_builder |
| workflow | release.yml |
| environment | pypi |
この登録が済むまで publish ステップは失敗し、wheel は artifact として残ります (=リポジトリ外の明示的な設定なしには何も PyPI に届かない、という安全な向き)。
拡張
新しいCARLAバージョンをサポートする場合:
src/carla_map_asset_builder/versions/ に Ingestor を継承したクラスを追加し、
versions/__init__.py の _REGISTRY に登録します。
Metadata
Release files for carla-map-asset-builder 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| carla_map_asset_builder-0.1.0.tar.gz | 25.5 kB | With provenance | Details for carla_map_asset_builder-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| carla_map_asset_builder-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for carla_map_asset_builder-0.1.0-py3-none-any.whl |
Total release size: 41.1 kB
Release files / carla_map_asset_builder-0.1.0.tar.gz
| Download URL | carla_map_asset_builder-0.1.0.tar.gz |
|---|---|
| Size | 25.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3373c3c6bc7539078658bd68edbfe2affbdb8fcae00e39816625ff17d76eab96
|
|
BLAKE2b-256 checksum How to use checksums |
ce4cace79342b98362f5b5ea8a45a7943501590cefb30ec709021d211266b641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logRelease files / carla_map_asset_builder-0.1.0-py3-none-any.whl
| Download URL | carla_map_asset_builder-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fd0a25e2cc9b3be69dbdd7bfcb94416297c5dc7e6e4261246903fd93ec96804
|
|
BLAKE2b-256 checksum How to use checksums |
cdcf989328c58ed6984e99efd5c000692181f5084cebd9cbe0f6ddc5e356cf5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logSecurity for carla-map-asset-builder 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for carla_map_asset_builder-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.