跳到正文
Skillpedia
部署与云(DevOps)15k · #11126

package-carla-ue4

它能做什么

这项技能把 CARLA 构建打包成可直接分享的压缩文件,可以是完整模拟器,也可以是选定的资源集合。适合需要把 CARLA 环境分发给他人的人。

适用场景

  • ✓当你想创建一个打包好的 CARLA 副本,用于分享或保存的时候。
  • ✓当你想把一张或多张自定义地图导出为软件包,供他人导入时。
  • ✓当你需要在打包的构建中保留原生 ROS 2 接口的时候。

技能链接

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/ue4/package-carla-ue4/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/ue4/package-carla-ue4/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我把 CARLA 构建打包成可分享的压缩文件,并保留其中的 ROS 2 接口。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会运行准备模拟器的 cook 步骤,然后把结果保存为 Dist 文件夹中的压缩文件。软件包名称中会包含版本标签,方便你区分不同的构建。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Package CarlaUE4

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.

make package produces two different artifacts depending on --packages:

Mode Command Output Cook driven by
Release bash scripts/package.sh Dist/CARLA_<tag>.tar.gz Config/DefaultGame.ini
Asset package PACKAGES=<Name> bash scripts/package.sh Dist/<Name>_<tag>.tar.gz <Name>.Package.json

Instructions

Copy this checklist and track progress — the run is long and gated, so a skipped step usually surfaces an hour in:

Package Progress:
- [ ] Step 1: Activate the client Python env, run check_env.sh, clear FAILs
- [ ] Step 2: Cook — 2a full release, or 2b a named asset package
- [ ] Step 3: Verify the artifact exists, is the right size, and is in Dist/
- [ ] (opt-in) Run or import the build — only if asked to run/load it

Step 1: Activate your Python env, then check prerequisites

The wheel stage runs python3 -m build, so have your CARLA client environment active first — the one whose python3 imports build and carla. Any manager works (venv, conda, system); the skill assumes none and pins no version. If you drive this non-interactively, either activate the env in the same shell, or point CARLA_ENV_ACTIVATE at its activate script — the only hook the skill looks at. Only set CARLA_PY_VERSION if you deliberately need a version-suffixed interpreter — and it must resolve inside that env, or the wheel escapes to the wrong Python.

bash scripts/check_env.sh

Fix warnings about the wheel python and missing content before starting — both cost most of the build time before they surface.

Step 2a: Full release

bash scripts/package.sh 2>&1 | tee /tmp/carla_package.log

30-90 min cold, not resumable.

Step 2b: Standalone asset package

For distributing maps and props, or for a cheap sensor-capable build containing one town instead of thirteen.

A package is defined by a JSON found anywhere under Content/ — the package name is the filename minus .Package.json. It needs no matching directory, so stock maps can be exported as-is:

# define it (writes Content/Carla/Config/OneTown.Package.json)
python3 scripts/package_json.py OneTown --map Town02 --carla-materials

# cook it
PACKAGES=OneTown bash scripts/package.sh

Each map needs <MapName>.xodr under an OpenDrive/ directory somewhere in Content/. package_json.py --check verifies this; a missing .xodr yields a package that imports but has no road network.

Step 3: Verify

scripts/package.sh already checks the expected artifact by name, size and location, and fails loudly if it is missing — make can exit 0 having produced nothing. Confirm independently:

ls -la "${CARLA_UE4_ROOT:?}"/Dist/

A release is several GB; low megabytes means the cook ran without content.

This is where the skill stops by default. The deliverable is the verified artifact in Dist/ (or in PACKAGE_DEST, below). Booting or importing it is a separate, opt-in step — do it only when the request explicitly asks to run or load the result.

Placing artifacts outside Dist/

Set PACKAGE_DEST to a directory to land the artifact elsewhere. It is applied after verification: PACKAGE_DEST_MODE=move (the default) relocates the verified artifact and leaves no multi-GB duplicate in Dist/; PACKAGE_DEST_MODE=copy keeps Dist/ intact. So "package CARLA into <dir>" is a move, "package CARLA and copy it to <dir>" is a copy.

# move the release into ~/dev/Carla/packages/ (nothing left in Dist/)
PACKAGE_DEST=~/dev/Carla/packages bash scripts/package.sh
# copy instead, keeping Dist/
PACKAGE_DEST=~/dev/Carla/packages PACKAGE_DEST_MODE=copy bash scripts/package.sh

ROS 2 packages (ROS2=1)

ROS2=1 bash scripts/package.sh          # release WITH the native ROS 2 interface

Package.sh has no ROS 2 option — support is inherited from the editor build. But make package depends on CarlaUE4Editor, so every cook re-runs BuildCarlaUE4.sh, which rewrites Unreal/CarlaUE4/Config/OptionalModules.ini. Cook without ROS2=1 and that rewrite says Ros2 OFF: the package loses ROS 2 even though the checkout was built with it, with nothing in the log to say so.

常见问题

发布版和资源包有什么区别?

发布版会打包整个模拟器,资源包只包含选定的地图和道具。

普通的 cook 会保留 ROS 2 吗?

不会。普通 cook 会悄悄去掉 ROS 2 接口,因此必须刻意保留它。

打包前需要先激活 Python 环境吗?

需要。打包步骤会构建 Python 部分,因此必须先激活你的 CARLA Python 环境。

详情

作者的原始描述

Cooks and packages CarlaUE4 into distributable tarballs under Dist/ — either the full simulator or a standalone asset package of selected maps and props for later import. ROS2=1 keeps the native ROS 2 interface in the cooked package (a plain cook silently drops it). Use when the user asks to "package CARLA", "make a Dist build", "cook the project", "export a map as a package", "package CARLA with ROS2", or needs a build with working camera and lidar sensors.

repo: carla-simulator/carla

热度

GitHub 星标
15k
排名
#11126
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能