CARLA usability fixes (HUD, cleanup, substepping) + Ubuntu/2D defaults#462
Open
servinar wants to merge 5 commits intoBerkeleyLearnVerify:mainfrom
Open
CARLA usability fixes (HUD, cleanup, substepping) + Ubuntu/2D defaults#462servinar wants to merge 5 commits intoBerkeleyLearnVerify:mainfrom
servinar wants to merge 5 commits intoBerkeleyLearnVerify:mainfrom
Conversation
Ubuntu's apport_python_hook installs an excepthook on system Python by default, which previously triggered a warning and prevented Scenic from formatting its backtraces on Ubuntu. Treat it the same as exceptiongroup and allow overwriting it.
The HUD object was constructed but never updated or rendered, leaving it permanently blank. Register the HUD's on_world_tick callback so the server FPS counter and frame number stay current, and call hud.tick() and hud.render() each step alongside the camera render.
When a previous simulation crashed or left actors behind in the CARLA world, the next run could see stale walkers, vehicles, controllers, or sensors and behave unpredictably. Add _cleanupWorld() which destroys any leftover actors and call it at the start of createSimulation().
CARLA's physics integrator can become unstable at the default fixed_delta_seconds when objects move quickly, leading to tunnelling and incorrect collision behavior. Enable substepping with a 10ms cap on substep delta and up to 10 substeps per tick, the configuration recommended by CARLA's docs for synchronous mode.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A bundle of small CARLA-related fixes plus one opinionated default change. Each commit is self-contained — happy to drop or split out individual ones if preferred.
Bug fixes:
apport_python_hookin the excepthook check — On Ubuntu's system Python,apport_python_hookis installed as the default excepthook, which previously caused Scenic to warn and skip installing its own backtrace formatter. Treating it the same asexceptiongrouplets Scenic backtraces format correctly out of the box.tick()andrender()in the CARLA simulator —CarlaSimulationconstructed avisuals.HUDbut never calledtick()orrender(), leaving the panel permanently blank. Registeron_world_tickfor FPS counting and callhud.tick()andhud.render()each step alongside the camera render._cleanupWorld()destroys leftovers at the start ofcreateSimulation().substepping = True,max_substep_delta_time = 0.01,max_substeps = 10(the configuration recommended by CARLA's docs for synchronous mode). Reduces tunnelling and improves collision behavior at higher speeds.Opinionated default (open to discussion):
--2dandmode2Dto True. In our usage, the simulator integrations we work with require 2D compatibility mode anyway, so flipping the default removes the need to specify--2don every invocation. Fully open to dropping this commit if the project would rather keep the existing 3D default.Issue Link
N/A — issues encountered during development of CARLA-based driving scenarios.
Checklist
pytestand/or other meansAdditional Notes
The HUD wiring and the auto-cleanup of residual actors were verified end-to-end against a running CARLA server (Town01, ego rear-ended a stopped vehicle). The Ubuntu backtrace fix mirrors the existing
exceptiongrouphandling.