Skip to content

Commit 6019663

Browse files
authored
fix(python): expose carla.command namespace on ue5 module layout (#9634 PR #0u) (#9775)
* fix(python): expose carla.command namespace on ue5 module layout The ue5-dev wheel installs `carla` as a single extension module (carla.cpython-*.so), not a package, so PythonAPI/carla/__init__.py is never executed at import time. Registering the command submodule as "carla.command" via PyImport_AddModule places it directly in sys.modules, which makes `from carla.command import ...` work without any __init__.py shim. Verified: from carla.command import SpawnActor, DestroyActor; carla.command.SpawnActor.__module__ == 'carla.command'. Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * docs(changelog): note carla.command namespace fix Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> --------- Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
1 parent 2c88529 commit 6019663

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## LATEST Changes
22

3+
* Fixed `from carla.command import ...` on the Python API by registering the `command` submodule under `carla.command` in `sys.modules` (the ue5 wheel ships `carla` as a bare extension module, so the previous `libcarla.command` namespace was not importable).
34
* Modernized the Python navigation agents with type hints and code cleanup ported from `ue4-dev`, added typed obstacle/traffic-light detection-result tuples in `agents/tools/hints.py`, reworked `BasicAgent.set_destination` to accept an optional start location and queue-clean flag, and fixed obstacle detection treating an empty `vehicle_list` as "all vehicles".
45
* Updated the `invertedai_traffic.py` example with InvertedAI quality-of-life improvements for ego-vehicle integration and video generation.
56
* Added fisheye camera sensors (`sensor.camera.rgb_fisheye`, `sensor.camera.depth_fisheye`, `sensor.camera.semantic_segmentation_fisheye`, `sensor.camera.instance_segmentation_fisheye`) using the Kannala-Brandt projection model. Each variant captures up to 6 cubemap face render targets (the back face is skipped unless the FOV or equirectangular mode requires it) and composites them through a custom HLSL shader (`Plugins/Carla/Shaders/WideAngleLens.usf`) using configurable distortion coefficients. See `PythonAPI/examples/manual_control_fisheye.py` for an interactive demo. Ported from ue4-dev.

PythonAPI/carla/src/Commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void export_commands() {
5050

5151
using ActorPtr = carla::SharedPtr<cc::Actor>;
5252

53-
object command_module(handle<>(borrowed(PyImport_AddModule("libcarla.command"))));
53+
object command_module(handle<>(borrowed(PyImport_AddModule("carla.command"))));
5454
scope().attr("command") = command_module;
5555
scope submodule_scope = command_module;
5656

0 commit comments

Comments
 (0)