I'm trying to run a very basic test of orhelper by stripping down simple_plot.py and playing around with simple.ork by modifying it and saving to modified.ork.
My environment is Ubuntu 22.04.3 LTS, Python 3.10, OpenJDK1.8 (openjdk-8-jre) with simple.ork, modified.ork, and OpenRocket-15.03.jar in the same directory as this script (orhelper-test.py):
import orhelper
from orhelper import FlightDataType, FlightEvent
with orhelper.OpenRocketInstance() as instance:
orh = orhelper.Helper(instance)
doc = orh.load_doc('simple.ork')
sim = doc.getSimulation(0)
orh.run_simulation(sim)
data = orh.get_timeseries(sim, [FlightDataType.TYPE_TIME, FlightDataType.TYPE_ALTITUDE, FlightDataType.TYPE_VELOCITY_Z])
events = orh.get_events(sim)
ejectionChargeTime = events[FlightEvent.EJECTION_CHARGE]
print(f"Ejection charge time: {ejectionChargeTime[0]}")
It runs fine with simple.ork, but if I make a copy of simple.ork by simply opening OpenRocket, opening simple.ork, Saving As modified.ork (with all simulated data), and using modified.ork in my script, I get a MotorIgnitionException from orh.run_simulation(sim):
Exception while calling OpenRocket
Traceback (most recent call last):
File "Simulation.java", line 336, in net.sf.openrocket.document.Simulation.simulate
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/path/to/orhelper-test.py", line 9, in <module>
orh.run_simulation(sim)
File "/path/to/venv/lib/python3.10/site-packages/orhelper/_orhelper.py", line 255, in run_simulation
sim.simulate(listener_array)
net.sf.openrocket.simulation.exception.net.sf.openrocket.simulation.exception.MotorIgnitionException: <unprintable net.sf.openrocket.simulation.exception.MotorIgnitionException object>
1.17s - Error on build_exception_info_response.
Traceback (most recent call last):
File "/home/me/.vscode/extensions/ms-python.python-2023.22.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 1494, in build_exception_info_response
stack_str += '%s: %s\n' % (stype, frames_list.exc_desc)
jpype._core.JVMNotRunning: Java Virtual Machine is not running
0.11s - Error on build_exception_info_response.
Traceback (most recent call last):
File "/home/me/.vscode/extensions/ms-python.python-2023.22.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 1494, in build_exception_info_response
stack_str += '%s: %s\n' % (stype, frames_list.exc_desc)
jpype._core.JVMNotRunning: Java Virtual Machine is not running
Traceback (most recent call last):
File "Simulation.java", line 336, in net.sf.openrocket.document.Simulation.simulate
Exception: Java Exception
This is with OpenRocket v23.09 used to re-save simple.ork. I tried to use the v15.03 jar to see if that would resolve this issue, but OpenJDK1.8 doesn't seem to support that:
$ java -jar OpenRocket-15.03.jar
java: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE
Is this a known issue with saved ork files from more recent versions of OpenRocket? Or is there something I need to set in my OpenRocket preferences?
I'm trying to run a very basic test of
orhelperby stripping downsimple_plot.pyand playing around withsimple.orkby modifying it and saving tomodified.ork.My environment is Ubuntu 22.04.3 LTS, Python 3.10, OpenJDK1.8 (
openjdk-8-jre) withsimple.ork,modified.ork, andOpenRocket-15.03.jarin the same directory as this script (orhelper-test.py):It runs fine with
simple.ork, but if I make a copy ofsimple.orkby simply opening OpenRocket, openingsimple.ork, Saving Asmodified.ork(with all simulated data), and usingmodified.orkin my script, I get aMotorIgnitionExceptionfromorh.run_simulation(sim):This is with OpenRocket v23.09 used to re-save
simple.ork. I tried to use the v15.03 jar to see if that would resolve this issue, but OpenJDK1.8 doesn't seem to support that:Is this a known issue with saved
orkfiles from more recent versions of OpenRocket? Or is there something I need to set in my OpenRocket preferences?