Hi.
I'm new in the Celestia world so I would like to ask you a couple of questions. I've already seen in the forum you're very nice
Where I work we perform some AOCS tests to Herschel/Planck (mostly Planck) and we would like to make some movies and CELX scripts of our results.
Basically, I have a huge file full of quaternions describing Planck's attitude for different phases and I have to display a Planck's 3D model with axis and stuff performing the maneouvres. I've read lots of post regarding reference frames and rotations but I don't have clear if what I'm attempting is feasible.
Planck will be orbiting L2 (the second Lagrangian point) and pointing to the antisun direction. It is spin-stabilized so any change in the attitude is quite complicated, so it's my file full of quaternions.
If it's possible to do this visualization, I can handle to post some nice (public open data) CELX scripts and movies.
I already have one cvs celestia version working and currently I'm learning how to handle celestia itself. Then Lua.
Thanks!
Planck attitude
Planck attitude
ALIQVANDO BONVS DORMITAT HOMERVS
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Yet, it is feasible with the latest Celestia 1.5.0 prerelease. Someone involved with INTEGRAL took a file of quaternions representing years worth of attitude data for the spacecraft and used it within Celestia.
For the spacecraft attitude, you just need to provide an ASCII file with time/quaternion pairs. The time is a Julian day number. The attitudes need not be evenly spaced in time. You probably have a file that's already in a format close to this. The default reference frame of a Sun-orbiting object the J2000 ecliptic; you can change easily change this to an equatorial reference frame if that's how Planck's attitude is given.
Do you have heliocentric positions for the spacecraft, or are they relative to L2?
--Chris
For the spacecraft attitude, you just need to provide an ASCII file with time/quaternion pairs. The time is a Julian day number. The attitudes need not be evenly spaced in time. You probably have a file that's already in a format close to this. The default reference frame of a Sun-orbiting object the J2000 ecliptic; you can change easily change this to an equatorial reference frame if that's how Planck's attitude is given.
Do you have heliocentric positions for the spacecraft, or are they relative to L2?
--Chris
Everything is related to L2, actually we suppose Planck is fixed when performing calculations.
Today I managed to create the ".q" file with the time in Julian day, easy. For the orbit I used your example in:
http://shatters.net/forum/viewtopic.php?t=10311&highlight=sampledorientation
I modified it a bit to use the SampledOrientation instead of FixedPosition.
But it doesn't work. I can't select Planck.
I tested INTEGRAL with their ".xyz" and ".q" files and it was amazing. I also experimented with the ".q" file to see a bigger rotation and it worked smooth.
My primary source of knowledge is "The Celestia Notes".
Write you later. I'll try to get it working.[/url]
Today I managed to create the ".q" file with the time in Julian day, easy. For the orbit I used your example in:
http://shatters.net/forum/viewtopic.php?t=10311&highlight=sampledorientation
I modified it a bit to use the SampledOrientation instead of FixedPosition.
Code: Select all
"Planck" "Sol/Earth"
{
# Mesh "The mesh file"
# Radius "The model radius"
OrbitFrame {
TwoVector {
Center "Sol/Earth"
Primary {
Type "RelativePosition"
Axis "x"
Observer "Sol/Earth"
Target "Sol"
}
Secondary {
Type "RelativeVelocity"
Axis "y"
Observer "Sol/Earth"
Target "Sol"
}
}
}
SampledOrientation "planck.q"
}
But it doesn't work. I can't select Planck.
I tested INTEGRAL with their ".xyz" and ".q" files and it was amazing. I also experimented with the ".q" file to see a bigger rotation and it worked smooth.
My primary source of knowledge is "The Celestia Notes".
Write you later. I'll try to get it working.[/url]
ALIQVANDO BONVS DORMITAT HOMERVS
The specification
is obsolete. Chris changed it before the prereleases were created. I've now gone through my "Celestia Notes" page and updated all of the older examples to use the newer named block format instead. Sorry for the confusion.
Your SSC file will work if you change it to contain
The SSC that you posted omitted several required elements. I don't know if the ssc you actually used might have included them.
Specifically:
Radius is required for any body to be drawn.
FixedPosition is required to place the object within the specified OrbitFrame.
Although the BodyFrame value of EclipticJ2000 is supposed to be the default, I tend to include defaults just so there is no confusion.
I've edited the above and verified that it actually works if a valid Quaternion file is in its data directory.
Code: Select all
Type "..."
is obsolete. Chris changed it before the prereleases were created. I've now gone through my "Celestia Notes" page and updated all of the older examples to use the newer named block format instead. Sorry for the confusion.
Your SSC file will work if you change it to contain
Code: Select all
"Planck" "Sol"
{
# Mesh "The mesh file"
Radius 0.01 # "The model radius"
OrbitFrame {
TwoVector {
Center "Sol/Earth"
Primary {
Axis "x"
RelativePosition {
Observer "Sol/Earth"
Target "Sol"
}
}
Secondary {
Axis "y"
RelativeVelocity {
Observer "Sol/Earth"
Target "Sol"
}
}
}
}
FixedPosition [ -1500000 0 0 ]
BodyFrame { EclipticJ2000 { Center "Sol" } }
SampledOrientation "planck.q"
Albedo 1
}
}
The SSC that you posted omitted several required elements. I don't know if the ssc you actually used might have included them.
Specifically:
Radius is required for any body to be drawn.
FixedPosition is required to place the object within the specified OrbitFrame.
Although the BodyFrame value of EclipticJ2000 is supposed to be the default, I tend to include defaults just so there is no confusion.
I've edited the above and verified that it actually works if a valid Quaternion file is in its data directory.
Selden
Thanks!!. I used your code and now I have Planck right in L2. I missed the FixedPosition and the BodyFrame.
However, it doesn't rotate as indicated in the quaternions file, it is just fixed to the OrbitFrame (I took some time to realize it). I have to check my Celestia version, may be it is wrong because it worked for you. I have this two:
http://www.shatters.net/forum/viewtopic.php?t=10528&highlight=0pre2
Currently this CVS (thanx to Phoenix):
http://www.purebytes.de/stuff/celestia/
I've checked the quaternions file and it is correct, the first field is the Julian day, the second is the scalar component of the quaternion, and the rest are the complex part of the quaternion (say x, y, z). I've also checked the coordinate system of the quaternions and it is in the ecliptic plane with X pointing from Sun to Earth, Z perpendicular to the ecliptic, Y completes for a right handed coordinate system.
I used a bunch of 90deg rotations with the INTEGRAL ".xyz" file and it rotates perfectly.
Let me try to explain what I understand so far.
We have defined a new reference that moves together with the Sol/Earth system, center Sol, X pointing from Sun to Earth and it is called OrbitFrame. In the FixedPosition [ -1500000 0 0 ] of the OrbitFrame we draw the 3D model.
Then we define another reference called BodyFrame with center Sol, Z=0 equal to the ecliptic and X pointing to the Sun/Earth vector in the date J2000.
We then define a succession of quaternions that moves the 3D model. This movement is referenced to the BodyFrame.
Well I hope this is correct.
BTW, ultimately I want to superpose the Lissajous to L2, so I think I'd better define first the L2 SSC file and then the Plank SSC file refering to L2. ??What do you think?
I'll try to give you something tomorrow, I don't even know what I'm doing wrong.
... and thanks again for everything
However, it doesn't rotate as indicated in the quaternions file, it is just fixed to the OrbitFrame (I took some time to realize it). I have to check my Celestia version, may be it is wrong because it worked for you. I have this two:
http://www.shatters.net/forum/viewtopic.php?t=10528&highlight=0pre2
Currently this CVS (thanx to Phoenix):
http://www.purebytes.de/stuff/celestia/
I've checked the quaternions file and it is correct, the first field is the Julian day, the second is the scalar component of the quaternion, and the rest are the complex part of the quaternion (say x, y, z). I've also checked the coordinate system of the quaternions and it is in the ecliptic plane with X pointing from Sun to Earth, Z perpendicular to the ecliptic, Y completes for a right handed coordinate system.
I used a bunch of 90deg rotations with the INTEGRAL ".xyz" file and it rotates perfectly.
Let me try to explain what I understand so far.
We have defined a new reference that moves together with the Sol/Earth system, center Sol, X pointing from Sun to Earth and it is called OrbitFrame. In the FixedPosition [ -1500000 0 0 ] of the OrbitFrame we draw the 3D model.
Then we define another reference called BodyFrame with center Sol, Z=0 equal to the ecliptic and X pointing to the Sun/Earth vector in the date J2000.
We then define a succession of quaternions that moves the 3D model. This movement is referenced to the BodyFrame.
Well I hope this is correct.
BTW, ultimately I want to superpose the Lissajous to L2, so I think I'd better define first the L2 SSC file and then the Plank SSC file refering to L2. ??What do you think?
I'll try to give you something tomorrow, I don't even know what I'm doing wrong.
... and thanks again for everything
ALIQVANDO BONVS DORMITAT HOMERVS
Finally it worked perfectly. I remade the quaternions file. I still don't know what went wrong, probably the ".q" file wasn't correct. I now have a new working one.
here is what I've done:
and this one for Planck:
I've tried to use BodyFixed instead of EclipticJ2000 inside Plank's BodyFrame but it didn't give me the right position. I've to study it.
I will try to use a Lua function to define the Lissajous so the Planck's OrbitFrame uses it instead of a BodyFixed one. Else I'll use a SampledOrbit.
Do you know if it is normal that the planets orbits are drawn in front of the satellite model? I would like to see the orbits hided behind the 3D model when appropriate.
Once again thanks for everything. The wikibook is excelent and the Celestia Notes too. If finally I make some documentation I can give it to you.
I'll keep posting with my prorgess.
here is what I've done:
Code: Select all
"L2" "Sol"
{
Class "invisible"
Radius 0.001
OrbitFrame {
TwoVector {
Center "Sol/Earth"
Primary {
Axis "x"
RelativePosition {
Observer "Sol/Earth"
Target "Sol"
}
}
Secondary {
Axis "y"
RelativeVelocity {
Observer "Sol/Earth"
Target "Sol"
}
}
}
}
FixedPosition [ -1500000 0 0 ]
BodyFrame {
EclipticJ2000 {
Center "Sol"
}
}
}
and this one for Planck:
Code: Select all
"Planck" "Sol/L2"
{
Class "spacecraft"
Mesh "planck.3ds"
Radius 0.03
OrbitFrame {
BodyFixed {
Center "Sol/L2"
}
}
FixedPosition [ 0 0 0 ]
BodyFrame {
EclipticJ2000 {
Center "Sol/L2"
}
}
SampledOrientation "Planck_HCM_1.q"
Albedo 0.7
}
I've tried to use BodyFixed instead of EclipticJ2000 inside Plank's BodyFrame but it didn't give me the right position. I've to study it.
I will try to use a Lua function to define the Lissajous so the Planck's OrbitFrame uses it instead of a BodyFixed one. Else I'll use a SampledOrbit.
Do you know if it is normal that the planets orbits are drawn in front of the satellite model? I would like to see the orbits hided behind the 3D model when appropriate.
Once again thanks for everything. The wikibook is excelent and the Celestia Notes too. If finally I make some documentation I can give it to you.
I'll keep posting with my prorgess.
ALIQVANDO BONVS DORMITAT HOMERVS
I would love to see the axis of a body drawn as in this post by Chris:
http://shatters.net/forum/viewtopic.php?p=80271#80271
I don't find any instruction/function/procedure to do so, do you know of any?
http://shatters.net/forum/viewtopic.php?p=80271#80271
I don't find any instruction/function/procedure to do so, do you know of any?
ALIQVANDO BONVS DORMITAT HOMERVS
Arrows like that require that you provide a 3D model of the arrows and that you orient it correctly within Celestia.
Unfortunately, the internal coordinate system used by CMOD models and the external coordinate system used within Celestia are not yet the same so making sure they have the correct relatative orientation is an issue.
Unfortunately, the internal coordinate system used by CMOD models and the external coordinate system used within Celestia are not yet the same so making sure they have the correct relatative orientation is an issue.
Selden