Comments (10)
I looked at this very briefly the other day when testing the CMake support in VS2017. I thought it may be trivial in terms of just fixing simple things like changing print statements into print functions etc. to make then compatible with both python 2 and 3.
But it looks like we'll need to look into the differences between bytes and strings between python 2 and 3, in particular with SGPath.
`ERROR: testAircrafts (main.CheckAircrafts)
Traceback (most recent call last):
File ".\CheckAircrafts.py", line 45, in testAircrafts
fdm = CreateFDM(self.sandbox)
File "C:\Users\Sean\CMakeBuilds\3f00c6d9-d323-5a32-8a90-665138817fd4\build\x64-Release\tests\JSBSim_utils.py", line 53, in CreateFDM
_fdm = jsbsim.FGFDMExec(root_dir=os.path.join(sandbox(), ''))
File "jsbsim.pyx", line 142, in jsbsim.FGFDMExec.cinit (tests\jsbsim.cxx:3025)
File "jsbsim.pyx", line 308, in jsbsim.FGFDMExec.set_root_dir (tests\jsbsim.cxx:5541)
File "stringsource", line 15, in string.from_py.__pyx_convert_string_from_py_std__in_string (tests\jsbsim.cxx:8873)
TypeError: expected bytes, str found`
from jsbsim.
FYI
I have added a folder Jupyter_Notebooks
in the reference manual repository here.
The folder contains a couple of preliminary tests made via Jupyter notebooks (formerly IPython) running a Python 3 kernel. There are some helper classes defined in the subfolder python
which are designed to perform multiple JSBSim simulations. The classes are adapted from this work that I did in collaboration with one of my former students and colleagues at Fraunhofer Institute for Wind Energy Systems, IWES (Germany).
I run my simulations in Windows and I've put a recent build of JSBSim.exe
(not uploaded) in the subfolder JSBSim
.
from jsbsim.
So you didn't have any issues then with using Python 3 to call into the JSBSim code? Actually taking a quick glance at some of your Python code it looks like you're using os.system('JSBSim.exe --script...') to execute instances of JSBSim then and you're not using the Python API wrapper to call the JSBSim classes directly from Python?
from jsbsim.
... you're not using the Python API wrapper to call the JSBSim classes directly from Python?
In fact, that was my approach. But I would love to adapt that work in order to use a Python 3 API wrapper. We might use it to make reports on engineering flight simulations via Jupyter.
from jsbsim.
FYI
I'm continuing to create more Jupyter notebooks (with Python3 kernel) to check various aspects in JSBSim ecosystem. Here is one that parses FDM config files, searches for tabular data, and make plots: Jupyter_Notebooks/02_reading_jsbsim_config.ipynb
from jsbsim.
@agodemar perfect, I was actually starting to write something very similar. My aim is to given an FDM generate a set of plots for a visual/graph representation, e.g. Cl vs AoA, Cd vs AoA, Cl vs Cd, plus graph the individual items that make up for example Cd, so Cd0, Cdi etc.
Did you notice the funny kink in the ground effect curve of your C172 versus the one retrieved from GitHub? I checked in a fix for the kink a while ago.
from jsbsim.
@seanmcleod Jupyter notebooks can help a lot in creating reports on FDM config files as well on results. The classes that I've put here have been designed with that in mind. They need to be enhanced with the task you were mentioning:
given an FDM generate a set of plots for a visual/graph representation, e.g. Cl vs AoA, Cd vs AoA, Cl vs Cd, plus graph the individual items that make up for example Cd, so Cd0, Cdi etc.
Yes, I did notice the kink and I knew you submitted a smother version of that curve.
from jsbsim.
@agodemar yep I've used Jupyter notebooks on other non-JSBSim related projects.
In terms of plotting data from the FDM I was thinking of using the JSBSim python API in order to be able to evaluate functions that are defined rather than parsing the xml looking for table data etc.
So for example if Cdi is defined as a function using Cl^2 etc. the graphing code would evaluate it as well as handling functions with table data.
The Cdi based on Cl^2 is actually more complicated since the code would need to first lookup the Cl values from the Cl vs AoA function and then use those when evaluating the Cdi function etc.
from jsbsim.
FYI @ezietsman made the pull request #23 to update the tests to Python 3.6 and keep them compatible with Python 2.7. The PR is currently needing some changes before being merged but this is just a matter of a couple of details. I am confident they should be resolved quickly.
from jsbsim.
@agodemar and @seanmcleod The PR #23 has been merged. I think we can close this issue.
from jsbsim.
Related Issues (20)
- JSBSim Simulink Function HOT 36
- Rust HOT 13
- Can autopilot feature come to jsbsim- unreal engine 5? HOT 2
- MSVC: toupper is not a member of std HOT 1
- Missing target_include_directories in libJSBSim
- JSBSIM_ prefix in CMake options
- Cython warnings about 'tp_print' which is deprecated
- Wrong calculation of vPQRdot in FGAccelerations class HOT 4
- Fixing the mixture for JSBSim piston aircraft HOT 54
- Request: turbine spindown table or property support HOT 2
- Aircraft crashed on air when rolling consecutively HOT 15
- How Jsbsim models the "+" shaped tail fins of missiles and rockets. HOT 1
- After changing pitch and long initial conditions the yaw angle changes also for no reason HOT 1
- JSBSim interface to Matlab on Windows: throttle command from joystick doesn't work HOT 5
- Trim succeeds and results in NaN values HOT 1
- JSBSim and s-function have different results and different reactivity themselves HOT 1
- Building for Unreal 5 on Linux not working HOT 7
- Javascript alternative? HOT 2
- Linearization and simplex trim from console executable and xml script HOT 16
- FGTurbine Shutdown Spin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsbsim.