Spacecraft Orientation

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
RocketMan@JSC
Posts: 43
Joined: 29.01.2005
With us: 19 years 7 months

Spacecraft Orientation

Post #1by RocketMan@JSC » 09.06.2006, 01:49

I've searched and browsed for days and still don't have a solid answer. I've read several posts and documents and seem to get conflicting results. I'm trying to input J2K quaternions into tec's xyzq file format and the results don't seem to be working correctly.

Can someone point me to a document or post that fully defines the orientation of a spacecraft?

How specifically is the base reference frame defined?

Next

How are the visual spacecrafts model's body axes defined?

Here's how we define this stuff at work.

We typically use the J2K Earth based inertial reference frame. X axis points to the vernal equinox at the J2K epoch in the mean equatorial plane, Z axis points along the Earth's mean rotation axis, and Y axis completes in the mean equatorial plane.

We typically use the X body axis out the front of the vehicle, Z body axis out the top or bottom, and Y completes.

Lastly, the J2K quaternion describes the rotation from the J2K Earth based inertial frame to the spacecraft body axes. Note that for shuttle we mainly use M50 instead of J2K, but all the new work is in J2K.

Please tell me where the problem is, or where to find a document that defines attitude.

TIA,

Scott

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #2by selden » 09.06.2006, 11:19

Unfortunately, most of Celestia's internal calculations are "documented" only by the code itself. Chris has occasionally posted comments about how things are supposed to work, but, as with any program, there may be bugs in the actual implementation.

Here's a quote from a posting he made some time ago about xyz coordinates. Maybe it'll help.
Each row in a .xyz file is a Julian date followed by a Cartesian coordinate. The units of the coordinates are kilometers. The coordinate system is astrocentric; in our Solar System, this means that the center of the Sun is at (0, 0, 0). The xy plane is the ecliptic plane of the star system at the reference epoch J2000.0; in our Solar System, this is the Earth's orbital plane on Jan 1, 2000. The positive z axis is perpendicular to this plane in the directional sense of Earth's north pole. The x axis points from the Sun to Earth's ascending node, and the y axis completes the right handed coordinate system.
[...]
What I said was actually not quite correct . . . The origin is the center of the parent object, whether it's a star or a planet. If the parent is a planet, the +z axis is the planet's north pole and the xy plane is the planet's equatorial plane at the reference epoch J2000. The x axis points at the ascending node of the equatorial plane on the ecliptic.

The good thing is that these are exactly the same conventions used by JPL's Horizons system by default, so very little processing of Horizons generated ephemerides is necessary. For Sun orbiting objects, just select a center of @10 (Sun), vector output, and eclip for the reference plane.

--Chris
Selden

Topic author
RocketMan@JSC
Posts: 43
Joined: 29.01.2005
With us: 19 years 7 months

Post #3by RocketMan@JSC » 09.06.2006, 12:20

Thanks Selden,

I think for position we are matching up correctly. Now I need to understand the orientation part.

Hopefully someone will post the answer, otherwise I'll be forced to dig into the code and try to figure it out. Maybe I'll see what Horizons does for attitude and try that first. Though Chris is not really talking about attitude, he may have used the same convention.

Just FYI, I've seen a few posts that say the Y-axis points up the North pole, and also a few about being a left handed coordinate system. Both of which are feasible but not very conventional. Someone knowledgable should look into this and remove such disinformation--if it indeed is bad info.

Once I get to the bottom of this I'll be sure to post my results.

Thanks,

Scott

selden wrote:Unfortunately, most of Celestia's internal calculations are "documented" only by the code itself. Chris has occasionally posted comments about how things are supposed to work, but, as with any program, there may be bugs in the actual implementation.

Here's a quote from a posting he made some time ago about xyz coordinates. Maybe it'll help.
Each row in a .xyz file is a Julian date followed by a Cartesian coordinate. The units of the coordinates are kilometers. The coordinate system is astrocentric; in our Solar System, this means that the center of the Sun is at (0, 0, 0). The xy plane is the ecliptic plane of the star system at the reference epoch J2000.0; in our Solar System, this is the Earth's orbital plane on Jan 1, 2000. The positive z axis is perpendicular to this plane in the directional sense of Earth's north pole. The x axis points from the Sun to Earth's ascending node, and the y axis completes the right handed coordinate system.
[...]
What I said was actually not quite correct . . . The origin is the center of the parent object, whether it's a star or a planet. If the parent is a planet, the +z axis is the planet's north pole and the xy plane is the planet's equatorial plane at the reference epoch J2000. The x axis points at the ascending node of the equatorial plane on the ecliptic.

The good thing is that these are exactly the same conventions used by JPL's Horizons system by default, so very little processing of Horizons generated ephemerides is necessary. For Sun orbiting objects, just select a center of @10 (Sun), vector output, and eclip for the reference plane.

--Chris

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 7 months
Location: Seattle, WA USA

Post #4by hank » 09.06.2006, 14:13

RocketMan@JSC wrote:Just FYI, I've seen a few posts that say the Y-axis points up the North pole, and also a few about being a left handed coordinate system. Both of which are feasible but not very conventional.

Scott,

In computer graphics it is traditional for screen coordinates to be defined with the x-y plane centered on the screen, with +x toward the right and +y toward the top (conventional in math and science for 2D graphs) and with +z into the screen, to represent depth (distance). The result is a left-handed coordinate system with +y at the top. This would explain the convention you describe.

- Hank

Eelco
Posts: 12
Joined: 20.12.2005
With us: 18 years 8 months
Location: Groningen

Post #5by Eelco » 27.06.2006, 23:38

Hello rocketman,

My apologies if I don't undersytand what exactly you would want to know, but reading this, could there be some mix-up of the use of equatorial and ecliptic coordinate systems? If at JSC the equatorial system is used, you have to get other quaternion conversions for Celestia. Celestia as far as I know uses ecliptic coordinates for x,y,z where x and y are in the orbital plane projected by the earth on the celestial sphere. The year 2000.0 defines the epoch for the vernal equinox or spring equinox, just as in equatorial J2K coordinate system. The z-axis goes roughly in the direction of the earth's North pole but with an offset of 23?° 26?? according to my copy of Easy PC Astronomy by Peter Duffet-Smith (recommended for a very good introduction to this kind of stuff).

Here is another description of the matter at hand, but there are of course many references to be found;
http://en.wikipedia.org/wiki/Ecliptic_coordinates

0,0,0 in Celestia is supposed to be centered at the sun but there is mention in the archives of a slight error in the code somewhere that puts the sun not exactly at zero coordinates. As long as this affects only the sun's position it does not matter much although I don't know how much of an error there exists? Changing it would put a lot of other calibrations e.g. of moon eclipses off again, at least that is my understanding why the sun has not been moved with respect to Celestia's origin.

Regards, Eelco

Topic author
RocketMan@JSC
Posts: 43
Joined: 29.01.2005
With us: 19 years 7 months

Body Axes

Post #6by RocketMan@JSC » 30.06.2006, 03:41

Hey thanks Eelco, basically the positon part is working fine, the problems I'm having are vehicle orientation. I think I have solved some of the problems. When I have a better understanding of the problem I'll post it up.

In the mean time, I added the ability to display body axes--here's a pic.

Image

It wasn't too hard and gave me a better understanding of what Celestia is doing to the attitude of the various bodies. These are probably J2000 inertial axes for the Earth, in this frame, the axis on the left points to the sun on 3/21, and the vertical axis points along the Earth's north pole. I say probably cause I'm not 100% sure of the frames in Celestia.

Scott

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 7 months

Post #7by ElChristou » 30.06.2006, 11:46

Hey Scott, perhaps you should make your axes emissive, this way they won't have any shadows...
Image

Topic author
RocketMan@JSC
Posts: 43
Joined: 29.01.2005
With us: 19 years 7 months

Different Coordinate System?

Post #8by RocketMan@JSC » 04.07.2006, 01:13

Can someone explain this, apparently the Earth's heliocentric coordinates are switched around from what is normal. Notice the numbers are the same, except the y-z axes are switched and one sign is opposite. This makes no sense to me.

Hhere are data from within the debugger of Celestia's position for Earth:

(gdb) print now
$35 = 2453920.5247453703
(gdb) next
(gdb) print body->getHeliocentricPosition(now)
$36 = {x = 31220042.81869188, y = 2300.3868498641473, z = 148857086.64408979}

and here's the JPL Horizons data:
*******************************************************************************
Ephemeris / WWW_USER Mon Jul 3 17:59:33 2006 Pasadena, USA / Horizons
*******************************************************************************
Target body name: Earth (399) {source: DE405}
Center body name: Sun (10) {source: DE405}
Center-site name: BODY CENTER
*******************************************************************************
Start time : A.D. 2006-Jul-04 00:35:38.0000 CT
Stop time : A.D. 2006-Jul-10 00:00:00.0000 CT
Step-size : 1440 minutes
*******************************************************************************
Center geodetic : .000000000,.000000000,.00000000 {E-lon(deg),Lat(deg),Alt(km)}
Center cylindric: .000000000,.000000000,.00000000 {E-lon(deg),Dxy(km),Dz(km)}
Center radii : 696000.0 x 696000.0 x 696000.0 k{Equator, meridian, pole}
Output units : KM-S
Output format : 01
Reference frame : ICRF/J2000.0
Output type : GEOMETRIC cartesian states
Coordinate systm: Ecliptic and Mean Equinox of Reference Epoch
*******************************************************************************
JDCT
X Y Z
*******************************************************************************
$$SOE
2453920.524745370 = A.D. 2006-Jul-04 00:35:38.0000 (CT)
3.122004350078643E+07 -1.488570597521431E+08 2.350336383335292E+03
$$EOE
*******************************************************************************
Coordinate system description:

Ecliptic and Mean Equinox of Reference Epoch

Reference epoch: J2000.0
xy-plane: plane of the Earth's orbit at the reference epoch
x-axis : out along ascending node of instantaneous plane of the Earth's
orbit and the Earth's mean equator at the reference epoch
z-axis : perpendicular to the xy-plane in the directional (+ or -) sense
of Earth's north pole at the reference epoch.

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #9by selden » 04.07.2006, 20:59

I don't know the answer to your question, but have you looked at the code that reads in xyz trajectory files? That may give a hint as to what's going on.

I know that Celestia does place things correctly when those files have been created using Horizons' heliocentric coordinates.
Selden

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #10by selden » 04.07.2006, 21:14

SampledOrbit::computePosition (in samporbit.cpp) does return values modified in the way you've discovered:

Code: Select all

 return Point3d(pos.x, pos.z, -pos.y);


So the question becomes what coordinate system does Point3d use?

Aha! Of course. It's the 3D coordinate system used by OpenGL, which uses different axis conventions from those used by astronomical coordinate systems.

http://www.falloutsoftware.com/tutorials/gl/gl0.htm
may help.
Selden

produit
Posts: 9
Joined: 29.08.2006
With us: 18 years
Location: Geneva, Switzerland

Post #11by produit » 02.09.2006, 07:58

Hi,

I am working for the INTEGRAL satellite.
I was delighted to see a very good model of INTEGRAL in celestia adds on.
The orbit seems reasonable.
But the orientation of INTEGRAL is wrong. In fact it changes every
20 minutes and we don't know much in advance what it will be.
The historical attitudes information of INTEGRAL is a publicly available information on our web site and I am willing to put it in a form that celestia is able to use
and distribute it.
I need indications how to achieve that.
The way the existing information is stored is:
we have a right handed system from the center of gravity of the spacecraft with x axis pointing in the viewing direction. We store the
right ascension and the declination of the x and z axis in function of time.
Nicolas Produit

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #12by selden » 02.09.2006, 12:41

Nicolas,

Welcome to the Celestia Forum!

Unfortunately, the current version of Celestia does not provide a way to change an object's orientation irregularly. Only continuous rotations can be described in its SSC catalogs.

A future version of Celestia may include support for arbitrary orientation information in trajectory files. This is being discussed in another thread. (I'll try to find a reference to it.)
Selden

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #13by selden » 02.09.2006, 12:48

There are two threads related to your request, I think:

Realtime Interface to Celestia
http://www.celestiaproject.net/forum/viewtopic.php?t=9065
and

Orientation of spacecrafts [feature request]
http://www.celestiaproject.net/forum/viewtopic ... 5493#75493
Selden


Return to “Development”