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

SITL: allow setting jsbsim_ext sim rate multiplier #2

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

spernsteiner
Copy link
Collaborator

I noticed recently that the OpenSUT autopilot is completely non-functional - instead of initializing sensors in a few seconds and letting the user start the mission, it slowly initializes them over the course of several hours (I ran it for 3+ hours and it never reached the "pre-arm good" state) while constantly dropping the connection to MAVproxy. After several days of debugging and a bit of archeology, I found this commit on my old laptop, which apparently I forgot to push when creating #1. Adding this commit fixes the bug.

The actual change in this commit is to allow the JSBSim update rate to be an integer multiple of the autopilot's update rate. The performance overhead of the OpenSUT's nested VM setup means the autopilot update rate can't exceed ~300 Hz, but JSBSim's update rate must be at least 400 Hz (ideally much higher) or else the simulation becomes unstable. To work around this, we run JSBSim at 2500 Hz and run the autopilot at 250 Hz with a sim rate multiplier of 10x. The autopilot needs to be aware of the sim rate multiplier because the autopilot itself is responsible for driving the simulation - it periodically sends commands to JSBSim instructing it to advance the simulation by a certain amount.

I haven't fully investigated the previous bug, but my guess is that the autopilot was timing out waiting for updates from JSBSim. The autopilot was expecting an update after each step, but JSBSim was sending updates only every 10 steps.

Copy link
Collaborator

@podhrmic podhrmic left a comment

Choose a reason for hiding this comment

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

Good catch!

@spernsteiner spernsteiner merged commit 37853cc into VERSE-Plane-4.5 Feb 13, 2025
spernsteiner added a commit to GaloisInc/VERSE-OpenSUT that referenced this pull request Feb 14, 2025
autopilot: update ardupilot submodule

This pulls GaloisInc/verse-ardupilot#2, which allows setting a sim rate multiplier for `jsbsim_ext`, which is required for OpenSUT autopilot setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants