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

modifications for ArduPilot to work with the latest JSBSim #8710

Closed
wants to merge 2 commits into from

Conversation

WillemEerland
Copy link

This modifications allows using the latest JSBSim code

the tutorial to setup SITL ( http://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html#setting-up-sitl-on-linux ) points to www.github.com/tridge/jsbsim which uses the JSBSim code from 2012

these modifications allow the use of the latest JSBSim code found at https://github.com/JSBSim-Team/jsbsim and involves

  • removing the version check "(ArduPilot)"
  • replacing "udp" with "UDP", otherwise it defaults to the TCP port

@tridge
Copy link
Contributor

tridge commented Jun 22, 2018

does the lock-step scheduling work?
The way to tell is to change change the speed with SIM_SPEEDUP and it should fly exactly the same. I had special hacks for lock-step in my repo.
Another good test is to attach to ArduPilot with gdb and stop it for a bit, then start it again. It should not affect the physics.

@WillemEerland
Copy link
Author

Good point. It seems I've "fixed" the connection, but the functionality is not quite there yet.

I have replaced the "step" with "iterate 1", which (I think) has the same functionality.

see "iterate" at https://github.com/JSBSim-Team/jsbsim/blob/master/src/input_output/FGInputSocket.cpp

The simulation still doesn't really do what is expected - any advice you can give me would be appreciated, seeing as you made the original modifications.

@seanmcleod
Copy link

@WillemEerland I noticed the following in JSBSim.cpp:

    // Check if increment then hold is on and take appropriate actions if it is
    // Iterate is not supported in realtime - only in batch and playnice modes
    FDMExec->CheckIncrementalHold();

What mode are you running JSBSim in?

@seanmcleod
Copy link

I haven't seen the details of the hacks yet for the previous lock-step scheduling, but coincidentally we are busy discussing a pull request for JSBSim for lock-step scheduling.

Take a look at the discussion so far - JSBSim-Team/jsbsim#72

So maybe this pull request will result in an official lock-step implementation that could be used with Ardupilot?

@tridge
Copy link
Contributor

tridge commented Jun 22, 2018

@seanmcleod the "step" mode which supports the current lock-step scheduling in ArduPilot is here:
tridge/jsbsim@9a68300
I'm glad to hear it is being looked at in mainstream JSBSim now! I didn't submit my patch when I did it as I thought it would be considered a bit of a specialist hack.
Lock-step scheduling is essential for ArduPilot usage of JSBSim though. Without it the EKF gets unhappy very quickly as the sensor data is not kinematically consistent. It is also darn useful to be able to stop the simulation in a debugger and not affect the physics

@WillemEerland
Copy link
Author

@tridge @seanmcleod Thank you both your comments - I'm going to close this pull request for now, I'll submit a new request when I have the ArduPilot - JSBSim (latest version) SITL simulation working properly.

(to be continued)

@WillemEerland WillemEerland deleted the sitl branch June 25, 2018 05:18
@WillemEerland WillemEerland restored the sitl branch June 25, 2018 05:18
@WillemEerland WillemEerland deleted the sitl branch October 28, 2018 05:08
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.

3 participants