本文へ移動
cccskills
無料GitHub で公開

import-carla-vehicle

Imports an FBX vehicle into a CARLA source build as a spawnable vehicle.<make>.<model> — checks the FBX carries CARLA's 4-wheel bone rig, imports the mesh, then assembles the vehicle through CarlaTools' VehicleAuthoringLibrary (physics asset with kinematic wheel bodies, retargeted anim blueprint, four configured wheel blueprints, the vehicle blueprint), registers it in VehicleFactory through CARLA's own add_vehicle_to_vehicle_factory.py, and verifies it spawns, drives and steers. Use when the user asks to "add a car/truck/van to CARLA", "import a vehicle FBX", or needs a custom drivable vehicle spawnable from the Python API.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md12.9 KB
  • references/vehicle_import.md12.9 KB
  • scripts/check_env.sh6.8 KB
  • scripts/check_input.py7.5 KB
  • scripts/editor/build_vehicle.py16.8 KB
  • scripts/env.sh5.0 KB
  • scripts/import_vehicle.py20.2 KB
  • scripts/verify_vehicle.py7.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Import a vehicle into CARLA

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

python3 scripts/import_vehicle.py ~/models/SK_MyVan.fbx \
    --make ford --model transit --base-type truck --generation 3 --wheel-radius 40

The FBX must be a skeletal mesh whose wheels are bones named Wheel_Front_Left, Wheel_Front_Right, Wheel_Rear_Left, Wheel_Rear_Right. PhysX's PxVehicleDrive4W finds wheels by those exact names — the physics bodies, the WheelSetups and the animation blueprint all address them — so the rig is checked before anything boots.

The result spawns and drives like any native CARLA vehicle:

bp = bp_lib.find('vehicle.ford.transit')
car = world.spawn_actor(bp, world.get_map().get_spawn_points()[0])
car.apply_control(carla.VehicleControl(throttle=0.6, steer=0.2))

Pipeline, schema and constraints: references/vehicle_import.md.

Instructions

Vehicle Import Progress:
- [ ] Step 0: ASK THE USER for make, model, base type, generation and wheel radius
- [ ] Step 1: Check the INPUT FILE first — format, skinned, rig, textures
- [ ] Step 2: Check prerequisites — hand off to build-carla-ue4 on a build FAIL
- [ ] Step 3: Import — boot 1 assembles the vehicle, boot 2 registers it
- [ ] Step 4: Verify it spawns, drives and steers on a running server

Step 0: Ask the user for the attributes

Do this before anything else, every time. Do not infer them from the file name.

askvalueswhy it must be asked
makee.g. ford, tesla, carlafirst half of the blueprint id
modele.g. transit, model3second half of the blueprint id
base typecar / truck / van / bus / motorcycle / bicycleTraffic Manager and most example scripts filter on it
generation1 / 2 / 3asset generation the attribute claims
wheel radiuscentimetresPhysX sizes the suspension from it and nothing in the mesh states it

Optional and worth offering: --wheel-width (defaults to 45% of the radius), --wheel-mass, --steer-angle (default 70°), --special-type (electric, emergency, taxi), --has-lights, --object-type.

Wheel radius is the one number with physical consequences: too small and the car sits in the road, too large and it bounces. Measure it in the authoring scene; failing that, a normal car's wheel diameter is roughly a third of its total height.

Step 1: Check the input file — ALWAYS FIRST

python3 scripts/check_input.py ~/models/SK_MyCar.fbx

Expected input, in one place:

requirementdetail
formatFBX, binary or ASCII. Nothing else is importable — .ma, .mb, .blend, .max, .c4d, .obj, USD, glTF, COLLADA all fail here
kinda skinned/skeletal mesh whose wheels are BONES. A rigid body is a prop, not a vehicle
rigthe four canonical wheel bones: Wheel_Front_Left, Wheel_Front_Right, Wheel_Rear_Left, Wheel_Rear_Right, plus a chassis bone (Vehicle_Base by convention; otherwise inferred)
texturesembedded (FBX export option "Embed Media") or texture files beside the FBX. Absolute paths from the author's machine resolve nowhere
contentsone vehicle per file; animation is not needed and is not imported
unitsauthored in cm or m — the importer converts scene units
known separatelythe wheel radius in cm. It is not in the file and PhysX sizes the suspension from it

Exit codes: 0 usable, 1 wheel bones missing, 2 unusable (wrong format, or not skinned).

[input] SK_Ambulance_export.fbx  2493 KB
[input] PASS  binary FBX
[input] PASS  skinned
[input] PASS  all 4 wheel bones present

Extra bones beyond the wheels and chassis are fine — doors, steering wheel, suspension helpers all pass. The texture line is a warning, never fatal.

import_vehicle.py runs this itself and refuses on a 1 or 2.

Step 2: Check prerequisites

bash scripts/check_env.sh

Beyond a runnable editor this checks the things no step here can create: CarlaTools built with VehicleAuthoringLibrary (hard blocker — see C4), add_vehicle_to_vehicle_factory.py, the donor vehicle blueprint, its four donor wheel blueprints, the donor anim blueprint, and that VehicleFactory has its Vehicles member.

This skill never builds. On a FAIL naming UE4, CarlaUE4Editor or CarlaTools, stop and run [[build-carla-ue4]] against that checkout.

Step 3: Import

python3 scripts/import_vehicle.py ~/models/SK_MyVan.fbx \
    --make ford --model transit --base-type truck --generation 3 --wheel-radius 40

Assembly is done by CarlaTools' VehicleAuthoringLibrary, one library call per step, so the skill never reimplements PhysX wheel setup:

steplibrary functionwhat it produces
physicsSetupVehiclePhysicsAssetconvex chassis (simulated) + KINEMATIC spheres on the four wheel bones
animationCreateVehicleAnimBPa retargeted copy of a template anim blueprint
wheelsConfigureWheel ×4four duplicated wheel blueprints; front pair steers, rear pair takes the handbrake
vehicleCreateVehicleBlueprintduplicated donor BP with mesh, anim class and WheelSetups repointed

Reported per run:

[vehicle] mesh       /Game/Carla/Static/Vehicles/TestAmbulance/SK_TestAmbulance...
[vehicle] size       6.37 x 2.35 x 2.43 m
[vehicle] physics    .../SK_TestAmbulance_PhysicsAsset
[vehicle] anim BP    .../AnimBP_TestAmbulance
[vehicle] wheel      Wheel_Front_Left: BP_TestAmbulance_FLW  steers=True
[vehicle] blueprint  /Game/Carla/Blueprints/Vehicles/TestAmbulance/BP_TestAmbulance
[vehicle] CDO mesh   .../SK_TestAmbulance      <- read back, not assumed

The CDO mesh line matters: the mesh lives on an inherited native component, and a recompile would silently revert it to None (C1), so the importer reads it back.

Other flags:

flagwhy
--nameasset name; defaults to the FBX stem
--donordonor vehicle blueprint to duplicate (default BP_Ambulance)
--donor-anim-bpanim blueprint template to retarget
--wheel-width, --wheel-mass, --steer-anglewheel tuning
--object-type, --special-type, --has-lightsextra FVehicleParameters fields
--meshnominate one mesh when a multi-mesh FBX yields several
--no-registerbuild the assets, leave VehicleFactory alone (not spawnable)
--register-onlyregister an already-built blueprint
--skip-input-checkimport without the canonical wheel bones (it will not drive)
--verbosestream the editor log

The two boots

Both are full editor sessions, not the fast commandlet. CreateVehicleAnimBP retargets animations, and UE's retarget path syncs the Content Browser, which builds a Slate window — in a commandlet that asserts and takes the process down mid-assembly (C6). Registration needs a full editor anyway, to compile the factory blueprint.

Boot 2 runs CARLA's own script, which ships with CARLA and is runnable by hand:

Unreal/CarlaUE4/Plugins/CarlaTools/Content/Python/add_vehicle_to_vehicle_factory.py

It appends an FVehicleParameters to VehicleFactory.Vehicles and saves. The skill supplies its arguments and confirms the factory package changed on disk.

Step 4: Verify

Vehicles need a running server. Assume one is already up — do not start one; if the connection fails, say so and let the user start it. A server keeps content from its startup, so it must be restarted after an import for a pass to mean anything.

python3 scripts/verify_vehicle.py --id vehicle.ford.transit

Five checks, because each catches a different way an import looks fine and is not:

checkwhat it catches
in the library and spawnsa missing factory entry, an unloadable mesh
registered attributesa wrong base_type / generation reaching the library
get_physics_control() reports 4 wheelswheel setups or physics bodies wrong
drives ≥ 3 m at full throttlesimulated (not kinematic) wheel bodies — the classic frozen car
heading changes under full steerfront wheels bound to the wrong bones

--keep leaves the vehicle in the world to look at.

Examples

Example 1: a van

User says: "add this van FBX to CARLA"

# step 0: ask make / model / base type / generation / wheel radius first
bash scripts/check_env.sh
python3 scripts/import_vehicle.py ~/models/SK_MyVan.fbx \
    --make ford --model transit --base-type van --generation 3 --wheel-radius 38
python3 scripts/verify_vehicle.py --id vehicle.ford.transit   # after a server restart

Example 2: an emergency vehicle with lights

python3 scripts/import_vehicle.py ~/models/SK_Ambulance.fbx \
    --make carla --model ambulance2 --base-type truck --generation 3 \
    --wheel-radius 40 --special-type emergency --has-lights

Example 3: build now, register later

python3 scripts/import_vehicle.py ~/models/SK_Prototype.fbx \
    --make acme --model proto --base-type car --generation 3 \
    --wheel-radius 35 --no-register
# later
python3 scripts/import_vehicle.py ~/models/SK_Prototype.fbx --register-only \
    --name SK_Prototype --make acme --model proto --base-type car \
    --generation 3 --wheel-radius 35

Troubleshooting

does not carry CARLA's 4-wheeled rig / missing wheel bones Cause: the FBX's joints are not named as PhysX expects. Solution: rename them in the authoring scene and re-export. --skip-input-check imports anyway and produces a car that cannot drive.

no skin cluster — a CARLA vehicle is a SKELETAL mesh Cause: a rigid-body FBX. Solution: the wheels must be bones. A static mesh belongs to [[import-carla-prop]].

CarlaTools does not expose VehicleAuthoringLibrary Cause: CarlaTools predates CARLA PR #9805. Solution: rebuild CarlaTools against a checkout that has it (C4). There is no fallback: building wheel bodies from editor Python is not a reasonable substitute.

SetupVehiclePhysicsAsset failed Cause: the wheel bones exist in the FBX but not in the imported skeleton, or the mesh has no skinned geometry to hull. Solution: check the reported skeleton, then re-export with skinning intact.

the vehicle blueprint's CDO has no SkeletalMesh Cause: the native-component override did not persist — what a recompile after writing the CDO produces (C1). Solution: re-import; never recompile the assembled blueprint.

Vehicle spawns but will not move at full throttle Cause: wheel bodies simulated instead of kinematic, or no bodies on the wheel bones (C2). Solution: re-import so SetupVehiclePhysicsAsset rebuilds them; check the wheel radius is sane.

Vehicle drives but will not steer Cause: the front wheel blueprints have no steer angle, or the wheel order does not match the bone order (C3). Solution: re-import; --steer-angle sets the angle.

Vehicle sits in the road, or bounces Cause: --wheel-radius does not match the mesh (C2). Solution: measure the wheel and re-import.

Vehicle renders untextured Cause: the FBX embeds no textures, so each slot got a blank material (C5). Solution: re-export with Embed Media, or supply the texture files.

Outputs

  • Content/Carla/Static/Vehicles/<Name>/ — SK_<Name>, its skeleton, <Name>_PhysicsAsset, AnimBP_<Name>, and the FBX's materials.
  • Content/Carla/Blueprints/Vehicles/<Name>/BP_<Name>.uasset — the spawnable vehicle.
  • …/BP_<Name>_{FLW,FRW,RLW,RRW}.uasset — the four configured wheel blueprints.
  • Content/Carla/Blueprints/Vehicles/VehicleFactory.uasset — the entry that makes it spawnable as vehicle.<make>.<model>; untouched with --no-register.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Adds a new ROS 2 message type to CARLA's native ROS 2 interface — the hand-written POD struct under LibCarla/source/carla/ros2/types/msg, its Fast-CDR serialize/deserialize pair, the RIHS01 type hash computed in Docker, the CdrTopicInfo registration and the type-hash test. Use when the user asks to "add a ROS message type", "support sensor_msgs/X in CARLA", "add a carla_msgs type", "why is my type hash warning appearing", or needs a message CARLA does not publish yet. There is no IDL codegen — every step is manual.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Adds a new topic to CARLA's native ROS 2 interface — a publisher (BasePublisher + PublisherImpl, topic suffix, QoS, registration in ROS2::GetOrCreateSensor, a ProcessDataFrom* entry point and its call site in the UE4 plugin) or a subscriber that lets ROS drive an actor. Also covers adding a middleware (RMW) behind IPublisherMiddleware. Use when the user asks to "publish X to ROS from CARLA", "add a ROS topic/publisher/subscriber", "make the obstacle/lane-invasion sensor publish", "add odometry to ROS", or "add another RMW".

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Reads and summarises ScenarioRunner output — the criteria pass/fail tables from --output/--file, the machine-readable --json and --junit result files, and the criteria JSON written alongside a --record recording — and runs the metrics module (metrics_manager.py) to compute custom measurements over a recorded run offline, without the simulator. Use when the user asks "did the scenario pass", "why did it fail", "summarise these results", "compare these runs", or wants distance/speed/lane metrics from a recording.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Gets actor and level 3D bounding boxes and projects them into a camera image as 2D boxes — the dataset-annotation workflow. Lists box geometry, draws 3D boxes in the world via debug, or captures one camera frame and writes an annotated PNG plus a JSON of 2D boxes for matching actors. Use when the user asks to "get bounding boxes", "draw boxes around the cars", "project boxes onto the camera", or "generate a detection dataset / annotations".

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Builds CARLA (branch ue4-dev, Unreal Engine 4.26) from source on Linux end-to-end — UE4 fork, the Carla server (editor C++ modules), the LibCarla Python client wheel, and content — then verifies them against a from-source server. Optionally builds the native ROS 2 interface in (ROS2=1 → --ros2, Fast-DDS/CycloneDDS/Zenoh), which is compile-time only and cannot be enabled later. Use when the user asks to "build CARLA from source", "compile CARLA ue4-dev", "set up CARLA on Ubuntu (incl. 24.04)", "build CARLA with ROS2 support", or "produce a CARLA server + client wheel". Cooking a distributable Dist/ package is a separate skill (package-carla-ue4); running the build is run-carla-server.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

Builds CARLA on Unreal Engine 5.8 from the ue58-dev branch using its CMake build system — configure a preset, then build the carla-unreal / carla-unreal-editor / carla-python-api-install / launch targets — with ROS 2, DLSS, RSS and cook-scope options, and the engine-side build of the CarlaUnreal UE 5.8 fork. There is no Makefile and no Util/BuildTools in this tree, so every UE4 `make` recipe is invalid here. Use when the user asks to "build CARLA UE5", "build ue58-dev", "compile CARLA with cmake", "rebuild the Python API", or hits a CMake configure or target failure.

日本語の概要は準備中です。原文の説明を表示しています。

carla-simulator/carla-agentic-tools42026年9月12日 更新

carla-simulator のスキルをすべて見る

このスキルの問題を報告する