[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orekit Users] Advice sought on frame definitions and transforms



Dear Colleagues,

I am writing to ask for a piece of advice and a sanity check on my frame
transformations. Please see below the code excerpt. I apologize for the MATLAB
constructs but I didn't have time to switch to Java yet.

I initialize a radial-tangent-normal (RTN) frame to be parallel to EME and
then I determine the unit vectors along R and N, say rhat and mhat. I find a
transformation that rotates xhat and zhat of the initial RTN to rhat and mhat.

Here are my questions:
1. Is it correct to assume the original orientation of RTN (parallel with EME)
is given by xhat = [1,0,0] and zhat=[0,0,1]?
2. Is there a way to simplify my frame initialization? E.g., to initialize it
along the RTN directions. (I remember seeing an example somewhere, other than
Frames2.java by Pascal Parraud by I can't find it anymore.)

Thank you!

Bogdan

...
% position, velocity, and angular momentum vectors of the RB orbit
o = rbInitOrb.getPVCoordinates;
rbPosECI = [o.getPosition.getX; o.getPosition.getY; o.getPosition.getZ];
rbVelECI = [o.getVelocity.getX; o.getVelocity.getY; o.getVelocity.getZ];
rbMomECI = [o.getMomentum.getX; o.getMomentum.getY; o.getMomentum.getZ];

% --- orbit and body-fixed reference frames
% initializes RTN frame of RB: parent ECI, orientation parallel to ECI
rbRTNFrame = ...
    UpdatableFrame( eciFrame, Transform.IDENTITY, 'RTN', false );

% orient the frame so that "x" (R) is along position vector, and "z" (N)
% is parallel to the angular momentum of the RB orbit
% finds unit vectors
r = rbPosECI / norm( rbPosECI );                % along position vec
m = rbMomECI / norm( rbMomECI );                % along momentum vec

% casts to Hipparchus vectors
rh = Vector3D( r(1), r(2), r(3) );              % RTN "x" axis
mh = Vector3D( m(1), m(2), m(3) );              % RTN "z" axis

% unit vectors along ECI x and z axes - BU debug - is this legit???
ecix = Vector3D( 1, 0, 0 );                     % unit vec along ECI x
eciz = Vector3D( 0, 0, 1 );                     % unit vec along ECI z

% trasnformation operator from ECI to RTN
eci2rtn = Transform( startDate, Rotation( ecix, eciz, rh, mh ) );

% applies the transformation operator
rbRTNFrame.updateTransform( eciFrame, rbRTNFrame, eci2rtn, startDate );