Page 1 of 1

Using STK .a attitude file in Celestia?

Posted: 14.06.2009, 11:22
by BrianJ
Hi,
I'm trying to use the attitude and ephemeris data from STK .a and .e files for a spacecraft.

I think I've got the ephemeris data converted OK(spacecraft looks like it's in the right place) but the attitude is wrong. Can anyone give me any pointers about this?

Here's the header info and first data line from the STK attitude .a file:

Code: Select all

stk.v.8.0
BEGIN Attitude

NumberOfAttitudePoints      9001
    BlockingFactor          20
    InterpolationOrder      1
CentralBody         Earth
ScenarioEpoch         25 Jun 2009 03:30:00.000000000
CoordinateAxes      J2000

AttitudeTimeQuaternions
0.00000000000000e+000 -6.87627830666118e-001 1.22316763338842e-001 -6.96446401211055e-001 1.64830173633011e-001


Here's the corresponding entry in my Celestia .q file:

Code: Select all

2455007.6458333   -0.6876278   0.1223168 -0.6964464   0.1648302

I have tried putting the last quarternion entry first, so the .q file looks like this:

Code: Select all

2455007.6458333   0.1648302   -0.6876278   0.1223168   -0.6964464


Here's what I have in my spacecraft .ssc:

Code: Select all

"MySpacecraft" "Sol/Earth"
{
   Class      "spacecraft"
   Radius      0.006
   Beginning      2455007.6458333
   Ending      2455007.7500000
   OrbitFrame { EquatorJ2000 { Center "Sol/Earth"  } }
   BodyFrame { EquatorJ2000 { Center "Sol/Earth"  } }
   SampledOrbit   "myspacecraft.xyz"
   SampledOrientation   "myspacecraft.q"
   Albedo      1.0
   FixedRotation{}
}


I have also tried using BodyFrame { EclipticJ2000 { Center "Sol/Earth" } }


Any ideas?

Thanks,
Brian

Re: Using STK .a attitude file in Celestia?

Posted: 15.06.2009, 14:19
by chris
Everything looks OK with your object definition. If you're using a mesh, you probably need to add this line:

MeshOrientation [ 90 1 0 0 ]

to get it to align correctly with the local body frame. Have you tried looking the body axes of the object? If not, right click on the spacecraft and select 'Show Body Axes' from the Reference Vectors menu. This is a very useful feature for debugging attitude problems.

--Chris

Re: Using STK .a attitude file in Celestia?

Posted: 17.06.2009, 10:17
by BrianJ
Thanks Chris,
yes, the "body axes" and "frame axes" display are a big help in understanding whats going on.

The spacecraft mesh is pretty irrelevant at this point - I just want the body axes to match their orientation in STK.

As far as I can tell from browsing the web, Celestia's "EquatorJ2000" frame of reference is the same as STK's default Earth/J2000 frame (the STK pos/vel .e file seems to work fine)

But there's some difference in the attitude definitions - I'm going to have to get my head around how quarternions work!

The closest I've got so far is to get the body axes in Celestia opposite to what I think they should be, by taking the STK .a data format [time x y z w] and converting to [time w -x -y -z] for the Celestia .q file.

Still working on it - I'll get it eventually :-)

Regards,
Brian