Page 1 of 1

Spacecraft body vector

Posted: 02.03.2010, 23:00
by mwjohnston
I have been using Celestia to visalize the attitude of an AFRL spacecraft (not yet launched) named DSX.
I successfully scripted in a ScriptedOrbit and ScriptedRotation.
Visually the attitudes look correct. The Spacecraft ADCS software generates vectors for Sun in the body frame and Earth in the body frame.
I would like to perform a more precise verification. (I am 3D geometry challenged.)

The main problem I am having is the ADCS software produces a quaternion that rotates the body frame and Celestia rotates the body.

How do I get the rotation (orientation?) for the space craft mesh in the space craft body frame?

Thanks

Re: Spacecraft body vector

Posted: 03.03.2010, 19:45
by selden
Body Frames in Celestia are defined relative to some previously declared body.

In other words, you probably could define an intermediate (invisible) body and define its orientation using the given quaternions.

Re: Spacecraft body vector

Posted: 04.03.2010, 14:36
by mwjohnston
Thanks for replying Seldon,
I tried your suggestion.
It looks like the space craft is not following the invisible object's orientation.
Similar to
BodyFrame for ScriptedRotation

here is my .scc file:


"DSX_rt_shadow" "Sol/Earth"
{
# Class "invisible"
Class "spacecraft"
Mesh "dsx.cmod"
Radius 0.04
ScriptedRotation
{
Module "DSX_RT_scripts"
Function "rt_attitude"

DSXqw -0.013119672
DSXqx -0.5275975
DSXqy 0.849344615
DSXqz -0.009081684
}

ScriptedOrbit {
Module "DSX_RT_scripts"
Function "rt_pos"

DSXx 1761.798693
DSXy -5456.007139
DSXz 10947.38138
}

orbitframe { EquatorJ2000 { center "sol/earth" } }

bodyframe { EquatorJ2000 { center "sol/earth" } }
}

"DSX_rt" "Sol/Earth"
{
# Class "invisible"
Class "spacecraft"
Mesh "dsx.cmod"
Radius 0.04

ScriptedOrbit {
Module "DSX_RT_scripts"
Function "rt_pos"

DSXx 1761.798693
DSXy -5456.007139
DSXz 10947.38138
}

orbitframe { EquatorJ2000 { center "sol/earth" } }
Albedo 0.30

bodyframe { BodyFixed { Center "sol/earth/DSX_rt_shadow"} }
}



Thanks

Re: Spacecraft body vector

Posted: 04.03.2010, 21:33
by selden
Although your ssc looks to me like it ought to work, I'm wondering if there's a bug in Celestia which depends on how bodies are related.

You might try making "DSX_rt" a child of "DSX_rt_shadow". That is, include the name of the body being used as the reference in the "path" of the final body.

For example,

Code: Select all

"DSX_rt_shadow" "Sol/Earth" {...}
"DSX_rt" "Sol/Earth/DSX_rt_shadow" {...}


Does doing this make it rotate any differently?

Also, what version of Celestia are you using? 1.6.0 or one built from the current developmental source?
I'm wondering if this is a bug which has been fixed in the code that's on SourceForge.

Re: Spacecraft body vector

Posted: 04.03.2010, 21:48
by mwjohnston
If I make the above change, the rotation is not affected.
The shadow moves about 13Km from the space craft.

I am using the official release. I can try the latest version soon.
I could also try to debug this if I knew what to look for.

Thanks

Re: Spacecraft body vector

Posted: 04.03.2010, 22:10
by mwjohnston
To clarify. I am using 1.6.0

Re: Spacecraft body vector

Posted: 04.03.2010, 22:59
by mwjohnston
I downloaded the latest code.
The dsx_rt attitude is not the same as dsx_rt_shadow.
They are now at the same center.

Re: Spacecraft body vector

Posted: 05.03.2010, 12:57
by selden
Unfortunately, I'm not a quaternions expert. Hopefully Chris will be able to help when he gets back.