Commit b5e76344 authored by Maxime Journot's avatar Maxime Journot
Browse files

Fixed wrong implementation of NTW LOF frame.

Fixes #909
parent 173eba29
......@@ -21,6 +21,9 @@
<release version="11.2" date="TBD" description="TBD">
<action dev="maxime" type="fix" issue="909">
Fixed wrong implementation of NTW LOF frame.
<action dev="pascal" type="add" issue="911">
Added TDOA and bistatic range rate measurements.
......@@ -285,19 +285,16 @@ public enum LOFType {
/** {@inheritDoc} */
public Rotation rotationFromInertial(final PVCoordinates pv) {
final Vector3D m = pv.getMomentum();
return new Rotation(new Vector3D(-m.getY(), m.getX(), 0), m,
Vector3D.PLUS_I, Vector3D.PLUS_J);
return new Rotation(pv.getVelocity(), pv.getMomentum(),
Vector3D.PLUS_J, Vector3D.PLUS_K);
public <T extends CalculusFieldElement<T>> FieldRotation<T> rotationFromInertial(final Field<T> field,
final FieldPVCoordinates<T> pv) {
final FieldVector3D<T> m = pv.getMomentum();
return new FieldRotation<>(new FieldVector3D<>(m.getY().negate(), m.getX(), field.getZero()),
new FieldVector3D<>(field, Vector3D.PLUS_I),
new FieldVector3D<>(field, Vector3D.PLUS_J));
return new FieldRotation<>(pv.getVelocity(), pv.getMomentum(),
new FieldVector3D<>(field, Vector3D.PLUS_J),
new FieldVector3D<>(field, Vector3D.PLUS_K));
......@@ -225,12 +225,10 @@ public class LofOffsetPointingTest {
final TimeStampedPVCoordinates pvD = provider.getTargetPV(orbit, date, frame);
final TimeStampedFieldPVCoordinates<T> pvF = provider.getTargetPV(orbitF, dateF, frame);
// These tolerances may be too tight given that the frames are built
// with simpleEop=true which introduces some errors at about this level
Assert.assertEquals(0.0, Vector3D.distance(pvD.getPosition(), pvF.getPosition().toVector3D()), 9.0e-9);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getVelocity(), pvF.getVelocity().toVector3D()), 5.0e-9);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getAcceleration(), pvF.getAcceleration().toVector3D()), 4.0e-5);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getPosition(), pvF.getPosition().toVector3D()), 6.0e-9);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getVelocity(), pvF.getVelocity().toVector3D()), 5.0e-13);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getAcceleration(), pvF.getAcceleration().toVector3D()), 2.0e-6);
......@@ -248,7 +246,7 @@ public class LofOffsetPointingTest {
mu = 3.9860047e14;
// Reference frame = ITRF
frameItrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
frameItrf = FramesFactory.getITRF(IERSConventions.IERS_2010, false);
// Elliptic earth shape
earthSpheric =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment