-
Notifications
You must be signed in to change notification settings - Fork 1
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: add jsbsim_ext ("external JSBSim") model #1
Conversation
The ordinary `JSBSim` simulator model is designed to spawn and manage a JSBSim process itself. This commit removes that logic and adjusts the control port number to work with jsbsim_proxy.
3405b0b
to
90f9488
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please push these changes into a new branch in https://github.com/galoisinc/ardupilot/
I opened an IT ticket to get you access, hopefully it will happen soon.
That's a public repo - did we finally get DISTAR approval for VERSE? I haven't heard any update on that in a while |
DISTAR is not ready yet, thus we will need to use this repo and move it over later. |
Is this good to merge, then? |
Yes, just approved. |
Add jsbsim_proxy for use with ArduPilot This adds a `jsbsim_proxy` tool, which can be used in conjunction with the ArduPilot SITL `jsbsim_ext` model (GaloisInc/verse-ardupilot#1) to run JSBSim on a separate machine from the `arduplane` SITL binary. See the `jsbsim_proxy` README for instructions, and see the comment at the top of `jsbsim_proxy.c` for details of the design.
SITL: allow setting jsbsim_ext sim rate multiplier 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.
This branch adds a new aircraft model
jsbsim_ext
for the SITL simulator. This is similar to the existingjsbsim
model, but connects to an existingjsbsim_proxy
process instead of starting JSBSim itself. This allows JSBSim to run on a different machine from the SITL binary, which we need for the OpenSUT configuration.The first commit adds the
jsbsim_ext
model as an exact copy ofjsbsim
, just renamed. The second commit implements the new behavior.Part of GaloisInc/VERSE-OpenSUT#97