tudat-team / tudatpy

A Python platform to perform astrodynamics and space research.

Home Page:https://tudat-space.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saving single term of spherical harmonic acceleration causes runtime error

FilippoOggionni opened this issue · comments

If the third argument of this function is called with a list of only one tuple, the program crashes.

Example
✅ the following works:
propagation_setup.dependent_variable.spherical_harmonic_terms_acceleration_norm( "Spacecraft", "Earth", [(0, 0), (2, 0)])
❌ the following causes an error:
propagation_setup.dependent_variable.spherical_harmonic_terms_acceleration_norm( "Spacecraft", "Earth", [(0, 0)]).

Probably due to a pybind conversion from Python list to C++ std::vector?

Probably due to a pybind conversion from Python list to C++ std::vector?

I finally decided to have a look a this: the issue is not in pybind, but in Tudat. In this case, the dependent variable is a scalar, but in the general case it will be a vector, leading to this being incorrectly processed. I've made a modification to the code that should correct it. Tests are now building.

I assume that these tests passed, and that we can now close this issue @DominicDirkx ?