Add pitch SAS implementation with Jupyter notebook#1464
Conversation
|
@ANF1S thank you for submitting this well written example! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1464 +/- ##
=======================================
Coverage 25.15% 25.15%
=======================================
Files 169 169
Lines 18811 18811
=======================================
Hits 4731 4731
Misses 14080 14080 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ANF1S thanks for the Jupyter notebook writeup, it looks good. Will still take a closer look, but one initial thing that we need to think about is the location of the aircraft model. I don't think it's a good idea and scalable to add a slightly modified version of an existing aircraft in the repo for potentially each example notebook that needs a modified FDM. I think it would be better to have an May require a bit of extra work to get it to work with Google Colab. |
I agree on this: having a local @ANF1S could you please relocate your input files
in A note on the notebook |
|
@agodemar , @seanmcleod70 Thanks so much for your feedback. I will make those changes. |
|
@ANF1S thanks for providing corrected files. |
|
Hello @agodemar , @seanmcleod70 , I have updated the code and pushed the requested modifications. While testing:
Solution:
Please let me know if this implementation looks good to you or if you would prefer any further adjustments. |
|
@ANF1S are you sure the Moreover, what about: PATH_TO_JSBSIM_FILES= "." |
|
@agodemar the |
|
@agodemar , @seanmcleod70 thanks for the feedback. Locally , I tested
I will update those modifications |
|
Yep, I just downloaded the notebook, the FDM, engine etc. and tested locally. I tested both of the following and both worked. PATH_TO_JSBSIM_FILES= "./"
PATH_TO_JSBSIM_FILES=os.getcwd()I'd suggest leaving the |
|
I haven't tried Google Colab yet. That's going to be a bit trickier in terms of getting the |
|
Looks like 2 main options to get the aircraft data files into Colab, clone the whole repo, seems a bit wasteful, or add some manual directory creation and remote file copying along these lines: |
|
Hmm, after some further testing, it looks like I was having issues trying to So without |
|
@ANF1S in terms of the filename, currently There seem to be a couple of statements that have been copied over from an existing example that aren't relevant for this example: from pathlib import Path
# IC references TAS, comment mentions CAS
fdm['ic/vt-kts'] = 250 #calibrated airspeed (kts)
print("Trim failed, continuing rudder kick in an untrimmed state.") |
|
Thanks for the review @seanmcleod70 . I fixed those lines and also changed the name of the notebook. About |
|
@ANF1S thanks. So from my side the only outstanding thing is the Google Colab support. If the notebook is going to support being launched from the repo into Colab then we need to make sure it works, or we need to remove the Colab support. |
This PR adds a Jupyter notebook example demonstrating a pitch Stability Augmentation System (SAS) implementation for the A-4 Skyhawk aircraft using JSBSim python module.
The work was originated from the Show and Tell discussion: #1448 , where it was suggested submitting a PR after completing the Jupiter notebook example.
Changes:
aircraft/A4xaircraft based on the originalaircraft/A4to implement the pitch SAS example from the baseline aircraft model.pitch_sas.xmlsystem file, where the pitch SAS logic is located.pitch <channel>of the modified aircraft configuration.<actuator>model in thepitch <channel>to introduce response delay between control command and elevator deflection.examples/python/imagesexamples/python/test_pitch_sas.ipynbdemonstrating:The goal is to provide educational example showing how a SAS can be implemented through xml system file and exercised from python.
Notes:
PATH_TO_JSBSIM_FILES=has"--/--"value due to the relative path to the directory where theFDMis located.