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
Spacecraft body vector
-
Topic authormwjohnston
- Posts: 6
- Joined: 12.02.2010
- With us: 14 years 9 months
Re: Spacecraft body vector
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.
In other words, you probably could define an intermediate (invisible) body and define its orientation using the given quaternions.
Selden
-
Topic authormwjohnston
- Posts: 6
- Joined: 12.02.2010
- With us: 14 years 9 months
Re: Spacecraft body vector
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
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
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,
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.
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.
Selden
-
Topic authormwjohnston
- Posts: 6
- Joined: 12.02.2010
- With us: 14 years 9 months
Re: Spacecraft body vector
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
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
-
Topic authormwjohnston
- Posts: 6
- Joined: 12.02.2010
- With us: 14 years 9 months
Re: Spacecraft body vector
To clarify. I am using 1.6.0
-
Topic authormwjohnston
- Posts: 6
- Joined: 12.02.2010
- With us: 14 years 9 months
Re: Spacecraft body vector
I downloaded the latest code.
The dsx_rt attitude is not the same as dsx_rt_shadow.
They are now at the same center.
The dsx_rt attitude is not the same as dsx_rt_shadow.
They are now at the same center.
Re: Spacecraft body vector
Unfortunately, I'm not a quaternions expert. Hopefully Chris will be able to help when he gets back.
Selden