Search in sources :

Example 26 with Transform

use of org.orekit.frames.Transform in project Orekit by CS-SI.

the class LofOffsetPointing method getTargetPV.

/**
 * {@inheritDoc}
 */
public TimeStampedPVCoordinates getTargetPV(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
    // sample intersection points in current date neighborhood
    final double h = 0.1;
    final List<TimeStampedPVCoordinates> sample = new ArrayList<>();
    Transform centralRefToBody = null;
    for (int i = -1; i < 2; ++i) {
        final AbsoluteDate shifted = date.shiftedBy(i * h);
        // transform from specified reference frame to spacecraft frame
        final Transform refToSc = new Transform(shifted, new Transform(shifted, pvProv.getPVCoordinates(shifted, frame).negate()), new Transform(shifted, attitudeLaw.getAttitude(pvProv, shifted, frame).getOrientation()));
        // transform from specified reference frame to body frame
        final Transform refToBody = frame.getTransformTo(shape.getBodyFrame(), shifted);
        if (i == 0) {
            centralRefToBody = refToBody;
        }
        sample.add(losIntersectionWithBody(new Transform(shifted, refToSc.getInverse(), refToBody)));
    }
    // use interpolation to compute properly the time-derivatives
    final TimeStampedPVCoordinates targetBody = TimeStampedPVCoordinates.interpolate(date, CartesianDerivativesFilter.USE_P, sample);
    // convert back to caller specified frame
    return centralRefToBody.getInverse().transformPVCoordinates(targetBody);
}
Also used : ArrayList(java.util.ArrayList) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) GeodeticPoint(org.orekit.bodies.GeodeticPoint) FieldGeodeticPoint(org.orekit.bodies.FieldGeodeticPoint) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 27 with Transform

use of org.orekit.frames.Transform in project Orekit by CS-SI.

the class NadirPointing method getTargetPV.

/**
 * {@inheritDoc}
 */
public TimeStampedPVCoordinates getTargetPV(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
    // transform from specified reference frame to body frame
    final Transform refToBody = frame.getTransformTo(shape.getBodyFrame(), date);
    // sample intersection points in current date neighborhood
    final double h = 0.01;
    final List<TimeStampedPVCoordinates> sample = new ArrayList<>();
    sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(-2 * h), frame), refToBody.shiftedBy(-2 * h)));
    sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(-h), frame), refToBody.shiftedBy(-h)));
    sample.add(nadirRef(pvProv.getPVCoordinates(date, frame), refToBody));
    sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(+h), frame), refToBody.shiftedBy(+h)));
    sample.add(nadirRef(pvProv.getPVCoordinates(date.shiftedBy(+2 * h), frame), refToBody.shiftedBy(+2 * h)));
    // use interpolation to compute properly the time-derivatives
    return TimeStampedPVCoordinates.interpolate(date, CartesianDerivativesFilter.USE_P, sample);
}
Also used : ArrayList(java.util.ArrayList) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates)

Example 28 with Transform

use of org.orekit.frames.Transform in project Orekit by CS-SI.

the class TabulatedLofOffset method getAttitude.

/**
 * {@inheritDoc}
 */
public Attitude getAttitude(final PVCoordinatesProvider pvProv, final AbsoluteDate date, final Frame frame) throws OrekitException {
    // get attitudes sample on which interpolation will be performed
    final List<TimeStampedAngularCoordinates> sample = table.getNeighbors(date).collect(Collectors.toList());
    // interpolate
    final TimeStampedAngularCoordinates interpolated = TimeStampedAngularCoordinates.interpolate(date, filter, sample);
    // construction of the local orbital frame, using PV from inertial frame
    final PVCoordinates pv = pvProv.getPVCoordinates(date, inertialFrame);
    final Transform inertialToLof = type.transformFromInertial(date, pv);
    // take into account the specified start frame (which may not be an inertial one)
    final Transform frameToInertial = frame.getTransformTo(inertialFrame, date);
    final Transform frameToLof = new Transform(date, frameToInertial, inertialToLof);
    // compose with interpolated rotation
    return new Attitude(date, frame, interpolated.addOffset(frameToLof.getAngular()));
}
Also used : FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) TimeStampedAngularCoordinates(org.orekit.utils.TimeStampedAngularCoordinates)

Example 29 with Transform

use of org.orekit.frames.Transform in project Orekit by CS-SI.

the class GroundStation method getOffsetGeodeticPoint.

/**
 * Get the geodetic point at the center of the offset frame.
 * @param date current date (may be null if displacements are ignored)
 * @return geodetic point at the center of the offset frame
 * @exception OrekitException if frames transforms cannot be computed
 * @since 9.1
 */
public GeodeticPoint getOffsetGeodeticPoint(final AbsoluteDate date) throws OrekitException {
    // take station offset into account
    final double x = parametricModel(eastOffsetDriver);
    final double y = parametricModel(northOffsetDriver);
    final double z = parametricModel(zenithOffsetDriver);
    final BodyShape baseShape = baseFrame.getParentShape();
    final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), date);
    Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
    if (date != null) {
        origin = origin.add(computeDisplacement(date, origin));
    }
    return baseShape.transform(origin, baseShape.getBodyFrame(), null);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) BodyShape(org.orekit.bodies.BodyShape)

Example 30 with Transform

use of org.orekit.frames.Transform in project Orekit by CS-SI.

the class GroundStation method getOffsetToInertial.

/**
 * Get the transform between offset frame and inertial frame.
 * <p>
 * The offset frame takes the <em>current</em> position offset,
 * polar motion and the meridian shift into account. The frame
 * returned is disconnected from later changes in the parameters.
 * When the {@link ParameterDriver parameters} managing these
 * offsets are changed, the method must be called again to retrieve
 * a new offset frame.
 * </p>
 * @param inertial inertial frame to transform to
 * @param date date of the transform
 * @return offset frame defining vectors
 * @exception OrekitException if offset frame cannot be computed for current offset values
 */
public Transform getOffsetToInertial(final Frame inertial, final AbsoluteDate date) throws OrekitException {
    // take Earth offsets into account
    final Transform intermediateToBody = estimatedEarthFrameProvider.getTransform(date).getInverse();
    // take station offset into account
    final double x = parametricModel(eastOffsetDriver);
    final double y = parametricModel(northOffsetDriver);
    final double z = parametricModel(zenithOffsetDriver);
    final BodyShape baseShape = baseFrame.getParentShape();
    final Transform baseToBody = baseFrame.getTransformTo(baseShape.getBodyFrame(), date);
    Vector3D origin = baseToBody.transformPosition(new Vector3D(x, y, z));
    origin = origin.add(computeDisplacement(date, origin));
    final GeodeticPoint originGP = baseShape.transform(origin, baseShape.getBodyFrame(), date);
    final Transform offsetToIntermediate = new Transform(date, new Transform(date, new Rotation(Vector3D.PLUS_I, Vector3D.PLUS_K, originGP.getEast(), originGP.getZenith()), Vector3D.ZERO), new Transform(date, origin));
    // combine all transforms together
    final Transform bodyToInert = baseFrame.getParent().getTransformTo(inertial, date);
    return new Transform(date, offsetToIntermediate, new Transform(date, intermediateToBody, bodyToInert));
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Transform(org.orekit.frames.Transform) FieldTransform(org.orekit.frames.FieldTransform) GeodeticPoint(org.orekit.bodies.GeodeticPoint) FieldGeodeticPoint(org.orekit.bodies.FieldGeodeticPoint) BodyShape(org.orekit.bodies.BodyShape) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation)

Aggregations

Transform (org.orekit.frames.Transform)75 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)56 AbsoluteDate (org.orekit.time.AbsoluteDate)33 Frame (org.orekit.frames.Frame)28 FieldTransform (org.orekit.frames.FieldTransform)26 SpacecraftState (org.orekit.propagation.SpacecraftState)26 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)25 PVCoordinates (org.orekit.utils.PVCoordinates)23 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)21 Test (org.junit.Test)20 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)18 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)17 GeodeticPoint (org.orekit.bodies.GeodeticPoint)13 TopocentricFrame (org.orekit.frames.TopocentricFrame)12 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)11 OrekitException (org.orekit.errors.OrekitException)11 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)10 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)10 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)8 CircularOrbit (org.orekit.orbits.CircularOrbit)8