跳到正文
Skillpedia
其他15k · #11085

control-lights

它能做什么

该技能控制 CARLA 地图的光源。适合希望设置模拟城市夜间氛围的人。

适用场景

  • ✓当你希望在模拟器中开启或关闭路灯或建筑灯的时候。
  • ✓当你希望更改地图灯光的颜色或亮度的时候。
  • ✓当你希望灯光在夜间自动亮起的时候。

技能链接

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/python-api/control-lights/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请用暖色开启路灯,并让建筑灯在夜间自动亮起。”

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

工作原理

智能体会列出灯光组,然后开启或关闭某个灯光组,设置其颜色和强度,或切换自动昼夜循环。你需要指定灯光组,例如街道、建筑、车辆或全部。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Control light sources

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.

Switch and tune the world's illumination — street lamps, building lights, vehicle lights — via the LightManager. These are actual light sources (they cast light): different from toggle-env-objects (which hides the lamp geometry) and set-weather (the sun). Effects show on a rendered server.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear FAILs
- [ ] Step 2: list a group to see counts/states
- [ ] Step 3: on / off / set a group, or toggle the day-night cycle

Commands need CARLA_HOST/CARLA_PORT from scripts/env.sh.

Step 1: Check prerequisites

bash scripts/check_env.sh

Step 3: Control

source scripts/env.sh

python3 scripts/lights.py list --group street              # counts + a sample

# light up the streets, warm colour
python3 scripts/lights.py on --group street --color 255,220,150 --intensity 2000
# turn building lights on for a night-city look
python3 scripts/lights.py on --group building
# turn everything off
python3 scripts/lights.py off --group all

# recolour without toggling
python3 scripts/lights.py set --group street --color 150,200,255

# let lights switch on/off automatically with the sun
python3 scripts/lights.py day-night on

Groups: street, building, vehicle, other, all.

Examples

Example 1: night city

User says: "make it a lit-up city at night"

Set night with set-weather (sun_altitude_angle negative), then on --group street and on --group building.

Example 2: blackout

User says: "kill all the lights"

off --group all.

Example 3: automatic dusk lighting

User says: "have the street lights come on by themselves at dusk"

day-night on.

Troubleshooting

Problem: no visible change Cause: headless -nullrhi server (no rendering), or it's daytime so lights wash out. Solution: use a rendered server; set night (set-weather) to see them clearly.

Problem: list shows 0 lights Cause: this map has few/no light sources of that group, or wrong group. Solution: try --group all; some maps have sparse building lights.

Problem: lights won't stay on Cause: the day-night cycle is auto-switching them. Solution: day-night off, then set them manually.

Outputs

Illumination state on the server (on/off, colour, intensity, auto-cycle). No file. list reports per-group counts and a sample.

Detail (LightManager API, groups, colour/intensity units, day-night) in references/lights.md.

常见问题

这与更改天气有什么不同?

天气改变的是太阳和天空,而这个技能改变的是地图上的光源。

我能在屏幕上看到变化吗?

效果只会在渲染图像的服务器上显示。

有哪些灯光组?

路灯、建筑和立面灯、车辆灯,或全部灯光。

详情

作者的原始描述

Controls the map's light sources through the CARLA LightManager — turn street lamps, building/facade lights, vehicle lights or all of them on/off, set their colour and intensity, and toggle the automatic lights-at-night cycle. Use when the user asks to "turn on the street lights", "light up the city at night", "turn off building lights", "change the street-light colour", or "make lights come on automatically at night". Distinct from hiding lamp meshes (toggle-env-objects) and the sun (set-weather).

repo: carla-simulator/carla

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能