0

I have two moving objects with position and orientation data (Euler Angles, Quaternions) relative to ECI coordinate frame. I would like to calculate AZ/EL from what I'm guessing is the "body frame" of the first object. I have attempted to convert both objects into the body frame through rotation matrices (X-Y-Z and Z-Y-X rotation sequence) and calculate a target vector AZ/EL this way but have not had success. I've also tried to get body frame positions and calculate the body axis/angles and convert back to Eulers (relative to body frame). I'm never sure how the coordinate system axes I'm supposedly creating are aligned along my object.

I have found a couple other questions like this answered with Quaternion solutions so that may be the best path to take, however my Quaternion background is weak at best and I fail to see how the computations given result in a target vector.

Any advice would be much appreciated and I'm happy to share my progress/experiences going forward.

bottleR
  • 1
  • 1
  • 2
  • Would something like [this](http://www.mathworks.nl/help/aerotbx/ug/quat2angle.html) help? If you dont have the Aerospace Toolbox, you can find similar functions online easily. – MeMyselfAndI Oct 16 '14 at 19:06
  • I believe that would help if I had a quaternion relative to body frame between the two objects. Is something like that easily calculable? – bottleR Oct 16 '14 at 19:13

1 Answers1

1
  1. get the current NEH transform matrix for the moving object

    you must know position and at least two directions from North,East,Height(Up or Altitude) of the moving object otherwise is your problem unsolvable no matter what. This matrix/frame is called NEH (X=North,Y=East,Z=Height) or sometimes also ENU (X=East,Y=North,Z=Up). Look here transform matrix anatomy and here Earth's NEH construction and change the position and radius to match your moving object.

  2. convert point P0 from GCS (global coordinate system) to NEH

    simply: P1=Inverse(NEH)*P0 where P1 is now in NEH LCS (Local coordinate system). Both P0,P1 are in homogenous coordinates { x,y,z,w=1 } to allow multiplications with 4x4 matrix so you can compute azimut and elevation directly from it:

    NEH vs. Azimutal coordinates

    • Azimut=atanxy(P1.x,P1.y);
    • Elevation=atan(P1.z/sqrt((P1.x*P1.x)+(P1.y*P1.y)));

    where atanxy is mine atan2 (4 quadrant atan) first is dx then dy. I think atan2 in matlab has it in reverse.

[Notes]

Always visually check all frames (especially NEH). Just draw the 3 axises as lines of some length to validate if the result is correct. It should look like on image, just different color for each axis. You can move to next point only if NEH is OK !!!

Check atan2/atanxy operands order and also check goniometric functions units (rad,deg) to avoid confusions.

Community
  • 1
  • 1
Spektre
  • 49,595
  • 11
  • 110
  • 380