Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_HAL_SITL: improve periph simulation efficiency #27541

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

tpwrules
Copy link
Contributor

Removes busywait for simulation state packet, dramatically reducing CPU usage. The dominant wait time in AP_Periph is 1024 microseconds as this is the default value of HAL_PERIPH_LOOP_DELAY_US, so a 1ms wait is unlikely to be a problem.

Removes busywait for simulation state packet, dramatically reducing CPU
usage. The dominant wait time in AP_Periph is 1024 microseconds as this
is the default value of HAL_PERIPH_LOOP_DELAY_US, so a 1ms wait is
unlikely to be a problem.
@tridge
Copy link
Contributor

tridge commented Jul 16, 2024

I'd like to know this is OK with either quad-can or quadplane-can flying with a SIM_SPEEDUP of 5
can be merged if this works OK

@tpwrules
Copy link
Contributor Author

tpwrules commented Jul 16, 2024

Tested quad-can with a SIM_SPEEDUP of 5 on the vehicle. Connected over Ethernet to be sure (the sim actually wouldn't start without a network connection), and the vehicle moves fast as if it were moving at 5x.

Everything seemed to look quite stable. The desired vs. actual attitude control in a log looks beautiful, both matching well and not showing instability.

@tridge tridge merged commit a3aa278 into ArduPilot:master Jul 16, 2024
48 checks passed
@tridge
Copy link
Contributor

tridge commented Jul 16, 2024

@tpwrules note that pinging me in code_review would have been better than adding MergeOnCiPass, that tag should only be used by people who do have merge permission for the subsystem

@tpwrules tpwrules deleted the pr/periph-sim-efficiency branch July 17, 2024 00:13
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.

3 participants