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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

None yet

3 participants