Skip to content

External driven clock#140

Merged
LucasJSch merged 9 commits into
mainfrom
IAMAI/external_driven_clock
May 20, 2026
Merged

External driven clock#140
LucasJSch merged 9 commits into
mainfrom
IAMAI/external_driven_clock

Conversation

@jonyMarino
Copy link
Copy Markdown
Contributor

@jonyMarino jonyMarino commented Apr 10, 2026

Overview

This pull request introduces a new engine-driven simulation clock mode to Project AirSim, enabling the simulation to be advanced by Unreal's loop. This mode is designed for deterministic, fixed-step simulation where the host is responsible for providing elapsed time and triggering simulation ticks. The changes include the implementation of the EngineDriveClock class, updates to scene and clock management, Unreal integration, and comprehensive documentation updates.

Besides that, a placeholder external-clock was added for future use. The idea is to implement a capability to control the clock of the simulation from an outside source/orchestrator.

Simulation Clock Enhancements:

  • Added a new EngineDrivenClock class, which allows Unreal's engine drive simulation time by supplying elapsed time and triggering steps in fixed increments (step-ns). This class provides methods for accumulating time, checking for pending steps, and stepping the simulation deterministically. [1] [2]
  • Updated ClockType and related configuration to support the new engine-driven type, including schema, constants, and clock selection logic. [1] [2] [3] [4]

Scene and Simulation Loop Integration:

  • Modified the scene tick logic to bypass the internal scheduler when engine-driven clock is selected, allowing the host to control simulation advancement via the new ExternalTick() method. [1] [2] [3] F97d1f83L97R1078, [4]

Unreal Engine Integration:

  • Updated Unreal integration to detect and use the EngineDrivenClock, synchronizing Unreal's tick timing with the simulation step size and safely handling clock type detection without RTTI.

Documentation Updates:

  • Expanded documentation to describe the new engine-driven clock, its configuration, use cases, and integration patterns. Updated API and configuration references to include the new clock type. [1] [2] [3] [4] [5]

Code Quality and Comments:

  • Added clarifying comments throughout the clock and scheduler code to improve maintainability and developer understanding. [1] [2] [3] [4] [5] [6] [7]

These changes make Project AirSim more flexible and embeddable, supporting advanced integration scenarios with external runtimes and engines.

@LucasJSch LucasJSch force-pushed the IAMAI/external_driven_clock branch from 3331ee6 to 4d6e86f Compare May 14, 2026 18:25
Comment thread core_sim/src/constant.hpp
Comment thread core_sim/src/scene.cpp
@LucasJSch LucasJSch self-requested a review May 19, 2026 18:09
@github-actions
Copy link
Copy Markdown

✅ ProjectAirSim Self-Hosted CI

  • Status: success
  • Pytest results: tests=161, failures=0, errors=0, skipped=0
  • Artifacts: test-results

View full workflow run

Copy link
Copy Markdown
Collaborator

@LucasJSch LucasJSch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LucasJSch LucasJSch merged commit 56d6b3d into main May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants