Optimize actuator control signal retrieval - #172
Open
jonyMarino wants to merge 1 commit into
Open
Conversation
jonyMarino
marked this pull request as ready for review
July 30, 2026 17:56
❌ ProjectAirSim Self-Hosted CI
|
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.
About
This PR optimizes how actuator control signals are retrieved during simulation updates.
Previously, every actuator requested its control signals by actuator ID on every update. This required repeated map lookups and, depending on the controller, repeated locks and temporary vector allocations.
This change:
std::arraywhen passing signals to actuators.GetControlSignals(int signal_index)return exactly one signal.This removes repeated map lookups, virtual calls, locks, and dynamic allocations from the actuator update loop. It also ensures that every actuator consumes signals from the same controller state during a simulation tick.
How Has This Been Tested?
The following targets were successfully built and linked on Windows:
core_simmultirotor_apirover_apicore_sim_gtestsmultirotor_api_gtestsrover_api_gtestsTest results:
core_sim: 277 tests passed.multirotor_api: 1 test passed.rover_api: test executable passed; no tests are currently registered.git diff --checkcompleted successfully.Screenshots and videos (if appropriate):
Not applicable. This PR only changes internal control-signal handling and does not introduce visual changes.