In [25]: Maneuver.lambert(gto2, geo)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-25-f36ab89d597a> in <module>
----> 1 Maneuver.lambert(gto2, geo)
~/Projects/LSF/poliastro/library/src/poliastro/maneuver.py in lambert(cls, orbit_i, orbit_f, method, short, **kwargs)
188
189 # Compute all possible solutions to the Lambert transfer
--> 190 sols = list(method(k, r_i, r_f, tof, **kwargs))
191
192 # Return short or long solution
~/Projects/LSF/poliastro/library/src/poliastro/iod/izzo.py in lambert(k, r0, r, tof, M, numiter, rtol)
44 sols = izzo_fast(k_, r0_, r_, tof_, M, numiter, rtol)
45
---> 46 for v0, v in sols:
47 yield v0 << kms, v << kms
~/Projects/LSF/poliastro/library/src/poliastro/core/iod.py in izzo()
190
191 # Check preconditions
--> 192 assert tof > 0
193 assert k > 0
194
AssertionError:
import matplotlib.pyplot as plt
from astropy import units as u
from poliastro.bodies import Earth
from poliastro.twobody import Orbit
from poliastro.maneuver import Maneuver
from poliastro.plotting.static import StaticOrbitPlotter
geo = Orbit.circular(Earth, 36_000 * u.km)
man = Maneuver.impulse([0, 1, 0] * u.km / u.s)
gto = Orbit.circular(Earth, 36_000 * u.km, arglat=-180 * u.deg).apply_maneuver(man).propagate_to_anomaly(0 * u.deg)
fr = StaticOrbitPlotter()
fr.plot(geo)
fr.plot(gto)
plt.show()
Maneuver.lambert(gto, geo)
In [5]: gto.epoch.isot
Out[5]: '2000-01-01T18:16:27.067'
In [6]: geo.epoch.isot
Out[6]: '2000-01-01T12:00:00.000'
We should give a better error message rather than failing inside an assertion.
Example:
To reproduce:
The reason for that is in the epochs of the orbits:
We should give a better error message rather than failing inside an assertion.