优化镜头平滑跟随逻辑,消除抖动现象#3364
Merged
Merged
Conversation
donghaiwang
approved these changes
Dec 16, 2025
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.
修改概述:
修改的详细描述
经过了什么样的测试?
运行效果
动图、视频、截图等
修改概述:优化镜头平滑跟随逻辑,解决视角抖动问题
修改的详细描述
1.调整镜头平滑插值系数:在 run_simulation.py 的 set_spectator_smooth 函数中,将线性插值系数 t 从 0.1 调整为 0.2,加快视角对车辆运动的响应速度,减少滞后累积导致的抖动。
2.统一仿真帧率与视角更新频率:在 carla_environment.py 中,将 fixed_delta_seconds 从 1/20 改为 1/30,与 run_simulation.py 中 clock.tick(30) 保持一致,避免因时序不同步引发的周期性抖动。
经过了什么样的测试?
操作系统:Windows 11
Python 版本:3.7.5(虚拟环境,通过 VSCode 创建与激活)
CARLA 版本:0.9.11
运行结果:
修改前镜头抖动:
555.mp4
修改后镜头p平滑移动:
666.mp4